Merge pull request #1495 from mailpoet/confirm-post-notification-autosave

Confirm Notification Autosave Test [MQ-34]
This commit is contained in:
Michelle Shull
2018-09-13 06:51:44 -04:00
committed by GitHub

View File

@ -0,0 +1,30 @@
<?php
namespace MailPoet\Test\Acceptance;
use MailPoet\Test\DataFactories\Newsletter;
require_once __DIR__ . '/../DataFactories/Newsletter.php';
class ConfirmNotificationAutosaveCest {
function confirmNotificationAutosave(\AcceptanceTester $I) {
$I->wantTo('Confirm Post Notification Autosave');
$newsletter_title = 'Notification Autosave Test';
// step 1 - Prepare post notification data
$newsletter = new Newsletter();
$newsletter = $newsletter->withSubject($newsletter_title)
->withType('notification')
->withPostNoticationOptions()
->create();
// step 2 - Go to editor
$I->login();
$I->amEditingNewsletter($newsletter->id);
// step 3 - Add subject, wait for Autosave
$title_element = '[data-automation-id=\'newsletter_title\']';
$I->waitForElement($title_element);
$I->seeInCurrentUrl('mailpoet-newsletter-editor');
$I->fillField($title_element, $newsletter_title);
$I->wait(10);
$I->see('Autosaved');
}
}