From e1ebb72a83d155817703624714005a3094d89490 Mon Sep 17 00:00:00 2001 From: Fran Rouco Date: Mon, 21 Oct 2024 14:23:05 +0200 Subject: [PATCH] Improved page-ready detection on slow networks --- examples/backstop.json | 2 +- loginAndNavigation.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/backstop.json b/examples/backstop.json index f603e0f..1a09cda 100644 --- a/examples/backstop.json +++ b/examples/backstop.json @@ -74,7 +74,7 @@ "--disable-setuid-sandbox", "--font-render-hinting=none" ], - "gotoParameters": { "waitUntil": "networkidle0" } + "gotoParameters": { "waitUntil": ["load", "networkidle0"] } }, "debug": false, "debugWindow": false, diff --git a/loginAndNavigation.js b/loginAndNavigation.js index 9b8f702..37d3c80 100644 --- a/loginAndNavigation.js +++ b/loginAndNavigation.js @@ -9,11 +9,11 @@ module.exports = async(page, scenario, config) => { await page.type(scenario.loginWrapperSelector + ' input[name="name"]', user); await page.type(scenario.loginWrapperSelector + ' input[name="pass"]', pass); await page.keyboard.press('Enter'); // Enter Key - await page.waitForNavigation({ waitUntil: 'networkidle0'}); + await page.waitForNavigation({ waitUntil: ['load', 'networkidle0']}); if (scenario.loginRedirectTo) { await page.goto(scenario.loginRedirectTo, { - waitUntil: 'networkidle0' + waitUntil: ['load', 'networkidle0'] }); }