From 5d5d093b20185f8464b5a410507c0e8e9bbb681d Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Tue, 5 May 2020 20:38:57 +0900 Subject: [PATCH] Set maxFindTextAttempts as a function argument --- packages/cli/e2e-test/helpers.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/cli/e2e-test/helpers.js b/packages/cli/e2e-test/helpers.js index 4d3f4f4661..30e4770c01 100644 --- a/packages/cli/e2e-test/helpers.js +++ b/packages/cli/e2e-test/helpers.js @@ -95,7 +95,7 @@ async function waitForPageWithText( browser, path, text, - { intervalMs = 1000, maxLoadAttempts = 240 } = {}, + { intervalMs = 1000, maxLoadAttempts = 240, maxFindTextAttempts = 3 } = {}, ) { let loadAttempts = 0; for (;;) { @@ -118,7 +118,6 @@ async function waitForPageWithText( } // The page may not be fully loaded and hence we need to retry. - const maxFindTextAttempts = 3; let findTextAttempts = 0; const escapedText = text.replace(/"/g, '\\"'); for (;;) {