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
4 changes: 2 additions & 2 deletions test/source/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ process.setMaxListeners(0);
const consts = {
// higher concurrency can cause 429 google errs when composing
TIMEOUT_SHORT: minutes(1),
TIMEOUT_EACH_RETRY: minutes(3),
TIMEOUT_EACH_RETRY: minutes(4),
TIMEOUT_ALL_RETRIES: minutes(25), // this has to suffer waiting for semaphore between retries, thus almost the same as below
TIMEOUT_OVERALL: minutes(20),
TIMEOUT_OVERALL: minutes(30),
ATTEMPTS: testGroup === 'STANDARD-GROUP' ? oneIfNotPooled(3) : process.argv.includes('--retry=false') ? 1 : 3,
POOL_SIZE: oneIfNotPooled(isMock ? 20 : 3),
PROMISE_TIMEOUT_OVERALL: undefined as unknown as Promise<never>, // will be set right below
Expand Down
2 changes: 2 additions & 0 deletions test/source/tests/compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,7 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te
testWithBrowser('compatibility', async (t, browser) => {
let composePage = await ComposePageRecipe.openStandalone(t, browser, 'compatibility');
const subject = `مرحبا RTL plain text`;
await Util.sleep(5); // until #5037 is fixed
await ComposePageRecipe.fillMsg(composePage, { to: 'human@flowcrypt.com' }, subject, 'مرحبا', {
richtext: false,
});
Expand All @@ -1512,6 +1513,7 @@ export const defineComposeTests = (testVariant: TestVariant, testWithBrowser: Te
testWithBrowser('compatibility', async (t, browser) => {
let composePage = await ComposePageRecipe.openStandalone(t, browser, 'compatibility');
const subject = `مرحبا RTL rich text`;
await Util.sleep(5); // until #5037 is fixed
await ComposePageRecipe.fillMsg(composePage, { to: 'human@flowcrypt.com' }, subject, 'مرحبا', {
richtext: true,
});
Expand Down
18 changes: 9 additions & 9 deletions test/source/tests/gmail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import test from 'ava';

import { expect } from 'chai';
import { BrowserHandle, ControllablePage } from './../browser';
import { BrowserHandle, ControllablePage, TIMEOUT_PAGE_LOAD } from './../browser';
import { Controllable } from './../browser/controllable';
import { TestUrls } from './../browser/test-urls';
import { TestWithBrowser } from './../test';
Expand Down Expand Up @@ -72,7 +72,7 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test
} else {
composeBox = await gmailPage.getFrame(['/chrome/elements/compose.htm']);
}
await Util.sleep(5); // the draft isn't being saved if start typing without this delay
await Util.sleep(5); // until #5037 is fixed
await composeBox.type('@input-body', content, true);
if (params.offline) {
await ComposePageRecipe.waitWhenDraftIsSavedLocally(composeBox);
Expand Down Expand Up @@ -273,18 +273,18 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test
await createSecureDraft(t, browser, gmailPage, 'compose draft 1', { offline: true });
await gmailPage.waitAndClick('@action-secure-compose', { delay: 1 });
await createSecureDraft(t, browser, gmailPage, 'compose draft 2', { offline: true });
await gmailPage.page.reload();
await gmailPage.page.reload({ timeout: TIMEOUT_PAGE_LOAD * 1000, waitUntil: 'load' });
await gmailPage.waitAndClick('[data-tooltip="Drafts"]');
await gmailPage.waitForContent('#fc_offline_drafts', 'FlowCrypt offline drafts:');
await gmailPage.ensureElementsCount('#fc_offline_drafts a', 2);
await gmailPage.waitAndClick('#fc_offline_drafts a');
// compose draft 2 should be first in list as drafts are sorted by date descending
const draft = await pageHasSecureDraft(gmailPage, 'compose draft 2');
await Util.sleep(5); // the draft isn't being saved if start typing without this delay
await Util.sleep(5); // until #5037 is fixed
await draft.type('@input-body', 'trigger saving a draft to the cloud', true);
await ComposePageRecipe.waitWhenDraftIsSaved(draft);
// after draft 2 is saved to the cloud, it should be removed from offline drafts
await gmailPage.page.reload();
await gmailPage.page.reload({ timeout: TIMEOUT_PAGE_LOAD * 1000, waitUntil: 'load' });
await gmailPage.waitForContent('#fc_offline_drafts', 'FlowCrypt offline drafts:');
await gmailPage.ensureElementsCount('#fc_offline_drafts a', 1);
await gmailPage.waitAndClick('#fc_offline_drafts a');
Expand All @@ -308,14 +308,14 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test
expect(await replyBox.read('@recipients-preview')).to.equal('e2e.enterprise.test@flowcrypt.com');
await createSecureDraft(t, browser, gmailPage, 'reply draft');
await createSecureDraft(t, browser, gmailPage, 'offline reply draft', { offline: true });
await gmailPage.page.reload({ waitUntil: 'networkidle2' });
await gmailPage.page.reload({ timeout: TIMEOUT_PAGE_LOAD * 1000, waitUntil: 'networkidle2' });
await Util.sleep(30);
replyBox = await pageHasSecureDraft(gmailPage, 'offline reply draft');
// await replyBox.waitAndClick('@action-send'); doesn't work for some reason, use keyboard instead
await gmailPage.page.keyboard.press('Tab');
await gmailPage.page.keyboard.press('Enter');
await replyBox.waitTillGone('@action-send');
await gmailPage.page.reload({ waitUntil: 'networkidle2' });
await gmailPage.page.reload({ timeout: TIMEOUT_PAGE_LOAD * 1000, waitUntil: 'networkidle2' });
await gmailPage.waitAndClick('.h7:last-child .ajz', { delay: 1 }); // the small triangle which toggles the message details
await gmailPage.waitForContent('.h7:last-child .ajA', 'Re: [ci.test] encrypted email for reply render'); // make sure that the subject of the sent draft is corrent
await GmailPageRecipe.deleteLastReply(gmailPage);
Expand All @@ -329,7 +329,7 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test
// create compose draft
await gmailPage.waitAndClick('@action-secure-compose', { delay: 1 });
await createSecureDraft(t, browser, gmailPage, 'a compose draft');
await gmailPage.page.reload();
await gmailPage.page.reload({ timeout: TIMEOUT_PAGE_LOAD * 1000, waitUntil: 'load' });
await gotoGmailPage(gmailPage, '', 'drafts'); // to go drafts section
// open new compose window and saved draft
await gmailPage.waitAndClick('@action-secure-compose', { delay: 1 });
Expand Down Expand Up @@ -434,7 +434,7 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test
await gmailPage.type('div[aria-label="Message Body"]', 'plain reply', true);
await gmailPage.waitForContent('.oG.aOy', 'Draft saved');
await Util.sleep(10);
await gmailPage.page.reload({ waitUntil: 'networkidle2' });
await gmailPage.page.reload({ timeout: TIMEOUT_PAGE_LOAD * 1000, waitUntil: 'networkidle2' });
await gmailPage.waitForContent('div[aria-label="Message Body"]', 'plain reply', 30);
await pageDoesNotHaveSecureReplyContainer(gmailPage);
await gmailPage.click('[aria-label^="Discard draft"]');
Expand Down