1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-21 17:37:01 +01:00

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
This commit is contained in:
David Walsh 2023-08-01 13:26:42 -05:00 committed by GitHub
parent 4c37448c97
commit 034626a57d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
},
);
});