chore: add another exponential delay to wait for the page to load too

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-10-26 13:40:45 +02:00
parent f733a19f85
commit 1af1f76cb8
+3
View File
@@ -139,8 +139,11 @@ export async function waitForPageWithText(
const waitTimeMs = intervalMs * (Math.log10(findAttempts + 1) + 1);
console.log(`Attempting to load page at ${path}, waiting ${waitTimeMs}`);
await new Promise(resolve => setTimeout(resolve, waitTimeMs));
await browser.visit(path);
await new Promise(resolve => setTimeout(resolve, waitTimeMs));
const escapedText = text.replace(/"|\\/g, '\\$&');
browser.assert.evaluate(
`Array.from(document.querySelectorAll("*")).some(el => el.textContent === "${escapedText}")`,