Fix SubscriberManagementCest - wait for select2 to render and add more specific selector for Save button (was failing randomly)
This commit is contained in:
@@ -186,6 +186,7 @@ class SubscriberForm extends React.Component { // eslint-disable-line react/pref
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<Form
|
<Form
|
||||||
|
automationId="subscriber_edit_form"
|
||||||
endpoint="subscribers"
|
endpoint="subscribers"
|
||||||
fields={fields}
|
fields={fields}
|
||||||
params={this.props.match.params}
|
params={this.props.match.params}
|
||||||
|
@@ -62,7 +62,7 @@ class SubscriberManagementCest {
|
|||||||
$I->fillField(['name' => 'first_name'], 'New');
|
$I->fillField(['name' => 'first_name'], 'New');
|
||||||
$I->fillField(['name' => 'last_name'], 'GlobalUser');
|
$I->fillField(['name' => 'last_name'], 'GlobalUser');
|
||||||
$I->selectOptionInSelect2($this->segment->get('name'));
|
$I->selectOptionInSelect2($this->segment->get('name'));
|
||||||
$I->click('Save');
|
$I->click('[data-automation-id="subscriber_edit_form"] input[type="submit"]');
|
||||||
$I->amOnMailPoetPage ('Subscribers');
|
$I->amOnMailPoetPage ('Subscribers');
|
||||||
$I->fillField('#search_input', 'newglobaluser99@fakemail.fake');
|
$I->fillField('#search_input', 'newglobaluser99@fakemail.fake');
|
||||||
$I->click('Search');
|
$I->click('Search');
|
||||||
@@ -98,8 +98,10 @@ class SubscriberManagementCest {
|
|||||||
$I->clickItemRowActionByItemName($new_subscriber_email, 'Edit');
|
$I->clickItemRowActionByItemName($new_subscriber_email, 'Edit');
|
||||||
$I->waitForText('Subscriber', 30);
|
$I->waitForText('Subscriber', 30);
|
||||||
$I->seeInCurrentUrl('mailpoet-subscribers#/edit/');
|
$I->seeInCurrentUrl('mailpoet-subscribers#/edit/');
|
||||||
|
$I->waitForElementNotVisible('.mailpoet_form_loading');
|
||||||
|
$I->waitForElement('.select2');
|
||||||
$I->selectOptionInSelect2('Cooking');
|
$I->selectOptionInSelect2('Cooking');
|
||||||
$I->click('Save');
|
$I->click('[data-automation-id="subscriber_edit_form"] input[type="submit"]');
|
||||||
$I->seeNoJSErrors();
|
$I->seeNoJSErrors();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,9 +115,11 @@ class SubscriberManagementCest {
|
|||||||
$I->clickItemRowActionByItemName($new_subscriber_email, 'Edit');
|
$I->clickItemRowActionByItemName($new_subscriber_email, 'Edit');
|
||||||
$I->waitForText('Subscriber', 10);
|
$I->waitForText('Subscriber', 10);
|
||||||
$I->seeInCurrentUrl('mailpoet-subscribers#/edit/');
|
$I->seeInCurrentUrl('mailpoet-subscribers#/edit/');
|
||||||
|
$I->waitForElementNotVisible('.mailpoet_form_loading');
|
||||||
|
$I->waitForElement('.select2');
|
||||||
$I->selectOptionInSelect2('Cooking');
|
$I->selectOptionInSelect2('Cooking');
|
||||||
$I->click('.select2-selection__choice__remove');
|
$I->click('.select2-selection__choice__remove');
|
||||||
$I->click('Save');
|
$I->click('[data-automation-id="subscriber_edit_form"] input[type="submit"]');
|
||||||
$I->waitForText('Subscriber was updated', 10);
|
$I->waitForText('Subscriber was updated', 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user