From 2adc6d23ca3d04f8eb5fa41ae959968c5f14dae5 Mon Sep 17 00:00:00 2001 From: Oluwaseun Olorunsola Date: Wed, 5 Feb 2025 16:01:42 +0100 Subject: [PATCH] Update acceptance test case to fix failing test MAILPOET-6431 --- .../EmailEditor/CreateAndSendEmailUsingGutenbergCest.php | 5 +++-- .../js/email-editor/src/components/header/send-button.tsx | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mailpoet/tests/acceptance/EmailEditor/CreateAndSendEmailUsingGutenbergCest.php b/mailpoet/tests/acceptance/EmailEditor/CreateAndSendEmailUsingGutenbergCest.php index ef7b01c85d..f9ba7a3482 100644 --- a/mailpoet/tests/acceptance/EmailEditor/CreateAndSendEmailUsingGutenbergCest.php +++ b/mailpoet/tests/acceptance/EmailEditor/CreateAndSendEmailUsingGutenbergCest.php @@ -55,10 +55,11 @@ class CreateAndSendEmailUsingGutenbergCest { $i->click('Save Draft'); $i->waitForText('Saved'); $i->waitForText('Email saved!'); - $i->click('Send'); + $i->click('[aria-label="Close sidebar"]'); // close the sidebar. It sometimes interferes with the send button click + $i->click('[data-automation-id="email_editor_send_button"]'); $i->waitForElement('[name="subject"]'); $subject = $i->grabValueFrom('[name="subject"]'); - verify($subject)->equals('My New Subject'); + verify($subject)->equals('My New Subject '); $i->waitForText('My New Preview Text'); $i->fillField('sender_name', 'John Doe'); $i->fillField('sender_address', 'john.doe@example.com'); diff --git a/packages/js/email-editor/src/components/header/send-button.tsx b/packages/js/email-editor/src/components/header/send-button.tsx index bdf7160507..ab56468b16 100644 --- a/packages/js/email-editor/src/components/header/send-button.tsx +++ b/packages/js/email-editor/src/components/header/send-button.tsx @@ -63,6 +63,7 @@ export function SendButton( { validateContent, isContentInvalid } ) { } } } disabled={ isDisabled } + data-automation-id="email_editor_send_button" > { label }