Fix acceptance tests
[MAILPOET-2480]
This commit is contained in:
@@ -17,6 +17,7 @@ export default () => {
|
||||
</Link>
|
||||
<Link
|
||||
to="/segments"
|
||||
data-automation-id="dynamic-segments-tab"
|
||||
className={classnames('nav-tab', { 'nav-tab-active': current === 'segments' })}
|
||||
>
|
||||
{MailPoet.I18n.t('pageTitleSegments')}
|
||||
|
@@ -91,8 +91,6 @@ class AcceptanceTester extends \Codeception\Actor {
|
||||
$path = 'newsletters';
|
||||
} elseif ($page === 'Lists') {
|
||||
$path = 'segments';
|
||||
} elseif ($page === 'Segments') {
|
||||
$path = 'dynamic-segments';
|
||||
} else {
|
||||
$path = strtolower($page);
|
||||
}
|
||||
|
@@ -9,16 +9,17 @@ class CreateNewSegmentCest {
|
||||
$i->wantTo('Create a new WP user role segment');
|
||||
$segmentTitle = 'Create User Role Segment Test';
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Segments');
|
||||
$i->amOnMailpoetPage('Lists');
|
||||
$i->click('[data-automation-id="new-segment"]');
|
||||
$i->seeInCurrentUrl('#/new');
|
||||
$i->fillField(['name' => 'name'], $segmentTitle);
|
||||
$i->fillField(['name' => 'description'], 'Lorem ipsum dolor amed');
|
||||
$i->selectOption('form select[name=segmentType]', 'WordPress user roles');
|
||||
$i->selectOption('form select[name=wordpressRole]', 'Editor');
|
||||
$i->click('Save');
|
||||
$i->amOnMailpoetPage('Segments');
|
||||
$i->waitForText($segmentTitle, 20);
|
||||
$i->amOnMailpoetPage('Lists');
|
||||
$i->waitForElement('[data-automation-id="dynamic-segments-tab"]');
|
||||
$i->click('[data-automation-id="dynamic-segments-tab"]');
|
||||
$i->waitForText($segmentTitle);
|
||||
}
|
||||
|
||||
public function createEmailSegment(\AcceptanceTester $i) {
|
||||
@@ -28,9 +29,8 @@ class CreateNewSegmentCest {
|
||||
$newsletterFactory->withSubject($emailSubject)->create();
|
||||
$segmentTitle = 'Create Email Segment Test';
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Segments');
|
||||
$i->amOnMailpoetPage('Lists');
|
||||
$i->click('[data-automation-id="new-segment"]');
|
||||
$i->seeInCurrentUrl('#/new');
|
||||
$i->fillField(['name' => 'name'], $segmentTitle);
|
||||
$i->fillField(['name' => 'description'], 'Lorem ipsum dolor amed');
|
||||
$i->selectOption('form select[name=segmentType]', 'Email');
|
||||
@@ -38,7 +38,9 @@ class CreateNewSegmentCest {
|
||||
$i->click('#select2-newsletter_id-container');
|
||||
$i->selectOptionInSelect2($emailSubject);
|
||||
$i->click('Save');
|
||||
$i->amOnMailpoetPage('Segments');
|
||||
$i->amOnMailpoetPage('Lists');
|
||||
$i->waitForElement('[data-automation-id="dynamic-segments-tab"]');
|
||||
$i->click('[data-automation-id="dynamic-segments-tab"]');
|
||||
$i->waitForText($segmentTitle, 20);
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,9 @@ class DeleteTrashedSegmentCest {
|
||||
$listingAutomationSelector = '[data-automation-id="listing_item_' . $segment->id . '"]';
|
||||
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Segments');
|
||||
$i->amOnMailpoetPage('Lists');
|
||||
$i->waitForElement('[data-automation-id="dynamic-segments-tab"]');
|
||||
$i->click('[data-automation-id="dynamic-segments-tab"]');
|
||||
$i->waitForElement('[data-automation-id="filters_trash"]', 10);
|
||||
$i->click('[data-automation-id="filters_trash"]');
|
||||
$i->waitForText($segmentTitle, 10, $listingAutomationSelector);
|
||||
|
@@ -18,18 +18,22 @@ class EditExistingSegmentCest {
|
||||
->create();
|
||||
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Segments');
|
||||
$i->amOnMailpoetPage('Lists');
|
||||
$i->waitForElement('[data-automation-id="dynamic-segments-tab"]');
|
||||
$i->click('[data-automation-id="dynamic-segments-tab"]');
|
||||
$listingAutomationSelector = '[data-automation-id="listing_item_' . $segment->id . '"]';
|
||||
$i->waitForText($segmentTitle, 10, $listingAutomationSelector);
|
||||
$i->clickItemRowActionByItemName($segmentTitle, 'Edit');
|
||||
|
||||
$i->seeInCurrentUrl('mailpoet-dynamic-segments#/edit/' . $segment->id);
|
||||
$i->waitForElementNotVisible('.mailpoet_form_loading');
|
||||
$i->fillField(['name' => 'name'], $segmentEditedTitle);
|
||||
$i->fillField(['name' => 'description'], 'Lorem ipsum dolor amed edited');
|
||||
$i->selectOption('form select[name=segmentType]', 'WordPress user roles');
|
||||
$i->selectOption('form select[name=wordpressRole]', 'Editor');
|
||||
$i->click('Save');
|
||||
$i->amOnMailpoetPage('Lists');
|
||||
$i->waitForElement('[data-automation-id="dynamic-segments-tab"]');
|
||||
$i->click('[data-automation-id="dynamic-segments-tab"]');
|
||||
|
||||
$i->waitForText($segmentEditedTitle, 20, $listingAutomationSelector);
|
||||
$i->seeNoJSErrors();
|
||||
|
@@ -19,7 +19,10 @@ class RestoreTrashedSegmentCest {
|
||||
$listingAutomationSelector = '[data-automation-id="listing_item_' . $segment->id . '"]';
|
||||
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Segments');
|
||||
$i->amOnMailpoetPage('Lists');
|
||||
$i->waitForElement('[data-automation-id="dynamic-segments-tab"]');
|
||||
$i->click('[data-automation-id="dynamic-segments-tab"]');
|
||||
|
||||
$i->waitForElement('[data-automation-id="filters_trash"]', 10);
|
||||
$i->click('[data-automation-id="filters_trash"]');
|
||||
$i->waitForText($segmentTitle, 10, $listingAutomationSelector);
|
||||
|
@@ -23,7 +23,9 @@ class TrashExistingSegmentCest {
|
||||
->create();
|
||||
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Segments');
|
||||
$i->amOnMailpoetPage('Lists');
|
||||
$i->waitForElement('[data-automation-id="dynamic-segments-tab"]');
|
||||
$i->click('[data-automation-id="dynamic-segments-tab"]');
|
||||
$listingAutomationSelector = '[data-automation-id="listing_item_' . $segment->id . '"]';
|
||||
$i->waitForText($segmentTitle, 10, $listingAutomationSelector);
|
||||
$i->clickItemRowActionByItemName($segmentTitle, 'Move to trash');
|
||||
|
@@ -30,7 +30,9 @@ class ViewSegmentSubscribersCest {
|
||||
->create();
|
||||
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Segments');
|
||||
$i->amOnMailpoetPage('Lists');
|
||||
$i->waitForElement('[data-automation-id="dynamic-segments-tab"]');
|
||||
$i->click('[data-automation-id="dynamic-segments-tab"]');
|
||||
$listingAutomationSelector = '[data-automation-id="listing_item_' . $segment->id . '"]';
|
||||
$i->waitForText($segmentTitle, 10, $listingAutomationSelector);
|
||||
$i->clickItemRowActionByItemName($segmentTitle, 'View Subscribers');
|
||||
|
Reference in New Issue
Block a user