From 82b6f1e4cba98a2b86c8f303bf95213259831428 Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Tue, 5 May 2020 20:09:03 +0900 Subject: [PATCH] Retry search text for any type of error --- packages/cli/e2e-test/helpers.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/cli/e2e-test/helpers.js b/packages/cli/e2e-test/helpers.js index 073248789e..4d3f4f4661 100644 --- a/packages/cli/e2e-test/helpers.js +++ b/packages/cli/e2e-test/helpers.js @@ -130,15 +130,14 @@ async function waitForPageWithText( ); break; } catch (error) { - if (error instanceof browser.assert.AssertionError) { - findTextAttempts++; - if (findTextAttempts <= maxFindTextAttempts) { - await browser.visit(path); - await new Promise(resolve => setTimeout(resolve, intervalMs)); - continue - } + findTextAttempts++; + if (findTextAttempts <= maxFindTextAttempts) { + await browser.visit(path); + await new Promise(resolve => setTimeout(resolve, intervalMs)); + continue + } else { + throw error; } - throw error; } } }