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
16 changes: 9 additions & 7 deletions test/source/tests/gmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ControllablePage> => {
const url = TestUrls.gmail(0);
const openGmailPage = async (t: AvaContext, browser: BrowserHandle, path?: string): Promise<ControllablePage> => {
let url = TestUrls.gmail(0);
if (path) {
url = TestUrls.gmail(0, path, 'inbox');
}
return await browser.newPage(t, url);
};

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions test/source/tests/tooling/browser-recipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
Loading