Improve closing settings panel
Because closing panel causes flakiness we can try it multiple times. [MAILPOET-5240]
This commit is contained in:
@ -28,8 +28,6 @@ class EditorCouponCest {
|
||||
|
||||
public function addCoupon(\AcceptanceTester $i) {
|
||||
$couponInEditor = '[data-automation-id="coupon_block"]';
|
||||
$couponSettingsHeading = '[data-automation-id="coupon_settings_heading"]';
|
||||
$couponSettingsDone = '[data-automation-id="coupon_done_button"]';
|
||||
$footer = '[data-automation-id="footer"]';
|
||||
$sendFormElement = '[data-automation-id="newsletter_send_form"]';
|
||||
$emailSubject = 'Newsletter with Coupon';
|
||||
@ -51,12 +49,6 @@ class EditorCouponCest {
|
||||
$i->moveMouseOver($footer, 3, 2);
|
||||
$i->moveMouseOver($couponInEditor, 3, 2);
|
||||
$i->waitForText('The coupon code will be auto-generated when this campaign is activated.');
|
||||
$i->wantTo('Open coupon settings panel');
|
||||
$i->click($couponInEditor);
|
||||
$i->waitForElement($couponSettingsHeading);
|
||||
$i->wantTo('Close coupon settings panel');
|
||||
$i->click($couponSettingsDone);
|
||||
$i->waitForElementNotVisible($couponSettingsHeading);
|
||||
$i->seeNoJSErrors();
|
||||
|
||||
$i->wantTo('Send the email with coupon');
|
||||
@ -113,8 +105,16 @@ class EditorCouponCest {
|
||||
$i->wantTo('Select predefined coupon');
|
||||
$i->click(Locator::contains('button', 'All coupons'));
|
||||
$i->click(Locator::contains('label', $couponCode));
|
||||
$i->wantTo('Close coupon settings panel');
|
||||
$i->click($couponSettingsDone);
|
||||
// because click on close button doesn't work sometimes and causes flakiness we try to click it 3 times
|
||||
for ($j = 0; $j < 3; $j++) {
|
||||
try {
|
||||
$i->wantTo('Close coupon settings panel');
|
||||
$i->click($couponSettingsDone);
|
||||
break;
|
||||
} catch (\Exception $e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
$i->seeNoJSErrors();
|
||||
$i->canSee($couponCode);
|
||||
|
||||
|
Reference in New Issue
Block a user