diff --git a/extension/js/common/xss-safe-factory.ts b/extension/js/common/xss-safe-factory.ts index c5da95a3685..05439e0d73a 100644 --- a/extension/js/common/xss-safe-factory.ts +++ b/extension/js/common/xss-safe-factory.ts @@ -270,14 +270,15 @@ export class XssSafeFactory { }; public btnSecureMenuBtn = (replyOption: ReplyOption) => { - const actionText = replyOption.replace('a_', '').replace('_', ' '); - const action = { - underscore: actionText.replace(' ', '_'), - hyphen: actionText.replace(' ', '-'), + const replyOptionText = replyOption.replace('a_', '').replace('_', ' '); + const htmlAttrib = { + className: replyOptionText.replace(' ', '_'), + testName: replyOptionText.replace(' ', '-'), }; + const displayText = replyOptionText === 'reply all' ? replyOptionText.replace('all', 'to all') : replyOptionText; // * The action_${action.underscore}_message_button is used as an identifier in GmailElementReplacer.actionActivateSecureReplyHandler() - return `
- secure ${actionText} + return `
+ secure ${displayText}
`; }; diff --git a/extension/js/content_scripts/webmail/gmail/gmail-element-replacer.ts b/extension/js/content_scripts/webmail/gmail/gmail-element-replacer.ts index d6a4b72d1a8..56b6979546f 100644 --- a/extension/js/content_scripts/webmail/gmail/gmail-element-replacer.ts +++ b/extension/js/content_scripts/webmail/gmail/gmail-element-replacer.ts @@ -379,7 +379,7 @@ export class GmailElementReplacer extends WebmailElementReplacer { event.stopImmediatePropagation(); const secureReplyInvokedFromMenu = btn.className.includes('action_menu_message_button'); let replyOption: ReplyOption; - if (btn.className.includes('reply-all')) { + if (btn.className.includes('reply_all')) { replyOption = 'a_reply_all'; } else if (btn.className.includes('forward')) { replyOption = 'a_forward'; diff --git a/test/source/tests/gmail.ts b/test/source/tests/gmail.ts index 74d3436373e..48516fd100d 100644 --- a/test/source/tests/gmail.ts +++ b/test/source/tests/gmail.ts @@ -301,7 +301,8 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test ); // convo-sensitive, draft-sensitive test - test.serial( + // skipped temporarily as per https://github.com/FlowCrypt/flowcrypt-browser/issues/5934#issuecomment-2664926769, originally uses test.serial + test.skip( 'mail.google.com - secure reply btn, reply draft', testWithBrowser( async (t, browser) => { @@ -403,7 +404,8 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test ); // https://github.com/FlowCrypt/flowcrypt-browser/issues/5906 - test( + // skipped temporarily as per https://github.com/FlowCrypt/flowcrypt-browser/issues/5934#issuecomment-2664926769 + test.skip( 'mail.google.com - Keep original reply message when switching to secure mode', testWithBrowser(async (t, browser) => { await BrowserRecipe.setUpCommonAcct(t, browser, 'ci.tests.gmail'); @@ -421,7 +423,7 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test await gmailPage.waitAll('.reply_message'); await pageHasSecureReplyContainer(t, browser, gmailPage, { isReplyPromptAccepted: true, composeFrameCount: 2 }); const replyBox = await gmailPage.getFrame(['/chrome/elements/compose.htm', '&skipClickPrompt=___cu_true___'], { sleep: 5 }); - await Util.sleep(3); + await replyBox.waitAll(['@action-expand-quoted-text']); await replyBox.waitAndClick('@action-expand-quoted-text'); // Check if quoted message doesn't contain last message expect(await replyBox.read('@input-body')).to.not.contain(`Here's reply`); @@ -495,7 +497,8 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test }) ); - test( + // skipped temporarily as per https://github.com/FlowCrypt/flowcrypt-browser/issues/5934#issuecomment-2664926769 + test.skip( 'mail.google.com - switch to encrypted forward', testWithBrowser(async (t, browser) => { await BrowserRecipe.setUpCommonAcct(t, browser, 'ci.tests.gmail'); @@ -537,6 +540,8 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test await gmailPage.waitAndClick('@action-reply-all-message-button'); const replyBox2 = await gmailPage.getFrame(['/chrome/elements/compose.htm'], { sleep: 5 }); await replyBox2.waitForContent('@input-body', ''); + const recipientsCount = await replyBox2.target.$$eval('.email_address', elements => elements.length); + expect(recipientsCount).to.equal(2); await gmailPage.waitAndClick(gmailContextMenu); await Util.sleep(1); expect(await gmailPage.isElementPresent('@action-forward-message-button'));