From 034626a57d5aeda1cf660a5c2c2988f5b723e21a Mon Sep 17 00:00:00 2001 From: David Walsh Date: Tue, 1 Aug 2023 13:26:42 -0500 Subject: [PATCH] Fix ipfs-ens-resolution.spec.js E2E intermittent failure (#20311) * Fix ipfs-ens-resolution.spec.js E2E intermittent failure * Wait for URL change instead of large delay --- test/e2e/tests/ipfs-ens-resolution.spec.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/test/e2e/tests/ipfs-ens-resolution.spec.js b/test/e2e/tests/ipfs-ens-resolution.spec.js index 98683de08..73b2f70d6 100644 --- a/test/e2e/tests/ipfs-ens-resolution.spec.js +++ b/test/e2e/tests/ipfs-ens-resolution.spec.js @@ -1,6 +1,5 @@ -const { strict: assert } = require('assert'); const { buildWebDriver } = require('../webdriver'); -const { withFixtures } = require('../helpers'); +const { withFixtures, tinyDelayMs } = require('../helpers'); const FixtureBuilder = require('../fixture-builder'); describe('Settings', function () { @@ -24,8 +23,10 @@ describe('Settings', function () { } // Ensure that the redirect to ENS Domains has happened - const currentUrl = await driver.getCurrentUrl(); - assert.equal(currentUrl, ENS_DESTINATION_URL); + await driver.wait(async () => { + const currentUrl = await driver.getCurrentUrl(); + return currentUrl === ENS_DESTINATION_URL; + }, tinyDelayMs); await driver.quit(); }); @@ -71,8 +72,10 @@ describe('Settings', function () { // Ensure that the redirect to ENS Domains does not happen // Instead, the domain will be kept which is a 404 - const currentUrl = await driver.getCurrentUrl(); - assert.equal(currentUrl, ENS_NAME_URL); + await driver.wait(async () => { + const currentUrl = await driver.getCurrentUrl(); + return currentUrl === ENS_NAME_URL; + }, tinyDelayMs); }, ); });