Skip to content

Commit 5d3d915

Browse files
committed
add test
1 parent 3084d14 commit 5d3d915

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

extension/js/common/xss-safe-factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export class XssSafeFactory {
268268
};
269269

270270
public actionsMenuBtn = (action: 'reply' | 'forward') => {
271-
return `<div class="action_${action}_message_button action_menu_message_button" role="button" tabindex="0" aria-label="Secure Reply">
271+
return `<div class="action_${action}_message_button action_menu_message_button" data-test="action-${action}-message-button" role="button" tabindex="0" aria-label="Secure Reply">
272272
<img src="${this.srcImg(`svgs/${action}-icon.svg`)}" /><span>secure ${action}</span>
273273
</div>`;
274274
};

test/source/tests/gmail.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,30 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test
457457
})
458458
);
459459

460+
test(
461+
'mail.google.com - secure reply and forward in dot menu',
462+
testWithBrowser(async (t, browser) => {
463+
await BrowserRecipe.setUpCommonAcct(t, browser, 'ci.tests.gmail');
464+
const gmailPage = await openGmailPage(t, browser);
465+
await gotoGmailPage(gmailPage, '/FMfcgzGtwgfMhWTlgRwwKWzRhqNZzwXz'); // go to encrypted convo
466+
await Util.sleep(5);
467+
const actionsMenuSelector = '.J-J5-Ji.aap';
468+
await gmailPage.waitAndClick(actionsMenuSelector);
469+
expect(await gmailPage.isElementPresent('@action-reply-message-button'));
470+
await gmailPage.waitAndClick('@action-reply-message-button');
471+
await Util.sleep(3);
472+
const replyBox = await gmailPage.getFrame(['/chrome/elements/compose.htm'], { sleep: 5 });
473+
await Util.sleep(3);
474+
await replyBox.waitForContent('@input-body', '');
475+
await gmailPage.waitAndClick(actionsMenuSelector);
476+
expect(await gmailPage.isElementPresent('@action-forward-message-button'));
477+
await Util.sleep(3);
478+
await gmailPage.waitAndClick('@action-forward-message-button');
479+
await Util.sleep(3);
480+
await replyBox.waitForContent('@input-body', '---------- Forwarded message ---------');
481+
})
482+
);
483+
460484
// convo-sensitive, draft-sensitive test
461485
test.serial(
462486
'mail.google.com - plain reply draft',

0 commit comments

Comments
 (0)