Skip to content

Commit

Permalink
fixing e2e failure in firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
NiranjanaBinoy committed Sep 3, 2024
1 parent 7f46ba7 commit ee1b204
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/scripts/constants/marketing-site-whitelist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
11 changes: 5 additions & 6 deletions test/e2e/tests/metrics/attribution/marketing-cookieid.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
withFixtures,
defaultGanacheOptions,
unlockWallet,
regularDelayMs,
} from '../../../helpers';
import { TestSuiteArguments } from '../../confirmations/transactions/shared';
import FixtureBuilder from '../../../fixture-builder';
Expand Down Expand Up @@ -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,
);
Expand Down Expand Up @@ -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,
);
Expand Down Expand Up @@ -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,
);
Expand Down Expand Up @@ -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,
);
Expand All @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/tests/metrics/attribution/mock-page/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
);
}
window.onload = fireCookieIdEvent;
window.addEventListener('DOMContentLoaded', function() {
setTimeout(fireCookieIdEvent, 2000);
});
</script>
<body>
<div>Hello</div>
Expand Down

0 comments on commit ee1b204

Please sign in to comment.