diff --git a/test/source/tests/gmail.ts b/test/source/tests/gmail.ts index 3b0c1ab723e..070308c19a7 100644 --- a/test/source/tests/gmail.ts +++ b/test/source/tests/gmail.ts @@ -97,8 +97,11 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test expect(urls.length).to.equal(0); }; - const openGmailPage = async (t: AvaContext, browser: BrowserHandle): Promise => { - const url = TestUrls.gmail(0); + const openGmailPage = async (t: AvaContext, browser: BrowserHandle, path?: string): Promise => { + let url = TestUrls.gmail(0); + if (path) { + url = TestUrls.gmail(0, path, 'inbox'); + } return await browser.newPage(t, url); }; @@ -401,10 +404,10 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test 'mail.google.com - plain reply to encrypted and signed messages', testWithBrowser(async (t, browser) => { await BrowserRecipe.setUpCommonAcct(t, browser, 'ci.tests.gmail'); - const gmailPage = await openGmailPage(t, browser); - await gotoGmailPage(gmailPage, '/FMfcgzGkbDRNgcQxLmkhBCKVSFwkfdvV'); // plain convo + let gmailPage = await openGmailPage(t, browser, '/FMfcgzGkbDRNgcQxLmkhBCKVSFwkfdvV'); // plain convo await gmailPage.waitAndClick('[data-tooltip="Reply"]', { delay: 1 }); - await gotoGmailPage(gmailPage, '/181d226b4e69f172'); // go to encrypted convo + await gmailPage.close(); + gmailPage = await openGmailPage(t, browser, '/181d226b4e69f172'); // go to encrypted convo await gmailPage.waitAndClick('[data-tooltip="Reply"]', { delay: 1 }); await gmailPage.waitTillGone('.reply_message'); await gmailPage.waitAll('[data-tooltip^="Send"]'); // The Send button from the Standard reply box @@ -583,9 +586,8 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test testWithBrowser( async (t, browser) => { await BrowserRecipe.setUpCommonAcct(t, browser, 'ci.tests.gmail'); - const gmailPage = await openGmailPage(t, browser); const threadId = '181d226b4e69f172'; // 1st message -- thread id - await gotoGmailPage(gmailPage, `/${threadId}`); // go to encrypted convo + const gmailPage = await openGmailPage(t, browser, `/${threadId}`); await GmailPageRecipe.trimConvo(gmailPage, threadId); await gmailPage.waitAndClick('[data-tooltip="Reply"]', { delay: 5 }); t.timeout(minutes(2)); // extend ava's timeout diff --git a/test/source/tests/tooling/browser-recipe.ts b/test/source/tests/tooling/browser-recipe.ts index abab2c89546..b42eaaa5457 100644 --- a/test/source/tests/tooling/browser-recipe.ts +++ b/test/source/tests/tooling/browser-recipe.ts @@ -71,11 +71,12 @@ 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); - if (await googleChatPage.isElementPresent('.fKz7Od')) { + const chatFrame = await googleChatPage.getFrame(['https://chat.google.com/u/0/mole/world']); + if (await chatFrame.isElementPresent('.fKz7Od')) { // close announcement about updated UI - await googleChatPage.waitAndClick('.fKz7Od', { delay: 1 }); + await chatFrame.waitAndClick('.fKz7Od', { delay: 1 }); } - await googleChatPage.waitAny(['a.gb_6d', 'a.gb_Fc', 'a.gb_9d', 'a.gb_7d']); // Google hangout logo + await chatFrame.waitAny(['a.gb_6d', 'a.gb_Fc', 'a.gb_9d', 'a.gb_7d', 'a.gb_ce', 'a.gb_Sc']); // Google hangout logo return googleChatPage; };