Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class GmailElementReplacer extends WebmailElementReplacer {
// check if message body was converted to attachment by Gmail
// happens for pgp/mime messages with attachments
// https://github.com/FlowCrypt/flowcrypt-browser/issues/5458
const encryptedMsgAttachment = attachments.find(a => !a.name && a.treatAs(attachments) === 'encryptedMsg');
const encryptedMsgAttachment = attachments.find(a => !a.name && a.treatAs(attachments, Mime.isBodyEmpty(body)) === 'encryptedMsg');
if (encryptedMsgAttachment) {
const msgEl = this.getMsgBodyEl(msgId);
const loaderContext = new GmailLoaderContext(this.factory, msgEl);
Expand Down
3 changes: 2 additions & 1 deletion test/source/tests/compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1707,7 +1707,8 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te
},
});
const composePage = await ComposePageRecipe.openStandalone(t, browser, 'compose');
await composePage.waitAndClick('@action-show-container-cc-bcc-buttons');
await Util.sleep(2);
await ComposePageRecipe.showRecipientInput(composePage);
await composePage.type('@input-to', 'contact');
if (testVariant === 'CONSUMER-MOCK') {
// allow contacts scope
Expand Down
18 changes: 18 additions & 0 deletions test/source/tests/gmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,24 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test
})
);

// https://github.com/FlowCrypt/flowcrypt-browser/issues/6171
test(
`mail.google.com - large clipped PGP/MIME message with text/plain attachment decrypts`,
testWithBrowser(async (t, browser) => {
await BrowserRecipe.setUpCommonAcct(t, browser, 'ci.tests.gmail');
const gmailPage = await openGmailPage(t, browser);
await gotoGmailPage(gmailPage, '/FMfcgzQfBspgLbfNnBHGtlBsFtcLGPsr');
const urls = await gmailPage.getFramesUrls(['/chrome/elements/pgp_block.htm'], { sleep: 10, appearIn: 25 });
expect(urls.length).to.equal(1);
const pgpBlockFrame = await gmailPage.getFrame(['pgp_block.htm']);
await BrowserRecipe.pgpBlockCheck(t, pgpBlockFrame, {
content: ['Test large clipped message'],
encryption: 'encrypted',
signature: 'not signed',
});
})
);

test(
`mail.google.com - render plain text for "message" attachment (which has plain text)`,
testWithBrowser(async (t, browser) => {
Expand Down
13 changes: 9 additions & 4 deletions test/source/tests/tooling/browser-recipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,17 @@ export class BrowserRecipe {
public static openGoogleChatPage = async (t: AvaContext, browser: BrowserHandle, googleLoginIndex = 0) => {
const googleChatPage = await browser.newPage(t, TestUrls.googleChat(googleLoginIndex));
await Util.sleep(5);
const chatFrame = await googleChatPage.getFrame(['https://chat.google.com/u/0/mole/world']);
if (await chatFrame.isElementPresent('.fKz7Od')) {
let context: ControllableFrame | ControllablePage;
try {
context = await googleChatPage.getFrame(['https://chat.google.com/u/0/mole/world']);
} catch {
context = googleChatPage;
}
if (await context.isElementPresent('.fKz7Od')) {
// close announcement about updated UI
await chatFrame.waitAndClick('.fKz7Od', { delay: 1 });
await context.waitAndClick('.fKz7Od', { delay: 1 });
}
await chatFrame.waitAny(['a.gb_de', 'a.gb_Vc', 'a.gb_he']); // Google hangout logo
await context.waitAny(['a.gb_de', 'a.gb_Vc', 'a.gb_he']); // Google hangout logo
return googleChatPage;
};

Expand Down
Loading