Files
piratepoet/tests/acceptance/ConfirmNotificationAutosaveCest.php
Pavel Dohnal a346492d46 Refactor post notification factory
[MAILPOET-1550]
2018-10-09 09:24:29 +02:00

31 lines
957 B
PHP

<?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)
->withPostNotificationsType()
->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->waitForText('Autosaved', 20);
}
}