From 03f368f740a3a5e1c25c721f43d5ba799c67318b Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 28 Oct 2021 18:30:33 +0200 Subject: [PATCH] chore: finally made it work Signed-off-by: blam --- packages/e2e-test/src/commands/run.ts | 3 ++- packages/e2e-test/src/lib/helpers.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/e2e-test/src/commands/run.ts b/packages/e2e-test/src/commands/run.ts index 9eb32e378c..eedaca9a8a 100644 --- a/packages/e2e-test/src/commands/run.ts +++ b/packages/e2e-test/src/commands/run.ts @@ -360,7 +360,8 @@ async function testAppServe(pluginName: string, appDir: string) { try { browser = await puppeteer.launch(); const page = await browser.newPage(); - await page.goto('http://localhost:3000'); + + await page.goto('http://localhost:3000', { waitUntil: 'networkidle0' }); await waitForPageWithText(page, '/', 'My Company Catalog'); await waitForPageWithText( diff --git a/packages/e2e-test/src/lib/helpers.ts b/packages/e2e-test/src/lib/helpers.ts index b3212f3698..db8861e111 100644 --- a/packages/e2e-test/src/lib/helpers.ts +++ b/packages/e2e-test/src/lib/helpers.ts @@ -138,7 +138,9 @@ export async function waitForPageWithText( console.log(`Attempting to load page at ${path}, waiting ${waitTimeMs}`); await new Promise(resolve => setTimeout(resolve, waitTimeMs)); - await page.goto(`http://localhost:3000${path}`); + await page.goto(`http://localhost:3000${path}`, { + waitUntil: 'networkidle0', + }); const escapedText = text.replace(/"|\\/g, '\\$&'); const match = await page.evaluate(() =>