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(); $newsletterFactory = new Newsletter(); $newsletterFactory ->withSubject($newsletterName . '2') ->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); $i->waitForText($newsletterName . '2'); } }