Update acceptance tests
[MAILPOET-5637]
This commit is contained in:
committed by
Aschepikov
parent
399ed61503
commit
1a620e83d6
@@ -78,8 +78,6 @@ export function DetailsPanel() {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: Add handling toggle to a store
|
|
||||||
// Render email details panel using PluginDocumentSettingPanel component
|
|
||||||
return (
|
return (
|
||||||
<PanelBody
|
<PanelBody
|
||||||
title={__('Details', 'mailpoet')}
|
title={__('Details', 'mailpoet')}
|
||||||
|
@@ -25,7 +25,7 @@ export function Header({ sidebarKey }: Props) {
|
|||||||
'components-button edit-post-sidebar__panel-tab',
|
'components-button edit-post-sidebar__panel-tab',
|
||||||
{ 'is-active': sidebarKey === mainSidebarEmailKey },
|
{ 'is-active': sidebarKey === mainSidebarEmailKey },
|
||||||
)}
|
)}
|
||||||
data-automation-id="mailpoet_form_settings_tab"
|
data-automation-id="email_settings_tab"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
{__('Email', 'mailpoet')}
|
{__('Email', 'mailpoet')}
|
||||||
|
@@ -9,7 +9,7 @@ use MailPoet\Test\DataFactories\Settings;
|
|||||||
class CreateAndSendEmailUsingGutenbergCest {
|
class CreateAndSendEmailUsingGutenbergCest {
|
||||||
public function createAndSendStandardNewsletter(\AcceptanceTester $i) {
|
public function createAndSendStandardNewsletter(\AcceptanceTester $i) {
|
||||||
$wordPressVersion = $i->getWordPressVersion();
|
$wordPressVersion = $i->getWordPressVersion();
|
||||||
if (version_compare($wordPressVersion, '6.4', '<')) {
|
if (version_compare($wordPressVersion, '6.3', '<')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$settings = new Settings();
|
$settings = new Settings();
|
||||||
@@ -28,39 +28,27 @@ class CreateAndSendEmailUsingGutenbergCest {
|
|||||||
$i->click('//button[text()="Continue"]');
|
$i->click('//button[text()="Continue"]');
|
||||||
|
|
||||||
$i->wantTo('Compose an email');
|
$i->wantTo('Compose an email');
|
||||||
if (version_compare($wordPressVersion, '6.3', '<')) {
|
$i->waitForElement('.is-root-container');
|
||||||
$i->waitForElement('.wp-block-post-content');
|
$i->wait(1);
|
||||||
$i->click('.wp-block-post-content');
|
$i->click('.is-root-container');
|
||||||
$i->type('Hello world!');
|
$i->type('Hello world!');
|
||||||
} else {
|
|
||||||
// Version 6.3 introduced a new Gutenberg editor with an iframe
|
|
||||||
$i->switchToFrame('[name="editor-canvas"]');
|
|
||||||
$i->waitForElement('.wp-block-post-content');
|
|
||||||
$i->click('.wp-block-post-content');
|
|
||||||
$i->type('Hello world!');
|
|
||||||
$i->switchToIFrame();
|
|
||||||
}
|
|
||||||
|
|
||||||
$i->wantTo('Close fullscreen mode and verify correct WP menu item is highlighted');
|
$i->wantTo('Verify correct WP menu item is highlighted');
|
||||||
$i->click('[aria-label="Options"]');
|
|
||||||
$i->waitForText('Fullscreen mode');
|
|
||||||
$i->click('Fullscreen mode');
|
|
||||||
$i->waitForText('Emails', 10, '#toplevel_page_mailpoet-homepage .current');
|
$i->waitForText('Emails', 10, '#toplevel_page_mailpoet-homepage .current');
|
||||||
$i->wantTo('Close options dropdown');
|
|
||||||
$i->click('[aria-label="Options"]');
|
|
||||||
|
|
||||||
$i->wantTo('Change subject and preheader');
|
$i->wantTo('Change subject and preheader');
|
||||||
$i->click('button[data-label="Email"]');
|
$i->click('[data-automation-id="email_settings_tab"]');
|
||||||
$i->click('//button[text()="Details"]');
|
|
||||||
$i->fillField('[data-automation-id="email_subject"]', 'My New Subject');
|
$i->fillField('[data-automation-id="email_subject"]', 'My New Subject');
|
||||||
$i->fillField('[data-automation-id="email_preview_text"]', 'My New Preview Text');
|
$i->fillField('[data-automation-id="email_preview_text"]', 'My New Preview Text');
|
||||||
|
|
||||||
$i->wantTo('Send an email and verify it was delivered');
|
$i->wantTo('Send an email and verify it was delivered');
|
||||||
$i->click('Next');
|
$i->click('Save Draft');
|
||||||
$i->waitForText('My New Subject');
|
$i->waitForText('Saved');
|
||||||
$i->waitForText('My New Preview Text');
|
$i->click('Send');
|
||||||
$i->waitForElement('[name="subject"]');
|
$i->waitForElement('[name="subject"]');
|
||||||
$i->fillField('subject', 'Test Subject');
|
$subject = $i->grabValueFrom('[name="subject"]');
|
||||||
|
expect($subject)->equals('My New Subject');
|
||||||
|
$i->waitForText('My New Preview Text');
|
||||||
$i->fillField('sender_name', 'John Doe');
|
$i->fillField('sender_name', 'John Doe');
|
||||||
$i->fillField('sender_address', 'john.doe@example.com');
|
$i->fillField('sender_address', 'john.doe@example.com');
|
||||||
$i->selectOptionInSelect2($segmentName);
|
$i->selectOptionInSelect2($segmentName);
|
||||||
@@ -71,7 +59,7 @@ class CreateAndSendEmailUsingGutenbergCest {
|
|||||||
$i->triggerMailPoetActionScheduler();
|
$i->triggerMailPoetActionScheduler();
|
||||||
|
|
||||||
$i->wantTo('Confirm the newsletter was received');
|
$i->wantTo('Confirm the newsletter was received');
|
||||||
$i->checkEmailWasReceived('Test Subject');
|
$i->checkEmailWasReceived('My New Subject');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayNewsletterPreview(\AcceptanceTester $i) {
|
public function displayNewsletterPreview(\AcceptanceTester $i) {
|
||||||
@@ -94,21 +82,14 @@ class CreateAndSendEmailUsingGutenbergCest {
|
|||||||
$i->click('//button[text()="Continue"]');
|
$i->click('//button[text()="Continue"]');
|
||||||
|
|
||||||
$i->wantTo('Edit an email');
|
$i->wantTo('Edit an email');
|
||||||
if (version_compare($wordPressVersion, '6.3', '<')) {
|
$i->waitForElement('.is-root-container');
|
||||||
$i->waitForElement('.wp-block-post-content');
|
$i->wait(1);
|
||||||
$i->click('.wp-block-post-content');
|
$i->click('.is-root-container');
|
||||||
$i->type('Hello world!');
|
$i->type('Hello world!');
|
||||||
} else {
|
|
||||||
// Version 6.3 introduced a new Gutenberg editor with an iframe
|
|
||||||
$i->switchToFrame('[name="editor-canvas"]');
|
|
||||||
$i->waitForElement('.wp-block-post-content');
|
|
||||||
$i->click('.wp-block-post-content');
|
|
||||||
$i->type('Hello world!');
|
|
||||||
$i->switchToIFrame();
|
|
||||||
}
|
|
||||||
|
|
||||||
$i->wantTo('Save draft and display preview');
|
$i->wantTo('Save draft and display preview');
|
||||||
$i->click('//button[text()="Save draft"]');
|
$i->click('Save Draft');
|
||||||
|
$i->waitForText('Saved');
|
||||||
$i->click('.mailpoet-preview-dropdown button[aria-label="Preview"]');
|
$i->click('.mailpoet-preview-dropdown button[aria-label="Preview"]');
|
||||||
$i->waitForElementClickable('//button[text()="Preview in new tab"]');
|
$i->waitForElementClickable('//button[text()="Preview in new tab"]');
|
||||||
$i->click('//button[text()="Preview in new tab"]');
|
$i->click('//button[text()="Preview in new tab"]');
|
||||||
|
Reference in New Issue
Block a user