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

78 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);
}
}