diff --git a/tests/acceptance/SaveNotificationAsDraftCest.php b/tests/acceptance/SaveNotificationAsDraftCest.php new file mode 100644 index 0000000000..2f7362762a --- /dev/null +++ b/tests/acceptance/SaveNotificationAsDraftCest.php @@ -0,0 +1,35 @@ +wantTo('Save post notification email as draft'); + $newsletter_title = 'Draft Test Post Notification'; + $newsletterFactory = new Newsletter(); + $newsletter = $newsletterFactory->withSubject($newsletter_title) + ->withType('notification') + ->withPostNoticationOptions() + ->create(); + // step 2 - Go to editor + $I->login(); + $I->amEditingNewsletter($newsletter->id); + $I->click('Next'); + //Save Notification As Draft + $send_form_element = '[data-automation-id="newsletter_send_form"]'; + $I->waitForElement($send_form_element); + $I->seeInCurrentUrl('mailpoet-newsletters#/send/'); + $search_field_element = 'input.select2-search__field'; + $I->fillField($search_field_element, 'WordPress Users'); + $I->pressKey($search_field_element, \WebDriverKeys::ENTER); + $I->click('Save as draft and close'); + $I->waitForElement('[data-automation-id="newsletters_listing_tabs"]', 10); + $I->seeInCurrentUrl('/wp-admin/admin.php?page=mailpoet-newsletters#/notification'); + $I->waitForText('Draft Test Post Notification'); + } +}