Files
piratepoet/tests/acceptance/TrashExistingSegmentCest.php
Jan Jakeš 54549ff037 Convert variable names to camel case
[MAILPOET-1796]
2020-01-14 15:22:42 +01:00

37 lines
1.1 KiB
PHP

<?php
namespace MailPoet\Test\Acceptance;
use MailPoet\Test\DataFactories\DynamicSegment;
use MailPoet\Test\DataFactories\Settings;
class TrashExistingSegmentCest {
public function _before() {
(new Settings())->withWooCommerceListImportPageDisplayed(true);
(new Settings())->withCookieRevenueTrackingDisabled();
}
public function moveSegmentToTrash(\AcceptanceTester $i) {
$i->wantTo('Move an existing segment to trash');
$segmentTitle = 'Move Segment To Trash Test';
$segmentFactory = new DynamicSegment();
$segment = $segmentFactory
->withName($segmentTitle)
->withUserRoleFilter('Administrator')
->create();
$i->login();
$i->amOnMailpoetPage('Segments');
$listingAutomationSelector = '[data-automation-id="listing_item_' . $segment->id . '"]';
$i->waitForText($segmentTitle, 10, $listingAutomationSelector);
$i->clickItemRowActionByItemName($segmentTitle, 'Move to trash');
$i->waitForText('1 segment was moved to the trash.', 10);
$i->click('[data-automation-id="filters_trash"]');
$i->waitForText($segmentTitle, 20, $listingAutomationSelector);
$i->seeNoJSErrors();
}
}