diff --git a/assets/js/src/newsletters/templates.jsx b/assets/js/src/newsletters/templates.jsx index 642b95b6ab..f38e4efe1e 100644 --- a/assets/js/src/newsletters/templates.jsx +++ b/assets/js/src/newsletters/templates.jsx @@ -230,7 +230,9 @@ class NewsletterTemplates extends React.Component { const categories = templatesCategories.concat({ name: 'import', label: MailPoet.I18n.t('tabImportTitle'), - }); + }).map((category) => Object.assign(category, { + automationId: `templates-${category.name.replace(/\s+/g, '-').toLowerCase()}`, + })); const selectedTab = this.state.selectedTab; let content = null; diff --git a/tests/acceptance/ConfirmNewsletterAutosaveCest.php b/tests/acceptance/ConfirmNewsletterAutosaveCest.php index 3bba695338..3ca69d5424 100644 --- a/tests/acceptance/ConfirmNewsletterAutosaveCest.php +++ b/tests/acceptance/ConfirmNewsletterAutosaveCest.php @@ -16,7 +16,7 @@ class ConfirmNewsletterAutosaveCest { // step 2 - select template $standardTemplate = $i->checkTemplateIsPresent(0); - $i->see('Newsletters', ['css' => 'a.current']); + $i->see('Newsletters', ['css' => '.mailpoet-categories-item.active']); $i->click($standardTemplate); // step 3 - Add subject, wait for Autosave diff --git a/tests/acceptance/CreateWelcomeEmailCest.php b/tests/acceptance/CreateWelcomeEmailCest.php index a00a2886bc..7b575b2999 100644 --- a/tests/acceptance/CreateWelcomeEmailCest.php +++ b/tests/acceptance/CreateWelcomeEmailCest.php @@ -12,7 +12,7 @@ class CreateWelcomeEmailCest { $i->waitForText('Welcome Email'); $i->click('Next'); $welcomeTemplate = $i->checkTemplateIsPresent(0, 'welcome'); - $i->see('Welcome Emails', ['css' => 'a.current']); + $i->see('Welcome Emails', ['css' => '.mailpoet-categories-item.active']); $i->click($welcomeTemplate); $titleElement = '[data-automation-id="newsletter_title"]'; $i->waitForElement($titleElement); diff --git a/tests/acceptance/ManageWelcomeEmailCest.php b/tests/acceptance/ManageWelcomeEmailCest.php index 42603ae617..5e8161590c 100644 --- a/tests/acceptance/ManageWelcomeEmailCest.php +++ b/tests/acceptance/ManageWelcomeEmailCest.php @@ -30,7 +30,7 @@ class ManageWelcomeEmailCest { $i->click('Next'); $welcomeTemplate = $i->checkTemplateIsPresent(0, 'welcome'); $i->waitForElement($welcomeTemplate); - $i->see('Welcome Emails', ['css' => 'a.current']); + $i->see('Welcome Emails', ['css' => '.mailpoet-categories-item.active']); $i->click($welcomeTemplate); $i->waitForElement($this->titleElement); $i->fillField($this->titleElement, $newsletterTitle); @@ -123,7 +123,7 @@ class ManageWelcomeEmailCest { $i->click('[data-automation-id="create_welcome"]'); $i->click('Next'); $i->checkTemplateIsPresent(0, 'welcome'); - $i->see('Welcome Emails', ['css' => 'a.current']); + $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_")]']); diff --git a/tests/acceptance/NewsletterCreationCest.php b/tests/acceptance/NewsletterCreationCest.php index 72d2710848..bda4cea975 100644 --- a/tests/acceptance/NewsletterCreationCest.php +++ b/tests/acceptance/NewsletterCreationCest.php @@ -25,7 +25,7 @@ class NewsletterCreationCest { // step 3 - select template $postNotificationTemplate = $i->checkTemplateIsPresent(1, 'notification'); - $i->see('Post Notifications', ['css' => 'a.current']); + $i->see('Post Notifications', ['css' => '.mailpoet-categories-item.active']); $i->click($postNotificationTemplate); // step 4 - design newsletter (update subject) @@ -60,7 +60,7 @@ class NewsletterCreationCest { // step 2 - select template $standardTemplate = $i->checkTemplateIsPresent(0); - $i->see('Newsletters', ['css' => 'a.current']); + $i->see('Newsletters', ['css' => '.mailpoet-categories-item.active']); $i->click($standardTemplate); // step 3 - design newsletter (update subject) @@ -83,7 +83,7 @@ class NewsletterCreationCest { $i->click('[data-automation-id="new_email"]'); $i->click('[data-automation-id="create_standard"]'); $i->waitForElement('[data-automation-id="email_template_selection_heading"]'); - $i->see('Recently sent', ['css' => 'a.current']); + $i->see('Recently sent', ['css' => '.mailpoet-categories-item.active']); $i->click($standardTemplate); $i->waitForElement($titleElement); $i->fillField($titleElement, $newsletterTitle); @@ -114,7 +114,7 @@ class NewsletterCreationCest { // step 2 - select template $standardTemplate = $i->checkTemplateIsPresent(0); - $i->see('Newsletters', ['css' => 'a.current']); + $i->see('Newsletters', ['css' => '.mailpoet-categories-item.active']); $i->click($standardTemplate); // step 3 - see notice in 'Send preview' with link to authorized emails diff --git a/tests/acceptance/ReceiveStandardEmailCest.php b/tests/acceptance/ReceiveStandardEmailCest.php index 187861f411..ff66ca4fcc 100644 --- a/tests/acceptance/ReceiveStandardEmailCest.php +++ b/tests/acceptance/ReceiveStandardEmailCest.php @@ -34,7 +34,7 @@ class ReceiveStandardEmailCest { $i->amOnMailpoetPage('Emails'); $i->click('[data-automation-id="create_standard"]'); $i->waitForElement($standardTemplate); - $i->see('Newsletters', ['css' => 'a.current']); + $i->see('Newsletters', ['css' => '.mailpoet-categories-item.active']); $i->click($standardTemplate); $i->waitForElement($titleElement); $i->fillField($titleElement, $newsletterTitle); diff --git a/tests/acceptance/SaveNewsletterAsDraftCest.php b/tests/acceptance/SaveNewsletterAsDraftCest.php index 911874fced..62e376b1e8 100644 --- a/tests/acceptance/SaveNewsletterAsDraftCest.php +++ b/tests/acceptance/SaveNewsletterAsDraftCest.php @@ -17,7 +17,7 @@ class SaveNewsletterAsDraftCest { // step 2 - select template $standardTemplate = $i->checkTemplateIsPresent(0); - $i->see('Newsletters', ['css' => 'a.current']); + $i->see('Newsletters', ['css' => '.mailpoet-categories-item.active']); $i->click($standardTemplate); // step 3 - design newsletter (update subject) diff --git a/tests/acceptance/TemplatesPagesLoadCest.php b/tests/acceptance/TemplatesPagesLoadCest.php index a81a448fbf..5dc5192bfa 100644 --- a/tests/acceptance/TemplatesPagesLoadCest.php +++ b/tests/acceptance/TemplatesPagesLoadCest.php @@ -20,17 +20,17 @@ class TemplatesPagesLoadCest { $i->waitForElement('[data-automation-id="select_template_23"]'); //Post Notification templates tab $i->click('Post Notifications'); - $i->see('Post Notifications', ['css' => 'a.current']); + $i->see('Post Notifications', ['css' => '.mailpoet-categories-item.active']); $i->waitForElement('[data-automation-id="select_template_5"]'); $i->waitForElement('[data-automation-id="select_template_8"]'); //Welcome Emails templates tab $i->click('Welcome Emails'); - $i->see('Welcome Emails', ['css' => 'a.current']); + $i->see('Welcome Emails', ['css' => '.mailpoet-categories-item.active']); $i->waitForElement('[data-automation-id="select_template_5"]'); $i->waitForElement('[data-automation-id="select_template_9"]'); //WooCommerce templates tab $i->click('WooCommerce Emails'); - $i->see('WooCommerce Emails', ['css' => 'a.current']); + $i->see('WooCommerce Emails', ['css' => '.mailpoet-categories-item.active']); $i->waitForElement('[data-automation-id="select_template_5"]'); $i->waitForElement('[data-automation-id="select_template_2"]'); }