diff --git a/test/source/test.ts b/test/source/test.ts index e0d33676e28..752ef1a8432 100644 --- a/test/source/test.ts +++ b/test/source/test.ts @@ -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, // will be set right below diff --git a/test/source/tests/compose.ts b/test/source/tests/compose.ts index a8f1a2020bf..747ceb3ba33 100644 --- a/test/source/tests/compose.ts +++ b/test/source/tests/compose.ts @@ -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, }); @@ -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, }); diff --git a/test/source/tests/gmail.ts b/test/source/tests/gmail.ts index 37c4d9dc546..472e4929718 100644 --- a/test/source/tests/gmail.ts +++ b/test/source/tests/gmail.ts @@ -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'; @@ -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); @@ -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'); @@ -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); @@ -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 }); @@ -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"]');