Update tests to reflect removed email types
[MAILPOET-5779]
This commit is contained in:
@@ -105,7 +105,6 @@ class SwitchingLanguagesCest {
|
||||
$i->wantTo('Check Emails listing strings (translated with MailPoet.i18n)');
|
||||
$i->waitForText('Geklickt, Geöffnet');
|
||||
$i->waitForText('Newsletter');
|
||||
$i->waitForText('Willkommens-E-Mail');
|
||||
$i->waitForText('Beitrags-Benachrichtigungen');
|
||||
$i->waitForText('Wiederaufnahme-E-Mails');
|
||||
|
||||
|
@@ -1,28 +0,0 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Test\Acceptance;
|
||||
|
||||
class CreateWelcomeEmailCest {
|
||||
public function createWelcomeNewsletter(\AcceptanceTester $i) {
|
||||
$i->wantTo('Create and configure welcome newsletter');
|
||||
$newsletterTitle = 'Create Welcome Email';
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Emails');
|
||||
$i->click('[data-automation-id="create_welcome"]');
|
||||
$i->waitForText('Welcome Email');
|
||||
$i->click('Next');
|
||||
$welcomeTemplate = $i->checkTemplateIsPresent(0, 'welcome');
|
||||
$i->see('Welcome Emails', ['css' => '.mailpoet-categories-item.active']);
|
||||
$i->click($welcomeTemplate);
|
||||
$titleElement = '[data-automation-id="newsletter_title"]';
|
||||
$i->waitForElement($titleElement);
|
||||
$i->fillField($titleElement, $newsletterTitle);
|
||||
$i->click('Next');
|
||||
$i->waitForText('When to send this welcome email?');
|
||||
$i->click('Activate');
|
||||
$i->waitForElement('[data-automation-id="newsletters_listing_tabs"]');
|
||||
$i->searchFor($newsletterTitle);
|
||||
$i->waitForText($newsletterTitle);
|
||||
$i->seeNoJSErrors();
|
||||
}
|
||||
}
|
@@ -1,65 +0,0 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Test\Acceptance;
|
||||
|
||||
/**
|
||||
* @group woo
|
||||
*/
|
||||
class CreateWooCommerceNewsletterCest {
|
||||
public function createFirstPurchaseEmail(\AcceptanceTester $i) {
|
||||
$i->wantTo('Create and configure a first purchase automatic email');
|
||||
|
||||
$i->activateWooCommerce();
|
||||
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Emails');
|
||||
$i->click('[data-automation-id="create_woocommerce_first_purchase"]');
|
||||
|
||||
$i->waitForElement('[data-automation-id="woocommerce_email_creation_heading"]');
|
||||
$i->click('Next');
|
||||
|
||||
$template = $i->checkTemplateIsPresent(0, 'woocommerce');
|
||||
$i->click($template);
|
||||
|
||||
$this->fillNewsletterTitle($i, 'First Purchase Email Creation');
|
||||
$this->activateNewsletterAndVerify($i, 'First Purchase Email Creation', 'Email sent when a customer makes their first purchase.');
|
||||
}
|
||||
|
||||
public function createAbandonedCartEmail(\AcceptanceTester $i) {
|
||||
$i->wantTo('Create and configure an abandoned cart automatic email');
|
||||
|
||||
$i->activateWooCommerce();
|
||||
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Emails');
|
||||
$i->click('[data-automation-id="create_woocommerce_abandoned_shopping_cart"]');
|
||||
|
||||
$i->waitForText('Abandoned Shopping Cart');
|
||||
$i->click('Next');
|
||||
|
||||
$template = $i->checkTemplateIsPresent(0, 'woocommerce');
|
||||
$i->click($template);
|
||||
|
||||
$this->fillNewsletterTitle($i, 'Abandoned Cart Email Creation');
|
||||
$this->activateNewsletterAndVerify($i, 'Abandoned Cart Email Creation', 'Send the email when a customer abandons their cart');
|
||||
}
|
||||
|
||||
private function fillNewsletterTitle(\AcceptanceTester $i, $newsletterTitle) {
|
||||
$titleElement = '[data-automation-id="newsletter_title"]';
|
||||
$i->waitForElement($titleElement);
|
||||
$i->fillField($titleElement, $newsletterTitle);
|
||||
$i->click('Next');
|
||||
}
|
||||
|
||||
private function activateNewsletterAndVerify(\AcceptanceTester $i, $newsletterTitle, $settingsDescription) {
|
||||
$i->waitForElement('[data-automation-id="newsletter_send_form"]');
|
||||
$i->waitForText('Send this WooCommerce Automatic Email when...');
|
||||
$newsletterListingElement = '[data-automation-id="listing_item_' . basename($i->getCurrentUrl()) . '"]';
|
||||
$i->waitForElementClickable('[data-automation-id="email-submit"]');
|
||||
$i->click('Activate');
|
||||
|
||||
$i->waitForElement($newsletterListingElement);
|
||||
$i->see($newsletterTitle, $newsletterListingElement);
|
||||
$i->see($settingsDescription, $newsletterListingElement);
|
||||
}
|
||||
}
|
@@ -1,84 +0,0 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Test\Acceptance;
|
||||
|
||||
use MailPoet\Test\DataFactories\Newsletter;
|
||||
|
||||
/**
|
||||
* @group woo
|
||||
*/
|
||||
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->changeGroupInListingFilter('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->changeGroupInListingFilter('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->changeGroupInListingFilter('trash');
|
||||
$i->waitForText($newsletterName);
|
||||
$i->clickItemRowActionByItemName($newsletterName, 'Delete permanently');
|
||||
$i->waitForText('permanently deleted.');
|
||||
$i->waitForElementNotVisible($newsletterName);
|
||||
$i->waitForText($newsletterName . '2');
|
||||
}
|
||||
}
|
@@ -1,31 +0,0 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Test\Acceptance;
|
||||
|
||||
use MailPoet\Test\DataFactories\Newsletter;
|
||||
|
||||
/**
|
||||
* @group woo
|
||||
*/
|
||||
class DuplicateAutomaticEmailCest {
|
||||
public function duplicateAutomaticEmail(\AcceptanceTester $i) {
|
||||
$i->wantTo('Duplicate an automatic email');
|
||||
$i->activateWooCommerce();
|
||||
$emailSubject = 'Duplicate Automatic Email Test';
|
||||
$newsletterFactory = new Newsletter();
|
||||
$newsletterFactory->withSubject($emailSubject)
|
||||
->withAutomaticTypeWooCommerceFirstPurchase()
|
||||
->withActiveStatus()
|
||||
->create();
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Emails');
|
||||
$i->click('[data-automation-id="tab-WooCommerce"]');
|
||||
$i->waitForText($emailSubject);
|
||||
$i->clickItemRowActionByItemName($emailSubject, 'Duplicate');
|
||||
$i->waitForElementVisible('.notice-success');
|
||||
$i->waitForText('Email "Copy of ' . $emailSubject . '" has been duplicated.', 20);
|
||||
$i->waitForListingItemsToLoad();
|
||||
$i->clickItemRowActionByItemName('Copy of ' . $emailSubject, 'Edit');
|
||||
$i->waitForElement('[data-automation-id="newsletter_title"]', 50);
|
||||
}
|
||||
}
|
@@ -1,56 +0,0 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Test\Acceptance;
|
||||
|
||||
use MailPoet\Test\DataFactories\Newsletter;
|
||||
|
||||
/**
|
||||
* @group woo
|
||||
*/
|
||||
class EditAutomaticWooCommerceEmailCest {
|
||||
public function dontSeeWooCommerceTabWhenWooCommerceIsNotActive(\AcceptanceTester $i) {
|
||||
$i->wantTo('Not see WooCommerce tab');
|
||||
$i->deactivateWooCommerce();
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Emails');
|
||||
$i->dontSee('[data-automation-id="tab-WooCommerce"]');
|
||||
}
|
||||
|
||||
public function editAutomaticWooCommerceEmail(\AcceptanceTester $i) {
|
||||
$newsletterName = 'Edit Automatic WooCommerce Email Test';
|
||||
$newsletterEditedName = 'Edit Automatic WooCommerce Email Test Edited';
|
||||
|
||||
$newsletterFactory = new Newsletter();
|
||||
$newsletterFactory
|
||||
->withSubject($newsletterName)
|
||||
->withAutomaticTypeWooCommerceFirstPurchase()
|
||||
->create();
|
||||
|
||||
// open editation
|
||||
$i->wantTo('Edit automatic WooCommerce email');
|
||||
$i->activateWooCommerce();
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Emails');
|
||||
$i->click('[data-automation-id="tab-WooCommerce"]');
|
||||
$i->waitForText($newsletterName);
|
||||
$i->clickItemRowActionByItemName($newsletterName, 'Edit');
|
||||
|
||||
// edit subject
|
||||
$titleElement = '[data-automation-id="newsletter_title"]';
|
||||
$i->waitForElement($titleElement);
|
||||
$i->seeInCurrentUrl('mailpoet-newsletter-editor');
|
||||
$i->fillField($titleElement, $newsletterEditedName);
|
||||
|
||||
// edit sending
|
||||
$i->click('Next');
|
||||
$i->waitForElementVisible('#field_sender_name');
|
||||
$i->fillField('#field_sender_name', 'Test sender');
|
||||
$i->click('Save as draft and close');
|
||||
|
||||
// check update success
|
||||
$i->waitForText('Email was updated successfully!');
|
||||
$i->amOnMailpoetPage('Emails');
|
||||
$i->click('[data-automation-id="tab-WooCommerce"]');
|
||||
$i->waitForText($newsletterEditedName);
|
||||
}
|
||||
}
|
@@ -1,132 +0,0 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Test\Acceptance;
|
||||
|
||||
use MailPoet\Test\DataFactories\Newsletter;
|
||||
|
||||
class ManageWelcomeEmailCest {
|
||||
|
||||
private $titleElement;
|
||||
|
||||
public function __construct() {
|
||||
$this->titleElement = '[data-automation-id="newsletter_title"]';
|
||||
}
|
||||
|
||||
private function createWelcomeEmailWithTitle(\AcceptanceTester $i, $newsletterTitle) {
|
||||
return (new Newsletter())
|
||||
->withSubject($newsletterTitle)
|
||||
->withWelcomeTypeForSegment()
|
||||
->create();
|
||||
}
|
||||
|
||||
public function saveWelcomeNewsletterAsDraft(\AcceptanceTester $i) {
|
||||
$i->wantTo('save a welcome newsletter as a draft');
|
||||
$newsletterTitle = 'Save Welcome Email As Draft Test Email';
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Emails');
|
||||
$i->seeInCurrentUrl('#/new');
|
||||
$i->click('[data-automation-id="create_welcome"]');
|
||||
$i->waitForText('Welcome Email');
|
||||
$i->click('Next');
|
||||
$welcomeTemplate = $i->checkTemplateIsPresent(0, 'welcome');
|
||||
$i->waitForElement($welcomeTemplate);
|
||||
$i->see('Welcome Emails', ['css' => '.mailpoet-categories-item.active']);
|
||||
$i->click($welcomeTemplate);
|
||||
$i->waitForElement($this->titleElement);
|
||||
$i->fillField($this->titleElement, $newsletterTitle);
|
||||
$i->click('Next');
|
||||
$i->waitForText('Reply-to');
|
||||
$i->click('Save as draft and close');
|
||||
$i->waitForElement('[data-automation-id="newsletters_listing_tabs"]');
|
||||
$i->waitForText($newsletterTitle);
|
||||
}
|
||||
|
||||
public function editWelcomeEmail(\AcceptanceTester $i) {
|
||||
$newsletter = $this->createWelcomeEmailWithTitle($i, 'Edit Welcome Email Test');
|
||||
$i->wantTo('Edit a welcome newsletter');
|
||||
$i->login();
|
||||
$i->amEditingNewsletter($newsletter->getId());
|
||||
$i->fillField($this->titleElement, 'Edit Test Welcome Edited');
|
||||
$i->click('Next');
|
||||
$i->waitForText('Reply-to');
|
||||
$i->click('Save as draft and close');
|
||||
$i->amOnMailpoetPage('Emails');
|
||||
$i->waitForElement('[data-automation-id="newsletters_listing_tabs"]');
|
||||
$i->click('Welcome Emails', '[data-automation-id="newsletters_listing_tabs"]');
|
||||
$i->waitForText('Edit Test Welcome Edited');
|
||||
}
|
||||
|
||||
public function deleteWelcomeEmail(\AcceptanceTester $i) {
|
||||
$i->wantTo('Delete a welcome email');
|
||||
$newsletterTitle = 'Delete Welcome Email Test';
|
||||
$this->createWelcomeEmailWithTitle($i, $newsletterTitle);
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Emails');
|
||||
$i->click('Welcome Emails', '[data-automation-id="newsletters_listing_tabs"]');
|
||||
$i->waitForText($newsletterTitle);
|
||||
$i->clickItemRowActionByItemName($newsletterTitle, 'Move to trash');
|
||||
$i->changeGroupInListingFilter('trash');
|
||||
$i->waitForText($newsletterTitle);
|
||||
$i->clickItemRowActionByItemName($newsletterTitle, 'Restore');
|
||||
$i->amOnMailpoetPage('Emails');
|
||||
$i->click('Welcome Emails', '[data-automation-id="newsletters_listing_tabs"]');
|
||||
$i->waitForText($newsletterTitle);
|
||||
}
|
||||
|
||||
public function duplicateWelcomeEmail (\AcceptanceTester $i) {
|
||||
$newsletterTitle = 'Duplicate Welcome Email Test';
|
||||
$this->createWelcomeEmailWithTitle($i, $newsletterTitle);
|
||||
$i->wantTo('Duplicate a welcome email');
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Emails');
|
||||
$i->click('Welcome Emails', '[data-automation-id="newsletters_listing_tabs"]');
|
||||
$i->waitForText($newsletterTitle);
|
||||
$i->clickItemRowActionByItemName($newsletterTitle, 'Duplicate');
|
||||
$i->waitForText('Copy of ' . $newsletterTitle);
|
||||
}
|
||||
|
||||
public function searchForWelcomeEmail (\AcceptanceTester $i) {
|
||||
$i->wantTo('Search for a welcome email');
|
||||
$newsletterTitle = 'Welcome Email Search Test';
|
||||
$failureConditionNewsletter = 'Totes Fake';
|
||||
$this->createWelcomeEmailWithTitle($i, $newsletterTitle);
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Emails');
|
||||
$i->click('Welcome Emails', '[data-automation-id="newsletters_listing_tabs"]');
|
||||
$i->waitForText($newsletterTitle);
|
||||
$i->searchFor($failureConditionNewsletter);
|
||||
$i->waitForElement('tr.mailpoet-listing-no-items');
|
||||
$i->searchFor($newsletterTitle);
|
||||
$i->waitForText($newsletterTitle);
|
||||
}
|
||||
|
||||
public function saveWelcomeEmailAsTemplate (\AcceptanceTester $i) {
|
||||
$i->wantTo('Save welcome email as a template');
|
||||
$templateTitle = 'Welcome Template Test Title';
|
||||
$newsletter = $this->createWelcomeEmailWithTitle($i, 'Save Welcome Email As Template Test');
|
||||
|
||||
$saveTemplateOption = '[data-automation-id="newsletter_save_as_template_option"]';
|
||||
$saveTemplateButton = '[data-automation-id="newsletter_save_as_template_button"]';
|
||||
|
||||
$i->login();
|
||||
$i->amEditingNewsletter($newsletter->getId());
|
||||
$i->click('[data-automation-id="newsletter_save_options_toggle"]');
|
||||
$i->waitForElement($saveTemplateOption);
|
||||
$i->click($saveTemplateOption);
|
||||
$i->waitForElement($saveTemplateButton);
|
||||
$i->fillField('template_name', $templateTitle);
|
||||
$i->click($saveTemplateButton);
|
||||
$i->waitForText('Template has been saved.');
|
||||
$i->amOnMailpoetPage('Emails');
|
||||
$i->click('[data-automation-id="new_email"]');
|
||||
$i->click('[data-automation-id="create_welcome"]');
|
||||
$i->click('Next');
|
||||
$i->checkTemplateIsPresent(0, 'welcome');
|
||||
$i->see('Welcome Emails', ['css' => '.mailpoet-categories-item.active']);
|
||||
$i->scrollTo('[data-automation-id="templates-welcome"]');
|
||||
$i->see($templateTitle);
|
||||
$i->click(['xpath' => '//*[text()="' . $templateTitle . '"]//ancestor::*[@data-automation-id="select_template_box"]//*[starts-with(@data-automation-id,"select_template_")]']);
|
||||
$i->waitForElement('[data-automation-id="newsletter_title"]');
|
||||
$i->seeNoJSErrors();
|
||||
}
|
||||
}
|
@@ -32,9 +32,6 @@ class NewslettersListingCest {
|
||||
// Standard newsletters is the default tab
|
||||
$i->waitForText('Standard newsletter', 5, '[data-automation-id="listing_item_' . $standardNewsletter->getId() . '"]');
|
||||
|
||||
$i->click('Welcome Emails', '[data-automation-id="newsletters_listing_tabs"]');
|
||||
$i->waitForText('Welcome email', 5, '[data-automation-id="listing_item_' . $welcomeEmail->getId() . '"]');
|
||||
|
||||
$i->click('Post Notifications', '[data-automation-id="newsletters_listing_tabs"]');
|
||||
$i->waitForText('Post notification', 5, '[data-automation-id="listing_item_' . $postNotificationEmail->getId() . '"]');
|
||||
$i->seeNoJSErrors();
|
||||
|
@@ -34,14 +34,8 @@ class WooCommerceEmailCustomizationCest {
|
||||
|
||||
$this->settings->withWooCommerceEmailCustomizerEnabled();
|
||||
|
||||
$i->amOnMailpoetPage('Emails');
|
||||
$i->click('[data-automation-id="new_email"]');
|
||||
|
||||
$buttonSelector = '[data-automation-id="customize_woocommerce"]';
|
||||
$i->seeNoJSErrors();
|
||||
$i->waitForText('Customize', 30);
|
||||
$i->dontSee('Activate', $buttonSelector);
|
||||
$i->click($buttonSelector);
|
||||
$i->amOnMailpoetPage('Settings#/woocommerce');
|
||||
$i->click('Open template editor');
|
||||
|
||||
$i->waitForText('Edit template for WooCommerce emails');
|
||||
$i->seeInCurrentUrl('?page=mailpoet-newsletter-editor&id=' . $this->woocommerceEmailTemplateId);
|
||||
@@ -69,8 +63,8 @@ class WooCommerceEmailCustomizationCest {
|
||||
|
||||
private function createEmailTemplate(\AcceptanceTester $i) {
|
||||
$i->login();
|
||||
$i->amOnMailpoetPage('Emails');
|
||||
$i->click('[data-automation-id="customize_woocommerce"]');
|
||||
$i->amOnMailpoetPage('Settings#/woocommerce');
|
||||
$i->click('Open template editor');
|
||||
$i->waitForText('Edit template for WooCommerce emails');
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user