From f73067623bd43bccbe8ddf13bb7c5f3be788b643 Mon Sep 17 00:00:00 2001 From: Limon Monte Date: Sun, 7 Nov 2021 22:57:37 +0200 Subject: [PATCH] cleanup --- test/source/tests/gmail.ts | 4 ++-- .../tests/page-recipe/compose-page-recipe.ts | 17 ++--------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/test/source/tests/gmail.ts b/test/source/tests/gmail.ts index c4738485399..ffecb538e06 100644 --- a/test/source/tests/gmail.ts +++ b/test/source/tests/gmail.ts @@ -51,7 +51,7 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test if (params.offline) { await composeBox.page.setOfflineMode(true); // go offline mode } - await Util.sleep(5); // the draft isn't being saved if start typing without this delay + await Util.sleep(4); // the draft isn't being saved if start typing without this delay await composeBox.type('@input-body', content, true); if (params.offline) { await ComposePageRecipe.waitWhenDraftIsSavedLocally(composeBox); @@ -253,7 +253,7 @@ export const defineGmailTests = (testVariant: TestVariant, testWithBrowser: Test 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(4); // the draft isn't being saved if start typing without this delay 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 diff --git a/test/source/tests/page-recipe/compose-page-recipe.ts b/test/source/tests/page-recipe/compose-page-recipe.ts index 5da0305db06..3d59048acb6 100644 --- a/test/source/tests/page-recipe/compose-page-recipe.ts +++ b/test/source/tests/page-recipe/compose-page-recipe.ts @@ -8,7 +8,6 @@ import { EvaluateFn } from 'puppeteer'; import { PageRecipe } from './abstract-page-recipe'; import { Util } from '../../util'; import { expect } from 'chai'; -import { Page } from 'puppeteer'; type RecipientType = "to" | "cc" | "bcc"; type Recipients = { @@ -107,23 +106,11 @@ export class ComposePageRecipe extends PageRecipe { } public static waitWhenDraftIsSaved = async (composePageOrFrame: Controllable) => { - try { - await composePageOrFrame.verifyContentIsPresentContinuously('@send-btn-note', 'Saved'); - } catch (e) { - console.log('waitWhenDraftIsSaved'); - console.log(e); - console.log(await (composePageOrFrame.target as Page).screenshot({ encoding: 'base64' })); - } + await composePageOrFrame.verifyContentIsPresentContinuously('@send-btn-note', 'Saved'); } public static waitWhenDraftIsSavedLocally = async (composePageOrFrame: Controllable) => { - try { - await composePageOrFrame.verifyContentIsPresentContinuously('@send-btn-note', 'Draft saved locally (offline)'); - } catch (e) { - console.log('waitWhenDraftIsSaved'); - console.log(e); - console.log(await (composePageOrFrame.target as Page).screenshot({ encoding: 'base64' })); - } + await composePageOrFrame.verifyContentIsPresentContinuously('@send-btn-note', 'Draft saved locally (offline)'); } public static sendAndClose = async (