diff --git a/test/e2e/helpers.js b/test/e2e/helpers.js
index 2839a4578f53..a68027f20181 100644
--- a/test/e2e/helpers.js
+++ b/test/e2e/helpers.js
@@ -51,7 +51,6 @@ async function withFixtures(options, testSuite) {
useBundler,
usePaymaster,
ethConversionInUsd,
- waitUntilExtensionIsFullyStarted = false,
} = options;
const fixtureServer = new FixtureServer();
@@ -177,17 +176,6 @@ async function withFixtures(options, testSuite) {
console.log(`\nExecuting testcase: '${title}'\n`);
- if (waitUntilExtensionIsFullyStarted) {
- if (
- process.env.ENABLE_MV3 === 'true' ||
- process.env.ENABLE_MV3 === undefined
- ) {
- await driver.navigate(PAGES.OFFSCREEN);
- } else {
- await driver.navigate(PAGES.BACKGROUND);
- }
- }
-
await testSuite({
driver: driverProxy ?? driver,
contractRegistry,
diff --git a/test/e2e/tests/phishing-controller/phishing-detection.spec.js b/test/e2e/tests/phishing-controller/phishing-detection.spec.js
index 24553129c530..6e33866f7c71 100644
--- a/test/e2e/tests/phishing-controller/phishing-detection.spec.js
+++ b/test/e2e/tests/phishing-controller/phishing-detection.spec.js
@@ -349,15 +349,25 @@ describe('Phishing Detection', function () {
function handleRequests(name, value, code) {
server.once('request', async function (_request, response) {
response.setHeader(name, value).writeHead(code).end(`
-
-
+
+
+
+
+ Phishing test
+
+
+
+
+ Redirecting...
+
+
`);
});
}
@@ -387,9 +397,6 @@ describe('Phishing Detection', function () {
const { promise, resolve } = createDeferredPromise();
fixturePromise = withFixtures(
{
- // The redirect Phishing handler isn't active until the extension is
- // fully started.
- waitUntilExtensionIsFullyStarted: true,
fixtures: new FixtureBuilder().build(),
ganacheOptions: defaultGanacheOptions,
title: this.test.fullTitle(),
@@ -406,6 +413,11 @@ describe('Phishing Detection', function () {
},
);
driver = await promise;
+
+ // required to ensure MetaMask is fully started before running tests
+ // if we had a way of detecting when the offscreen/background were ready
+ // we could remove this
+ await unlockWallet(driver);
});
after('Shut down fixtures', async function () {
deferredTestSuite.resolve(); // let the fixtures know tests are complete
@@ -419,7 +431,7 @@ describe('Phishing Detection', function () {
});
for (const code of redirectableStatusCodes) {
- it(`should display the MetaMask Phishing Detection page if a blocked site redirects via HTTP Status Code ${code} to another page`, async function () {
+ it.only(`should display the MetaMask Phishing Detection page if a blocked site redirects via HTTP Status Code ${code} to another page`, async function () {
const { port } = server.address();
const refresh = { name: 'Refresh', value: `0;url="${destination}"` };
const location = { name: 'Location', value: destination };