Skip to content

Commit 97231f5

Browse files
committed
updated test
1 parent bcf1659 commit 97231f5

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

test/e2e/page-objects/flows/onboarding.flow.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,26 @@ import TermsOfUseUpdateModal from '../pages/dialog/terms-of-use-update-modal';
1818
* Helper function to handle post-onboarding navigation for sidepanel builds.
1919
* When sidepanel is enabled, clicking "Done" doesn't navigate the current window,
2020
* so we need to manually navigate to home.html.
21+
* This function detects sidepanel by checking the manifest at runtime.
2122
* Note: Sidepanel is only supported on Chrome-based browsers, not Firefox.
2223
*
2324
* @param driver - The WebDriver instance
2425
*/
2526
export const handleSidepanelPostOnboarding = async (
2627
driver: Driver,
2728
): Promise<void> => {
28-
// AND we're not running on Firefox (which doesn't support sidepanel)
29-
const isSidepanelEnabled =
30-
process.env.IS_SIDEPANEL &&
31-
process.env.SELENIUM_BROWSER !== Browser.FIREFOX;
29+
// Only run on Chrome-based browsers (Firefox doesn't support sidepanel)
30+
if (process.env.SELENIUM_BROWSER === Browser.FIREFOX) {
31+
return;
32+
}
3233

33-
if (isSidepanelEnabled) {
34-
// Give the onboarding completion time to process (needed for sidepanel)
35-
await driver.delay(2000);
34+
// Check if the built extension has sidepanel by checking for sidePanel permission in manifest
35+
const manifest = await driver.executeScript(
36+
'return chrome.runtime.getManifest();',
37+
);
38+
const hasSidePanelPermission = manifest?.permissions?.includes('sidePanel');
3639

40+
if (hasSidePanelPermission) {
3741
// Navigate directly to home page in current window
3842
// With sidepanel enabled, this ensures we load home page in the test window
3943
await driver.driver.get(`${driver.extensionUrl}/home.html`);

test/e2e/tests/identity/account-syncing/adding-and-renaming-accounts.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ describe('Account syncing - Adding and Renaming Accounts', function () {
188188
await withFixtures(
189189
{
190190
fixtures: new FixtureBuilder({ onboarding: true }).build(),
191+
ignoredConsoleErrors: ['GL Context was lost'],
191192
title: this.test?.fullTitle(),
192193
testSpecificMock: sharedMockSetup,
193194
},

test/e2e/tests/onboarding/onboarding.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ describe('MetaMask onboarding', function () {
5252
await withFixtures(
5353
{
5454
fixtures: new FixtureBuilder({ onboarding: true }).build(),
55+
ignoredConsoleErrors: ['GL Context was lost'],
5556
title: this.test?.fullTitle(),
5657
},
5758
async ({ driver }: { driver: Driver }) => {

test/e2e/tests/privacy/onboarding-token-price-call-privacy.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ describe('MetaMask onboarding', function () {
3737
},
3838
})
3939
.build(),
40+
ignoredConsoleErrors: ['GL Context was lost'],
4041
title: this.test?.fullTitle(),
4142
testSpecificMock: mockTokenPriceApi,
4243
},
@@ -101,6 +102,7 @@ describe('MetaMask onboarding', function () {
101102
},
102103
})
103104
.build(),
105+
ignoredConsoleErrors: ['GL Context was lost'],
104106
title: this.test?.fullTitle(),
105107
testSpecificMock: mockTokenPriceApi,
106108
},

0 commit comments

Comments
 (0)