Files
piratepoet/tests/acceptance/DeleteAutomaticWooCommerceEmailCest.php
Jan Jakeš b39dac75d6 Autofix number of newlines between methods
[MAILPOET-2715]
2020-02-19 19:12:53 +00:00

77 lines
2.6 KiB
PHP

<?php
namespace MailPoet\Test\Acceptance;
use MailPoet\Test\DataFactories\Newsletter;
class DeleteAutomaticWooCommerceEmailCest {
public function _before(\AcceptanceTester $i) {
$i->activateWooCommerce();
}
public function trashAutomaticWooCommerceEmail(\AcceptanceTester $i) {
$newsletterName = 'Trash Automatic WooCommerce Email Test';
$newsletterFactory = new Newsletter();
$newsletterFactory
->withSubject($newsletterName)
->withAutomaticTypeWooCommerceFirstPurchase()
->create();
$i->wantTo('Trash automatic WooCommerce email');
$i->login();
$i->amOnMailpoetPage('Emails');
$i->click('[data-automation-id="tab-WooCommerce"]');
$i->waitForText($newsletterName);
$i->clickItemRowActionByItemName($newsletterName, 'Move to trash');
$i->waitForElement('[data-automation-id="filters_trash"]');
$i->click('[data-automation-id="filters_trash"]');
$i->waitForText($newsletterName);
}
public function restoreTrashedAutomaticWooCommerceEmail(\AcceptanceTester $i) {
$newsletterName = 'Restore Trashed Automatic WooCommerce Email Test';
$newsletterFactory = new Newsletter();
$newsletterFactory
->withSubject($newsletterName)
->withAutomaticTypeWooCommerceFirstPurchase()
->withDeleted()
->create();
$i->wantTo('Restore trashed automatic WooCommerce email');
$i->login();
$i->amOnMailpoetPage('Emails');
$i->click('[data-automation-id="tab-WooCommerce"]');
$i->waitForElement('[data-automation-id="filters_trash"]');
$i->click('[data-automation-id="filters_trash"]');
$i->waitForText($newsletterName);
$i->clickItemRowActionByItemName($newsletterName, 'Restore');
$i->amOnMailpoetPage('Emails');
$i->click('[data-automation-id="tab-WooCommerce"]');
$i->waitForText($newsletterName);
}
public function deleteTrashedAutomaticWooCommerceEmail(\AcceptanceTester $i) {
$newsletterName = 'Delete Trashed Automatic WooCommerce Email Test';
$newsletterFactory = new Newsletter();
$newsletterFactory
->withSubject($newsletterName)
->withAutomaticTypeWooCommerceFirstPurchase()
->withDeleted()
->create();
$i->wantTo('Delete trashed automatic WooCommerce email');
$i->login();
$i->amOnMailpoetPage('Emails');
$i->click('[data-automation-id="tab-WooCommerce"]');
$i->waitForElement('[data-automation-id="filters_trash"]');
$i->click('[data-automation-id="filters_trash"]');
$i->waitForText($newsletterName);
$i->clickItemRowActionByItemName($newsletterName, 'Delete Permanently');
$i->waitForText('permanently deleted.');
$i->waitForElementNotVisible($newsletterName);
}
}