diff --git a/mailpoet/tests/acceptance/Newsletters/ScheduleNewsletterCest.php b/mailpoet/tests/acceptance/Newsletters/ScheduleNewsletterCest.php index 601c108c93..8f329228df 100644 --- a/mailpoet/tests/acceptance/Newsletters/ScheduleNewsletterCest.php +++ b/mailpoet/tests/acceptance/Newsletters/ScheduleNewsletterCest.php @@ -51,9 +51,14 @@ class ScheduleNewsletterCest { $i->selectOptionInSelect2($segmentName); $i->click('[data-automation-id="email-schedule-checkbox"]'); - // step 3 - Pick today's date - $i->wantTo('Pick today‘s date'); + $i->wantTo('Wait for datetime picker'); $i->waitForElement('form input[name=date]'); + + // `Schedule` caption + $i->selectOption('form select[name=time]', $currentDateTime->modify("+1 hour")->format('g:00 a')); + $i->see("Schedule", "button span"); + + $i->wantTo('Pick today‘s date'); $i->click('form input[name=date]'); // The calendar preselects tomorrow's date, making today's date not clickable on the last day of a month. // In case it is not clickable try switching to previous month @@ -65,10 +70,6 @@ class ScheduleNewsletterCest { } $i->click(['class' => "react-datepicker__day--today"]); - // `Schedule` caption - change time to 1 hour after now - $i->selectOption('form select[name=time]', $currentDateTime->modify("+1 hour")->format('g:00 a')); - $i->see("Schedule", "button span"); - // `Send` caption - change time to 1 hour before now $i->selectOption('form select[name=time]', $currentDateTime->modify("-1 hour")->format('g:00 a')); $i->see("Send", "button span");