From ad9afb9f85a505b97ca7128b20d6525105872e0d Mon Sep 17 00:00:00 2001 From: Sid Vishnoi <8426945+sidvishnoi@users.noreply.github.com> Date: Mon, 11 Nov 2024 18:38:14 +0530 Subject: [PATCH 1/5] refactor(tests/e2e): simplify `openPopup` helper --- tests/e2e/fixtures/base.ts | 10 ++-------- tests/e2e/pages/popup.ts | 26 +++----------------------- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/tests/e2e/fixtures/base.ts b/tests/e2e/fixtures/base.ts index d544404f..f7ff7974 100644 --- a/tests/e2e/fixtures/base.ts +++ b/tests/e2e/fixtures/base.ts @@ -1,7 +1,6 @@ import { test as base, type BrowserContext, type Page } from '@playwright/test'; import { getBackground, - getExtensionId, loadContext, BrowserIntl, type Background, @@ -51,13 +50,8 @@ export const test = base.extend<{ page: Page }, BaseScopeWorker>({ ], popup: [ - async ({ background, persistentContext, browserName, channel }, use) => { - const extensionId = getExtensionId(browserName, background); - const popup = await openPopup( - persistentContext, - { browserName, channel }, - extensionId, - ); + async ({ background, persistentContext }, use) => { + const popup = await openPopup(persistentContext, background); await use(popup); await popup.close(); diff --git a/tests/e2e/pages/popup.ts b/tests/e2e/pages/popup.ts index 8479a00f..aceae56d 100644 --- a/tests/e2e/pages/popup.ts +++ b/tests/e2e/pages/popup.ts @@ -1,5 +1,5 @@ import type { BrowserContext } from '@playwright/test'; -import type { BrowserIntl, BrowserInfo } from '../fixtures/helpers'; +import type { BrowserIntl, Background } from '../fixtures/helpers'; export type Popup = Awaited>; @@ -7,10 +7,9 @@ export { connectWallet } from '../helpers/testWallet'; export async function openPopup( context: BrowserContext, - { browserName, channel }: BrowserInfo, - extensionId: string, + background: Background, ) { - const url = getPopupUrl({ browserName, channel }, extensionId); + const url = await background.evaluate(() => chrome.action.getPopup({})); const page = await context.newPage(); const popupPromise = page.waitForEvent('popup'); await page.evaluate(() => { @@ -28,25 +27,6 @@ export async function openPopup( return popup; } -function getPopupUrl( - { browserName, channel }: BrowserInfo, - extensionId: string, -) { - let url: string; - if (browserName === 'chromium') { - if (channel === 'edge') { - url = `extension://${extensionId}/popup/index.html`; - } else { - url = `chrome-extension://${extensionId}/popup/index.html`; - } - } else if (browserName === 'firefox') { - url = `moz-extension://${extensionId}/popup/index.html`; - } else { - throw new Error('Unsupported browser: ' + browserName); - } - return url; -} - export async function disconnectWallet(popup: Popup) { await popup.locator(`[href="/settings"]`).click(); await popup.locator('button').getByText('Disconnect').click(); From 8358b8f0ba94f64ed0e0d8641452395d061777f6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 17:52:59 +0530 Subject: [PATCH 2/5] chore(deps): update react monorepo (#699) --- package.json | 4 +- pnpm-lock.yaml | 152 ++++++++++++++++++++++++------------------------- 2 files changed, 78 insertions(+), 78 deletions(-) diff --git a/package.json b/package.json index 718c097f..52ea51cf 100644 --- a/package.json +++ b/package.json @@ -55,8 +55,8 @@ "@types/github-script": "github:actions/github-script", "@types/jest": "^29.5.14", "@types/node": "^20.17.6", - "@types/react": "^18.3.9", - "@types/react-dom": "^18.3.0", + "@types/react": "^18.3.12", + "@types/react-dom": "^18.3.1", "@types/react-router-dom": "^5.3.3", "@types/webextension-polyfill": "^0.12.1", "@typescript-eslint/eslint-plugin": "^8.12.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3c583602..a5664fd5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,7 +26,7 @@ importers: version: 1.5.0 '@radix-ui/react-tabs': specifier: ^1.1.1 - version: 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 1.1.1(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) awilix: specifier: ^12.0.3 version: 12.0.3 @@ -87,7 +87,7 @@ importers: version: 6.5.0 '@testing-library/react': specifier: ^16.0.1 - version: 16.0.1(@testing-library/dom@10.1.0)(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 16.0.1(@testing-library/dom@10.1.0)(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@types/archiver': specifier: ^6.0.3 version: 6.0.3 @@ -104,11 +104,11 @@ importers: specifier: ^20.17.6 version: 20.17.6 '@types/react': - specifier: ^18.3.9 - version: 18.3.9 + specifier: ^18.3.12 + version: 18.3.12 '@types/react-dom': - specifier: ^18.3.0 - version: 18.3.0 + specifier: ^18.3.1 + version: 18.3.1 '@types/react-router-dom': specifier: ^5.3.3 version: 5.3.3 @@ -1322,8 +1322,8 @@ packages: '@types/prop-types@15.7.11': resolution: {integrity: sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==} - '@types/react-dom@18.3.0': - resolution: {integrity: sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==} + '@types/react-dom@18.3.1': + resolution: {integrity: sha512-qW1Mfv8taImTthu4KoXgDfLuk4bydU6Q/TkADnDWWHwi4NX4BR+LWfTp2sVmTqRrsHvyDDTelgelxJ+SsejKKQ==} '@types/react-router-dom@5.3.3': resolution: {integrity: sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==} @@ -1331,8 +1331,8 @@ packages: '@types/react-router@5.1.20': resolution: {integrity: sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==} - '@types/react@18.3.9': - resolution: {integrity: sha512-+BpAVyTpJkNWWSSnaLBk6ePpHLOGJKnEQNbINNovPWzvEUyAe3e+/d494QdEh71RekM/qV7lw6jzf1HGrJyAtQ==} + '@types/react@18.3.12': + resolution: {integrity: sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw==} '@types/readdir-glob@1.1.5': resolution: {integrity: sha512-raiuEPUYqXu+nvtY2Pe8s8FEmZ3x5yAH4VkLdihcPdalvsHltomrRC9BzuStrJ9yk06470hS0Crw0f1pXqD+Hg==} @@ -5048,126 +5048,126 @@ snapshots: '@radix-ui/primitive@1.1.0': {} - '@radix-ui/react-collection@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/react-collection@1.1.0(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.9)(react@18.3.1) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.12)(react@18.3.1) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.12)(react@18.3.1) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-slot': 1.1.0(@types/react@18.3.12)(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 + '@types/react': 18.3.12 + '@types/react-dom': 18.3.1 - '@radix-ui/react-compose-refs@1.1.0(@types/react@18.3.9)(react@18.3.1)': + '@radix-ui/react-compose-refs@1.1.0(@types/react@18.3.12)(react@18.3.1)': dependencies: react: 18.3.1 optionalDependencies: - '@types/react': 18.3.9 + '@types/react': 18.3.12 - '@radix-ui/react-context@1.1.0(@types/react@18.3.9)(react@18.3.1)': + '@radix-ui/react-context@1.1.0(@types/react@18.3.12)(react@18.3.1)': dependencies: react: 18.3.1 optionalDependencies: - '@types/react': 18.3.9 + '@types/react': 18.3.12 - '@radix-ui/react-context@1.1.1(@types/react@18.3.9)(react@18.3.1)': + '@radix-ui/react-context@1.1.1(@types/react@18.3.12)(react@18.3.1)': dependencies: react: 18.3.1 optionalDependencies: - '@types/react': 18.3.9 + '@types/react': 18.3.12 - '@radix-ui/react-direction@1.1.0(@types/react@18.3.9)(react@18.3.1)': + '@radix-ui/react-direction@1.1.0(@types/react@18.3.12)(react@18.3.1)': dependencies: react: 18.3.1 optionalDependencies: - '@types/react': 18.3.9 + '@types/react': 18.3.12 - '@radix-ui/react-id@1.1.0(@types/react@18.3.9)(react@18.3.1)': + '@radix-ui/react-id@1.1.0(@types/react@18.3.12)(react@18.3.1)': dependencies: - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.9)(react@18.3.1) + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.12)(react@18.3.1) react: 18.3.1 optionalDependencies: - '@types/react': 18.3.9 + '@types/react': 18.3.12 - '@radix-ui/react-presence@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/react-presence@1.1.1(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.9)(react@18.3.1) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.12)(react@18.3.1) + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.3.12)(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 + '@types/react': 18.3.12 + '@types/react-dom': 18.3.1 - '@radix-ui/react-primitive@2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/react-primitive@2.0.0(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@radix-ui/react-slot': 1.1.0(@types/react@18.3.9)(react@18.3.1) + '@radix-ui/react-slot': 1.1.0(@types/react@18.3.12)(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 + '@types/react': 18.3.12 + '@types/react-dom': 18.3.1 - '@radix-ui/react-roving-focus@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/react-roving-focus@1.1.0(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-context': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-id': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.9)(react@18.3.1) + '@radix-ui/react-collection': 1.1.0(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.12)(react@18.3.1) + '@radix-ui/react-context': 1.1.0(@types/react@18.3.12)(react@18.3.1) + '@radix-ui/react-direction': 1.1.0(@types/react@18.3.12)(react@18.3.1) + '@radix-ui/react-id': 1.1.0(@types/react@18.3.12)(react@18.3.1) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.12)(react@18.3.1) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.12)(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 + '@types/react': 18.3.12 + '@types/react-dom': 18.3.1 - '@radix-ui/react-slot@1.1.0(@types/react@18.3.9)(react@18.3.1)': + '@radix-ui/react-slot@1.1.0(@types/react@18.3.12)(react@18.3.1)': dependencies: - '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.9)(react@18.3.1) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.12)(react@18.3.1) react: 18.3.1 optionalDependencies: - '@types/react': 18.3.9 + '@types/react': 18.3.12 - '@radix-ui/react-tabs@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@radix-ui/react-tabs@1.1.1(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@radix-ui/primitive': 1.1.0 - '@radix-ui/react-context': 1.1.1(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-direction': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-id': 1.1.0(@types/react@18.3.9)(react@18.3.1) - '@radix-ui/react-presence': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.9)(react@18.3.1) + '@radix-ui/react-context': 1.1.1(@types/react@18.3.12)(react@18.3.1) + '@radix-ui/react-direction': 1.1.0(@types/react@18.3.12)(react@18.3.1) + '@radix-ui/react-id': 1.1.0(@types/react@18.3.12)(react@18.3.1) + '@radix-ui/react-presence': 1.1.1(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-roving-focus': 1.1.0(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.12)(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 + '@types/react': 18.3.12 + '@types/react-dom': 18.3.1 - '@radix-ui/react-use-callback-ref@1.1.0(@types/react@18.3.9)(react@18.3.1)': + '@radix-ui/react-use-callback-ref@1.1.0(@types/react@18.3.12)(react@18.3.1)': dependencies: react: 18.3.1 optionalDependencies: - '@types/react': 18.3.9 + '@types/react': 18.3.12 - '@radix-ui/react-use-controllable-state@1.1.0(@types/react@18.3.9)(react@18.3.1)': + '@radix-ui/react-use-controllable-state@1.1.0(@types/react@18.3.12)(react@18.3.1)': dependencies: - '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.9)(react@18.3.1) + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.3.12)(react@18.3.1) react: 18.3.1 optionalDependencies: - '@types/react': 18.3.9 + '@types/react': 18.3.12 - '@radix-ui/react-use-layout-effect@1.1.0(@types/react@18.3.9)(react@18.3.1)': + '@radix-ui/react-use-layout-effect@1.1.0(@types/react@18.3.12)(react@18.3.1)': dependencies: react: 18.3.1 optionalDependencies: - '@types/react': 18.3.9 + '@types/react': 18.3.12 '@remix-run/router@1.19.2': {} @@ -5271,15 +5271,15 @@ snapshots: lodash: 4.17.21 redent: 3.0.0 - '@testing-library/react@16.0.1(@testing-library/dom@10.1.0)(@types/react-dom@18.3.0)(@types/react@18.3.9)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@testing-library/react@16.0.1(@testing-library/dom@10.1.0)(@types/react-dom@18.3.1)(@types/react@18.3.12)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@babel/runtime': 7.24.4 '@testing-library/dom': 10.1.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: - '@types/react': 18.3.9 - '@types/react-dom': 18.3.0 + '@types/react': 18.3.12 + '@types/react-dom': 18.3.1 '@tootallnate/once@2.0.0': {} @@ -5379,22 +5379,22 @@ snapshots: '@types/prop-types@15.7.11': {} - '@types/react-dom@18.3.0': + '@types/react-dom@18.3.1': dependencies: - '@types/react': 18.3.9 + '@types/react': 18.3.12 '@types/react-router-dom@5.3.3': dependencies: '@types/history': 4.7.11 - '@types/react': 18.3.9 + '@types/react': 18.3.12 '@types/react-router': 5.1.20 '@types/react-router@5.1.20': dependencies: '@types/history': 4.7.11 - '@types/react': 18.3.9 + '@types/react': 18.3.12 - '@types/react@18.3.9': + '@types/react@18.3.12': dependencies: '@types/prop-types': 15.7.11 csstype: 3.1.3 From 56e5ac20815c30e5366e134da6a7fb89d3f403b0 Mon Sep 17 00:00:00 2001 From: darianm <47156919+DarianM@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:27:52 +0200 Subject: [PATCH 3/5] fix(scripts/build): use correct asset-copy paths on Windows (#712) --- esbuild/plugins.ts | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/esbuild/plugins.ts b/esbuild/plugins.ts index 34b96574..a4a97bfe 100644 --- a/esbuild/plugins.ts +++ b/esbuild/plugins.ts @@ -48,20 +48,24 @@ export const getPlugins = ({ resolveFrom: ROOT_DIR, assets: [ { - from: path.join(SRC_DIR, 'popup', 'index.html'), - to: path.join(outDir, 'popup', 'index.html'), + from: toPosix(path.join(SRC_DIR, 'popup', 'index.html')), + to: toPosix(path.join(outDir, 'popup', 'index.html')), }, { - from: path.join(SRC_DIR, 'pages', 'progress-connect', 'index.html'), - to: path.join(outDir, 'pages', 'progress-connect', 'index.html'), + from: toPosix( + path.join(SRC_DIR, 'pages', 'progress-connect', 'index.html'), + ), + to: toPosix( + path.join(outDir, 'pages', 'progress-connect', 'index.html'), + ), }, { - from: path.join(SRC_DIR, '_locales/**/*'), - to: path.join(outDir, '_locales'), + from: toPosix(path.join(SRC_DIR, '_locales', '**', '*')), + to: toPosix(path.join(outDir, '_locales')), }, { - from: path.join(SRC_DIR, 'assets/**/*'), - to: path.join(outDir, 'assets'), + from: toPosix(path.join(SRC_DIR, 'assets', '**', '*')), + to: toPosix(path.join(outDir, 'assets')), }, ], watch: dev, @@ -174,3 +178,7 @@ function cleanPlugin(dirs: string[]): ESBuildPlugin { }, }; } + +function toPosix(filePath: string): string { + return filePath.replaceAll(path.sep, path.posix.sep); +} From 89aca7cfd158dda6037ff84ae6c7623fddefb561 Mon Sep 17 00:00:00 2001 From: Sid Vishnoi <8426945+sidvishnoi@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:39:25 +0530 Subject: [PATCH 4/5] fix persistent context not loading extension correctly --- tests/e2e/fixtures/helpers.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/e2e/fixtures/helpers.ts b/tests/e2e/fixtures/helpers.ts index 327dd51b..90a4d908 100644 --- a/tests/e2e/fixtures/helpers.ts +++ b/tests/e2e/fixtures/helpers.ts @@ -5,6 +5,7 @@ import net from 'node:net'; import path from 'node:path'; import { readFileSync } from 'node:fs'; import { readFile } from 'node:fs/promises'; +import { tmpdir } from 'node:os'; import { chromium, firefox, @@ -142,10 +143,15 @@ export async function loadContext( { browserName, channel }: BrowserInfo, workerInfo: WorkerInfo, ) { + const userDataDir = path.join( + tmpdir(), + 'wm-extension-playwright', + `${browserName}-${channel}`, + ); const pathToExtension = getPathToExtension(browserName); let context: BrowserContext | undefined; if (browserName === 'chromium') { - context = await chromium.launchPersistentContext('', { + context = await chromium.launchPersistentContext(userDataDir, { headless: true, channel, args: [ From e60e3773d10681fada24513848ff6930c9e99b5e Mon Sep 17 00:00:00 2001 From: Sid Vishnoi <8426945+sidvishnoi@users.noreply.github.com> Date: Fri, 15 Nov 2024 17:11:23 +0530 Subject: [PATCH 5/5] make userDataDir more unique? --- tests/e2e/fixtures/helpers.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/e2e/fixtures/helpers.ts b/tests/e2e/fixtures/helpers.ts index 90a4d908..528b529a 100644 --- a/tests/e2e/fixtures/helpers.ts +++ b/tests/e2e/fixtures/helpers.ts @@ -6,6 +6,7 @@ import path from 'node:path'; import { readFileSync } from 'node:fs'; import { readFile } from 'node:fs/promises'; import { tmpdir } from 'node:os'; +import { format } from 'date-fns'; import { chromium, firefox, @@ -147,6 +148,7 @@ export async function loadContext( tmpdir(), 'wm-extension-playwright', `${browserName}-${channel}`, + format(new Date(), 'yyyyMMdd-HHmmss'), ); const pathToExtension = getPathToExtension(browserName); let context: BrowserContext | undefined;