Files
piratepoet/tests/acceptance/SaveNotificationAsDraftCest.php
Ján Mikláš 2aa5790c1e Fix acceptance tests
[MAILPOET-2780]
2020-10-21 12:14:18 +02:00

34 lines
1.2 KiB
PHP

<?php
namespace MailPoet\Test\Acceptance;
use MailPoet\Test\DataFactories\Newsletter;
class SaveNotificationAsDraftCest {
public function saveNotificationAsDraft(\AcceptanceTester $i) {
// step 1 - Prepare post notification data
$i->wantTo('Save post notification email as draft');
$newsletterTitle = 'Draft Test Post Notification';
$newsletterFactory = new Newsletter();
$newsletter = $newsletterFactory->withSubject($newsletterTitle)
->withPostNotificationsType()
->create();
$segmentName = $i->createListWithSubscriber();
// step 2 - Go to editor
$i->login();
$i->amEditingNewsletter($newsletter->id);
$i->click('Next');
//Save Notification As Draft
$sendFormElement = '[data-automation-id="newsletter_send_form"]';
$saveAsDraftButton = '[data-automation-id="email-save-draft"]';
$i->waitForElement($sendFormElement);
$i->selectOptionInSelect2($segmentName);
$i->scrollTo($saveAsDraftButton);
$i->waitForElementVisible($saveAsDraftButton);
$i->click($saveAsDraftButton);
$i->waitForElement('[data-automation-id="newsletters_listing_tabs"]');
$i->waitForText('Draft Test Post Notification');
$i->dontSeeCheckboxIsChecked('.mailpoet-form-toggle input[type="checkbox"]');
}
}