Files
piratepoet/tests/acceptance/DeleteNewsletterCest.php
Jan Jakeš 54549ff037 Convert variable names to camel case
[MAILPOET-1796]
2020-01-14 15:22:42 +01:00

56 lines
2.1 KiB
PHP

<?php
namespace MailPoet\Test\Acceptance;
use MailPoet\Test\DataFactories\Newsletter;
class DeleteNewsletterCest {
public function moveNewsletterToTrash(\AcceptanceTester $i) {
$newsletterName = 'Trash Newsletter';
$newsletter = new Newsletter();
$newsletter->withSubject($newsletterName)->create();
$i->wantTo('Move a newsletter to trash');
$i->login();
$i->amOnMailpoetPage('Emails');
$i->waitForText($newsletterName);
$i->clickItemRowActionByItemName($newsletterName, 'Move to trash');
$i->waitForText('1 email was moved to the trash.');
$i->waitForElement('[data-automation-id="filters_trash"]');
$i->click('[data-automation-id="filters_trash"]');
$i->waitForText($newsletterName);
}
public function restoreFormFromTrash(\AcceptanceTester $i) {
$newsletterName = 'Restore Trashed Newsletter';
$newsletter = new Newsletter();
$newsletter->withSubject($newsletterName)->withDeleted()->create();
$i->wantTo('Restore a newsletter from trash');
$i->login();
$i->amOnMailpoetPage('Emails');
$i->waitForElement('[data-automation-id="filters_trash"]');
$i->click('[data-automation-id="filters_trash"]');
$i->waitForText($newsletterName);
$i->clickItemRowActionByItemName($newsletterName, 'Restore');
$i->waitForText('1 email has been restored from the Trash.');
$i->waitForElement('[data-automation-id="filters_all"]');
$i->click('[data-automation-id="filters_all"]');
$i->waitForText($newsletterName);
}
public function deleteFormPermanently(\AcceptanceTester $i) {
$newsletterName = 'Goodbye Forever Newsletter';
$newsletter = new Newsletter();
$newsletter->withSubject($newsletterName)->withDeleted()->create();
$i->wantTo('Forever delete a newsletter');
$i->login();
$i->amOnMailpoetPage('Emails');
$i->waitForElement('[data-automation-id="filters_trash"]');
$i->click('[data-automation-id="filters_trash"]');
$i->waitForText($newsletterName);
$i->clickItemRowActionByItemName($newsletterName, 'Delete Permanently');
$i->waitForText('1 email was permanently deleted.');
$i->waitForElementNotVisible($newsletterName);
}
}