From ee1b204e8cd2d2511125c701de0430cc27d46869 Mon Sep 17 00:00:00 2001 From: Niranjana Binoy <43930900+NiranjanaBinoy@users.noreply.github.com> Date: Tue, 3 Sep 2024 10:56:22 -0400 Subject: [PATCH] fixing e2e failure in firefox --- app/scripts/constants/marketing-site-whitelist.ts | 4 ++-- .../metrics/attribution/marketing-cookieid.spec.ts | 11 +++++------ .../tests/metrics/attribution/mock-page/index.html | 3 +++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/scripts/constants/marketing-site-whitelist.ts b/app/scripts/constants/marketing-site-whitelist.ts index 8729e27cdafb..0ca4a28e1b1e 100644 --- a/app/scripts/constants/marketing-site-whitelist.ts +++ b/app/scripts/constants/marketing-site-whitelist.ts @@ -2,8 +2,8 @@ export const COOKIE_ID_MARKETING_WHITELIST = [ 'https://metamask.io', 'https://learn.metamask.io', 'https://mmi-support.zendesk.com/hc/en-us', - 'https://community.metamask.io/', - 'https://support.metamask.io/', + 'https://community.metamask.io', + 'https://support.metamask.io', ]; if (process.env.IN_TEST) { diff --git a/test/e2e/tests/metrics/attribution/marketing-cookieid.spec.ts b/test/e2e/tests/metrics/attribution/marketing-cookieid.spec.ts index e388cd222711..48db56859770 100644 --- a/test/e2e/tests/metrics/attribution/marketing-cookieid.spec.ts +++ b/test/e2e/tests/metrics/attribution/marketing-cookieid.spec.ts @@ -8,7 +8,6 @@ import { withFixtures, defaultGanacheOptions, unlockWallet, - regularDelayMs, } from '../../../helpers'; import { TestSuiteArguments } from '../../confirmations/transactions/shared'; import FixtureBuilder from '../../../fixture-builder'; @@ -72,7 +71,7 @@ describe('Marketing cookieId', function (this: Suite) { await driver.openNewPage(`http://127.0.0.1:8080`); // wait for state to update - await driver.delay(regularDelayMs); + await driver.delay(5000); await driver.switchToWindowWithTitle( WINDOW_TITLES.ExtensionInFullScreenView, ); @@ -114,7 +113,7 @@ describe('Marketing cookieId', function (this: Suite) { await driver.openNewPage(`http://127.0.0.1:8080`); // wait for state to update - await driver.delay(regularDelayMs); + await driver.delay(5000); await driver.switchToWindowWithTitle( WINDOW_TITLES.ExtensionInFullScreenView, ); @@ -151,7 +150,7 @@ describe('Marketing cookieId', function (this: Suite) { await driver.openNewPage(`http://127.0.0.1:8080`); // wait for state to update - await driver.delay(regularDelayMs); + await driver.delay(5000); await driver.switchToWindowWithTitle( WINDOW_TITLES.ExtensionInFullScreenView, ); @@ -192,7 +191,7 @@ describe('Marketing cookieId', function (this: Suite) { await driver.openNewPage(`http://127.0.0.1:8080`); // wait for state to update - await driver.delay(regularDelayMs); + await driver.delay(5000); await driver.switchToWindowWithTitle( WINDOW_TITLES.ExtensionInFullScreenView, ); @@ -216,7 +215,7 @@ describe('Marketing cookieId', function (this: Suite) { await driver.clickElement(selectors.dataCollectionWarningAckButton); // wait for state to update - await driver.delay(regularDelayMs); + await driver.delay(5000); uiState = await getCleanAppState(driver); assert.equal(uiState.metamask.dataCollectionForMarketing, false); diff --git a/test/e2e/tests/metrics/attribution/mock-page/index.html b/test/e2e/tests/metrics/attribution/mock-page/index.html index f44e7112a31a..3d6046de7e67 100644 --- a/test/e2e/tests/metrics/attribution/mock-page/index.html +++ b/test/e2e/tests/metrics/attribution/mock-page/index.html @@ -24,6 +24,9 @@ ); } window.onload = fireCookieIdEvent; + window.addEventListener('DOMContentLoaded', function() { + setTimeout(fireCookieIdEvent, 2000); + });