From 1e27b2a6196408c1174c6698efb92ddfac2c5521 Mon Sep 17 00:00:00 2001 From: lawvs <18554747+lawvs@users.noreply.github.com> Date: Wed, 4 Jan 2023 16:13:40 +0800 Subject: [PATCH] test: wait for page to load --- tests/console.spec.ts | 5 +---- tests/libs/load-page.ts | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/console.spec.ts b/tests/console.spec.ts index 708ab965cf..62df984d49 100644 --- a/tests/console.spec.ts +++ b/tests/console.spec.ts @@ -12,10 +12,7 @@ test.describe('web console', () => { //Later on, call this function with some arguments. // const msg = await getEditoVersionHandle.evaluate((post, args) => post); // console.log(getEditoVersionHandle); - await page.waitForTimeout(500); - const editoVersion = await page.evaluate( - () => (window as any).__editoVersion - ); + const editoVersion = await page.evaluate(() => window.__editoVersion); // const documentEditorVersion = await page.inputValue('input#editor-version'); const pkgEditorVersion = pkg.dependencies['@blocksuite/editor']; diff --git a/tests/libs/load-page.ts b/tests/libs/load-page.ts index 002341de65..8428f27ec8 100644 --- a/tests/libs/load-page.ts +++ b/tests/libs/load-page.ts @@ -4,6 +4,6 @@ export function loadPage() { test.beforeEach(async ({ page }) => { await page.goto('http://localhost:8080'); // waiting for page loading end - // await page.waitForTimeout(1000); + await page.waitForSelector('#__next'); }); }