From 38f4a6b9754bba93ecaf8c6c729912ce31030509 Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 13:34:27 +0100 Subject: [PATCH 01/18] start migrating existing e2e tests to companion app --- .../e2e/accountHandling/lockedAccount.spec.ts | 52 +++++++++++++ .../accountHandling/unavailableWallet.spec.ts | 24 ++++++ .../e2e/accountHandling/wrongChain.spec.ts | 31 ++++++++ deployables/app/e2e/connectWallet.ts | 12 +++ deployables/app/e2e/smoketest.spec.ts | 9 +++ deployables/app/e2e/utils/fixture.ts | 39 ++++++++++ deployables/app/e2e/utils/getExtensionPage.ts | 16 ++++ deployables/app/e2e/utils/index.ts | 4 + deployables/app/e2e/utils/loadExtension.ts | 10 +++ deployables/app/package.json | 4 + deployables/app/playwright.config.ts | 44 +++++++++++ deployables/extension/package.json | 2 +- packages/test-utils/package.json | 6 ++ packages/test-utils/src/e2e/index.ts | 2 + packages/test-utils/src/e2e/mockWeb3.ts | 77 +++++++++++++++++++ packages/test-utils/src/e2e/waitFor.ts | 21 +++++ pnpm-lock.yaml | 67 +++++++++++++++- 17 files changed, 418 insertions(+), 2 deletions(-) create mode 100644 deployables/app/e2e/accountHandling/lockedAccount.spec.ts create mode 100644 deployables/app/e2e/accountHandling/unavailableWallet.spec.ts create mode 100644 deployables/app/e2e/accountHandling/wrongChain.spec.ts create mode 100644 deployables/app/e2e/connectWallet.ts create mode 100644 deployables/app/e2e/smoketest.spec.ts create mode 100644 deployables/app/e2e/utils/fixture.ts create mode 100644 deployables/app/e2e/utils/getExtensionPage.ts create mode 100644 deployables/app/e2e/utils/index.ts create mode 100644 deployables/app/e2e/utils/loadExtension.ts create mode 100644 deployables/app/playwright.config.ts create mode 100644 packages/test-utils/src/e2e/index.ts create mode 100644 packages/test-utils/src/e2e/mockWeb3.ts create mode 100644 packages/test-utils/src/e2e/waitFor.ts diff --git a/deployables/app/e2e/accountHandling/lockedAccount.spec.ts b/deployables/app/e2e/accountHandling/lockedAccount.spec.ts new file mode 100644 index 000000000..703177ba3 --- /dev/null +++ b/deployables/app/e2e/accountHandling/lockedAccount.spec.ts @@ -0,0 +1,52 @@ +import test, { expect } from '@playwright/test' +import { mockWeb3 } from '@zodiac/test-utils/e2e' +import { connectWallet } from '../connectWallet' + +test.describe('Locked account', () => { + const account = '0x1000000000000000000000000000000000000000' + + test('handles wallet disconnect gracefully', async ({ page }) => { + await page.goto('/new-route') + + const { lockWallet } = await mockWeb3(page) + + await connectWallet(page) + await lockWallet() + + await expect( + page.getByRole('alert', { name: 'Wallet disconnected' }), + ).toBeInViewport() + }) + + test('it is possible to reconnect an account', async ({ page }) => { + await page.goto('/new-route') + + const { lockWallet } = await mockWeb3(page, { + accounts: [account], + }) + + await connectWallet(page, account) + await lockWallet() + + await page.getByRole('button', { name: 'Connect', exact: true }).click() + + await expect( + page.getByRole('textbox', { name: 'Pilot Account' }), + ).toHaveValue(account) + }) + + test('it is possible to disconnect a locked account', async ({ page }) => { + await page.goto('/new-route') + + const { lockWallet } = await mockWeb3(page) + + await connectWallet(page) + await lockWallet() + + await page.getByRole('button', { name: 'Disconnect' }).click() + + await expect( + page.getByRole('button', { name: 'Connect with MetaMask' }), + ).toBeInViewport() + }) +}) diff --git a/deployables/app/e2e/accountHandling/unavailableWallet.spec.ts b/deployables/app/e2e/accountHandling/unavailableWallet.spec.ts new file mode 100644 index 000000000..fa8393468 --- /dev/null +++ b/deployables/app/e2e/accountHandling/unavailableWallet.spec.ts @@ -0,0 +1,24 @@ +import test, { expect } from '@playwright/test' +import { mockWeb3 } from '@zodiac/test-utils/e2e' +import { connectWallet } from '../connectWallet' + +test.describe('Account unavailable', () => { + test('handles unavailable accounts gracefully', async ({ page }) => { + await page.goto('/new-route') + + const { loadAccounts } = await mockWeb3(page, { + accounts: ['0x1000000000000000000000000000000000000000'], + }) + + await connectWallet(page, '0x1000000000000000000000000000000000000000') + await loadAccounts(['0x2000000000000000000000000000000000000000']) + + await expect( + page.getByRole('alert', { + name: `Account is not connected`, + }), + ).toHaveAccessibleDescription( + 'Switch your wallet to this account in order to use Pilot.', + ) + }) +}) diff --git a/deployables/app/e2e/accountHandling/wrongChain.spec.ts b/deployables/app/e2e/accountHandling/wrongChain.spec.ts new file mode 100644 index 000000000..2add645b0 --- /dev/null +++ b/deployables/app/e2e/accountHandling/wrongChain.spec.ts @@ -0,0 +1,31 @@ +import test, { expect } from '@playwright/test' +import { mockWeb3 } from '@zodiac/test-utils/e2e' +import { connectWallet } from '../connectWallet' + +test.describe('Wrong chain selected', () => { + test('it is possible to switch to the correct chain', async ({ page }) => { + await page.goto('/new-route') + + const { switchChain } = await mockWeb3(page) + + await connectWallet(page) + await switchChain(10) + + await expect( + page.getByRole('alert', { name: 'Chain mismatch' }), + ).toBeInViewport() + }) + + test('it is possible to switch back to the connected chain', async ({ + page, + }) => { + const { switchChain } = await mockWeb3(page) + + await connectWallet(page) + await switchChain(10) + + await expect( + page.getByRole('button', { name: 'Switch wallet to Ethereum' }), + ).toBeInViewport() + }) +}) diff --git a/deployables/app/e2e/connectWallet.ts b/deployables/app/e2e/connectWallet.ts new file mode 100644 index 000000000..ff76e416e --- /dev/null +++ b/deployables/app/e2e/connectWallet.ts @@ -0,0 +1,12 @@ +import { expect, Page } from '@playwright/test' +import { defaultMockAccount } from '@zodiac/test-utils/e2e' + +export const connectWallet = async ( + page: Page, + account: `0x${string}` = defaultMockAccount, +) => { + await page.getByRole('button', { name: 'Connect with MetaMask' }).click() + await expect( + page.getByRole('textbox', { name: 'Pilot Account' }), + ).toHaveValue(account) +} diff --git a/deployables/app/e2e/smoketest.spec.ts b/deployables/app/e2e/smoketest.spec.ts new file mode 100644 index 000000000..fd3d798e1 --- /dev/null +++ b/deployables/app/e2e/smoketest.spec.ts @@ -0,0 +1,9 @@ +import test, { expect } from '@playwright/test' + +test('connection to example app', async ({ page }) => { + await page.goto('/new-route') + + await expect( + page.getByRole('heading', { name: 'Route configuration' }), + ).toBeInViewport() +}) diff --git a/deployables/app/e2e/utils/fixture.ts b/deployables/app/e2e/utils/fixture.ts new file mode 100644 index 000000000..36e87d394 --- /dev/null +++ b/deployables/app/e2e/utils/fixture.ts @@ -0,0 +1,39 @@ +/* eslint-disable no-empty-pattern, react-hooks/rules-of-hooks */ +import { test as base, chromium, type BrowserContext } from '@playwright/test' +import { fileURLToPath } from 'url' + +export const test = base.extend<{ + context: BrowserContext + extensionId: string +}>({ + context: async ({}, use) => { + const pathToExtension = fileURLToPath( + new URL('../../public', import.meta.url), + ) + + const context = await chromium.launchPersistentContext('', { + headless: false, + args: [ + `--disable-extensions-except=${pathToExtension}`, + `--load-extension=${pathToExtension}`, + ], + ignoreDefaultArgs: [ + '--disable-component-extensions-with-background-pages', + ], + }) + + await use(context) + await context.close() + }, + + extensionId: async ({ context }, use) => { + let [background] = context.serviceWorkers() + if (!background) background = await context.waitForEvent('serviceworker') + + const extensionId = background.url().split('/')[2] + + await use(extensionId) + }, +}) + +export const expect = test.expect diff --git a/deployables/app/e2e/utils/getExtensionPage.ts b/deployables/app/e2e/utils/getExtensionPage.ts new file mode 100644 index 000000000..d472bfb3b --- /dev/null +++ b/deployables/app/e2e/utils/getExtensionPage.ts @@ -0,0 +1,16 @@ +import type { Page } from '@playwright/test' +import { waitFor } from '@zodiac/test-utils/e2e' + +export const getExtensionPage = (page: Page) => + waitFor(() => { + const extension = page + .context() + .pages() + .find((page) => page.url().startsWith('chrome-extension')) + + if (extension == null) { + throw new Error('Extension not found') + } + + return extension + }) diff --git a/deployables/app/e2e/utils/index.ts b/deployables/app/e2e/utils/index.ts new file mode 100644 index 000000000..14b06bfbe --- /dev/null +++ b/deployables/app/e2e/utils/index.ts @@ -0,0 +1,4 @@ +export { expect, test } from './fixture' +export { loadExtension } from './loadExtension' +export { defaultMockAccount, mockWeb3 } from './mockWeb3' +export { waitFor } from './waitFor' diff --git a/deployables/app/e2e/utils/loadExtension.ts b/deployables/app/e2e/utils/loadExtension.ts new file mode 100644 index 000000000..c75476d14 --- /dev/null +++ b/deployables/app/e2e/utils/loadExtension.ts @@ -0,0 +1,10 @@ +import type { Page } from '@playwright/test' +import { getExtensionPage } from './getExtensionPage' + +export const loadExtension = async (page: Page) => { + await page.goto('/') + + await page.getByRole('button', { name: 'Open extension' }).click() + + return getExtensionPage(page) +} diff --git a/deployables/app/package.json b/deployables/app/package.json index a12a0e2e7..46510595e 100644 --- a/deployables/app/package.json +++ b/deployables/app/package.json @@ -8,6 +8,8 @@ "start": "wrangler dev", "check-types": "react-router typegen && tsc -b", "test": "vitest", + "test:e2e": "playwright test --headed", + "test:e2e:ui": "pnpm test:e2e --ui", "lint": "eslint . --max-warnings=0" }, "dependencies": { @@ -37,6 +39,7 @@ "@cloudflare/workers-types": "4.20250109.0", "@depay/web3-mock": "^14.19.1", "@hiogawa/vite-node-miniflare": "0.1.1", + "@playwright/test": "^1.48.1", "@react-router/dev": "^7.1.1", "@testing-library/jest-dom": "^6.4.6", "@testing-library/react": "^16.0.1", @@ -50,6 +53,7 @@ "@zodiac/test-utils": "workspace:*", "@zodiac/typescript-config": "workspace:*", "autoprefixer": "^10.4.20", + "dotenv": "^16.0.1", "eslint": "^9.7.0", "postcss": "^8.4.49", "tailwindcss": "^3.4.16", diff --git a/deployables/app/playwright.config.ts b/deployables/app/playwright.config.ts new file mode 100644 index 000000000..91795b9c8 --- /dev/null +++ b/deployables/app/playwright.config.ts @@ -0,0 +1,44 @@ +import { defineConfig, devices } from '@playwright/test' +import dotenv from 'dotenv' + +dotenv.config() + +/** + * See https://playwright.dev/docs/test-configuration. + */ +export default defineConfig({ + testDir: './e2e', + /* Run tests in files in parallel */ + fullyParallel: true, + /* Fail the build on CI if you accidentally left test.only in the source code. */ + forbidOnly: !!process.env.CI, + /* Retry on CI only */ + retries: process.env.CI ? 2 : 0, + /* Opt out of parallel tests on CI. */ + workers: process.env.CI ? 1 : undefined, + /* Reporter to use. See https://playwright.dev/docs/test-reporters */ + reporter: process.env.CI ? 'github' : 'html', + /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ + use: { + /* Base URL to use in actions like `await page.goto('/')`. */ + baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL || 'http://localhost:3040', + + /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ + trace: 'on-first-retry', + }, + + /* Configure projects for major browsers */ + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], + + /* Run your local dev server before starting the tests */ + // webServer: { + // command: 'npm run start', + // url: 'http://127.0.0.1:3000', + // reuseExistingServer: !process.env.CI, + // }, +}) diff --git a/deployables/extension/package.json b/deployables/extension/package.json index e1e7712ca..c25060118 100644 --- a/deployables/extension/package.json +++ b/deployables/extension/package.json @@ -17,7 +17,7 @@ "zip": "mv public zodiac-pilot && zip -vr zodiac-pilot.zip zodiac-pilot/ -x \"*.DS_Store\" && mv zodiac-pilot public", "predev": "pnpm clean", "dev": "NODE_ENV=development pnpm build", - "test:unit": "vitest", + "test": "vitest", "test:e2e": "PW_CHROMIUM_ATTACH_TO_OTHER=1 playwright test --headed", "test:e2e:ui": "pnpm test:e2e --ui", "check-types": "tsc --noEmit", diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index e9c8cca42..ba7f0e48c 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -22,10 +22,16 @@ "./setup-chrome-mock": { "types": "./setup-chrome-mock.ts", "import": "./setup-chrome-mock.ts" + }, + "./e2e": { + "types": "./src/e2e/index.ts", + "import": "./src/e2e/index.ts" } }, "dependencies": { + "@depay/web3-mock": "^14.19.1", "@epic-web/invariant": "^1.0.0", + "@playwright/test": "^1.48.1", "@testing-library/react": "^16.0.1", "@zodiac/chains": "workspace:*", "@zodiac/schema": "workspace:*", diff --git a/packages/test-utils/src/e2e/index.ts b/packages/test-utils/src/e2e/index.ts new file mode 100644 index 000000000..9617cba48 --- /dev/null +++ b/packages/test-utils/src/e2e/index.ts @@ -0,0 +1,2 @@ +export { defaultMockAccount, mockWeb3 } from './mockWeb3' +export { waitFor } from './waitFor' diff --git a/packages/test-utils/src/e2e/mockWeb3.ts b/packages/test-utils/src/e2e/mockWeb3.ts new file mode 100644 index 000000000..28c523452 --- /dev/null +++ b/packages/test-utils/src/e2e/mockWeb3.ts @@ -0,0 +1,77 @@ +import { invariant } from '@epic-web/invariant' +import type { Page } from '@playwright/test' +import { readFileSync } from 'fs' +import type { Ref } from 'react' +import type { ChainId } from 'ser-kit' +import { fileURLToPath } from 'url' + +const web3Content: Ref = { current: null } + +declare global { + type mock = { + trigger: (event: string, data: unknown) => void + mock: (options: { chain: string; accounts: { return: string[] } }) => void + } + + const Web3Mock: mock +} + +type MockOptions = { accounts: string[] } + +export const defaultMockAccount = '0x1000000000000000000000000000000000000000' + +export const mockWeb3 = async ( + page: Page, + { accounts }: MockOptions = { accounts: [defaultMockAccount] }, +) => { + page.addInitScript({ + content: `${getLibraryCode()}\n(() => { Web3Mock.mock(${JSON.stringify({ blockchain: 'ethereum', accounts: { return: accounts } })})})()`, + }) + + return { + lockWallet() { + return getConnectFrame(page).evaluate(() => { + Web3Mock.trigger('accountsChanged', []) + }) + }, + loadAccounts(accounts: string[]) { + return getConnectFrame(page).evaluate( + ([accounts]) => { + Web3Mock.trigger('accountsChanged', accounts) + }, + [accounts], + ) + }, + switchChain(chainId: ChainId) { + return getConnectFrame(page).evaluate( + ([chainId]) => { + Web3Mock.trigger('chainChanged', `0x${chainId}`) + }, + [chainId], + ) + }, + } +} + +const getConnectFrame = (page: Page) => { + const frame = page.frame({ + url: process.env.CONNECT_IFRAME_URL, + }) + + invariant(frame != null, 'Connect iframe not found') + + return frame +} + +const getLibraryCode = () => { + if (web3Content.current == null) { + web3Content.current = readFileSync( + fileURLToPath( + import.meta.resolve('@depay/web3-mock/dist/umd/index.bundle.js'), + ), + 'utf-8', + ) + } + + return web3Content.current +} diff --git a/packages/test-utils/src/e2e/waitFor.ts b/packages/test-utils/src/e2e/waitFor.ts new file mode 100644 index 000000000..bf78f5b6e --- /dev/null +++ b/packages/test-utils/src/e2e/waitFor.ts @@ -0,0 +1,21 @@ +type Fn = () => T + +export const waitFor = (fn: Fn): Promise => { + return new Promise((resolve, reject) => { + const timeout = setTimeout(reject, 5000) + + const waitFn = () => { + try { + const result = fn() + + clearTimeout(timeout) + + resolve(result) + } catch { + setTimeout(waitFn, 1) + } + } + + waitFn() + }) +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f14bfa3be..e0f2b1382 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -149,6 +149,9 @@ importers: '@hiogawa/vite-node-miniflare': specifier: 0.1.1 version: 0.1.1(bufferutil@4.0.9)(utf-8-validate@5.0.10)(vite@6.0.7(@types/node@22.10.7)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(sass@1.82.0)(stylus@0.62.0)(yaml@2.7.0)) + '@playwright/test': + specifier: ^1.48.1 + version: 1.49.1 '@react-router/dev': specifier: ^7.1.1 version: 7.1.2(@react-router/serve@7.1.2(react-router@7.1.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(typescript@5.7.3))(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(react-router@7.1.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(sass@1.82.0)(stylus@0.62.0)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.7)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(sass@1.82.0)(stylus@0.62.0)(yaml@2.7.0))(wrangler@3.103.1(@cloudflare/workers-types@4.20250109.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10))(yaml@2.7.0) @@ -188,6 +191,9 @@ importers: autoprefixer: specifier: ^10.4.20 version: 10.4.20(postcss@8.5.1) + dotenv: + specifier: ^16.0.1 + version: 16.4.7 eslint: specifier: ^9.7.0 version: 9.18.0(jiti@2.4.1) @@ -794,9 +800,15 @@ importers: packages/test-utils: dependencies: + '@depay/web3-mock': + specifier: ^14.19.1 + version: 14.19.1(bufferutil@4.0.9)(utf-8-validate@5.0.10) '@epic-web/invariant': specifier: ^1.0.0 version: 1.0.0 + '@playwright/test': + specifier: ^1.48.1 + version: 1.49.1 '@testing-library/react': specifier: ^16.0.1 version: 16.2.0(@testing-library/dom@10.4.0)(@types/react-dom@19.0.3(@types/react@19.0.7))(@types/react@19.0.7)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) @@ -821,7 +833,7 @@ importers: devDependencies: '@react-router/dev': specifier: ^7.1.1 - version: 7.1.2(@react-router/serve@7.1.2(react-router@7.1.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(typescript@5.7.3))(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(react-router@7.1.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(sass@1.82.0)(stylus@0.62.0)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.7)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(sass@1.82.0)(stylus@0.62.0)(yaml@2.7.0))(wrangler@3.103.1(@cloudflare/workers-types@4.20250109.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10))(yaml@2.7.0) + version: 7.1.2(@react-router/serve@7.1.2(react-router@7.1.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(typescript@5.7.3))(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(react-router@7.1.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(sass@1.82.0)(stylus@0.62.0)(typescript@5.7.3)(vite@5.4.11(@types/node@22.10.7)(less@4.2.1)(lightningcss@1.28.2)(sass@1.82.0)(stylus@0.62.0))(wrangler@3.103.1(@cloudflare/workers-types@4.20250109.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10))(yaml@2.7.0) '@types/chrome': specifier: ^0.0.297 version: 0.0.297 @@ -10013,6 +10025,59 @@ snapshots: clsx: 2.1.1 react: 19.0.0 + '@react-router/dev@7.1.2(@react-router/serve@7.1.2(react-router@7.1.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(typescript@5.7.3))(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(react-router@7.1.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(sass@1.82.0)(stylus@0.62.0)(typescript@5.7.3)(vite@5.4.11(@types/node@22.10.7)(less@4.2.1)(lightningcss@1.28.2)(sass@1.82.0)(stylus@0.62.0))(wrangler@3.103.1(@cloudflare/workers-types@4.20250109.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10))(yaml@2.7.0)': + dependencies: + '@babel/core': 7.26.0 + '@babel/generator': 7.26.5 + '@babel/parser': 7.26.5 + '@babel/plugin-syntax-decorators': 7.25.9(@babel/core@7.26.0) + '@babel/plugin-syntax-jsx': 7.25.9(@babel/core@7.26.0) + '@babel/preset-typescript': 7.26.0(@babel/core@7.26.0) + '@babel/traverse': 7.26.5 + '@babel/types': 7.26.5 + '@npmcli/package-json': 4.0.1 + '@react-router/node': 7.1.2(react-router@7.1.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(typescript@5.7.3) + arg: 5.0.2 + babel-dead-code-elimination: 1.0.8 + chokidar: 4.0.3 + dedent: 1.5.3(babel-plugin-macros@3.1.0) + es-module-lexer: 1.6.0 + exit-hook: 2.2.1 + fs-extra: 10.1.0 + gunzip-maybe: 1.4.2 + jsesc: 3.0.2 + lodash: 4.17.21 + pathe: 1.1.2 + picocolors: 1.1.1 + picomatch: 2.3.1 + prettier: 2.8.8 + react-refresh: 0.14.2 + react-router: 7.1.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + semver: 7.6.3 + set-cookie-parser: 2.7.1 + valibot: 0.41.0(typescript@5.7.3) + vite: 5.4.11(@types/node@22.10.7)(less@4.2.1)(lightningcss@1.28.2)(sass@1.82.0)(stylus@0.62.0) + vite-node: 3.0.0-beta.2(@types/node@22.10.7)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(sass@1.82.0)(stylus@0.62.0)(yaml@2.7.0) + optionalDependencies: + '@react-router/serve': 7.1.2(react-router@7.1.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(typescript@5.7.3) + typescript: 5.7.3 + wrangler: 3.103.1(@cloudflare/workers-types@4.20250109.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10) + transitivePeerDependencies: + - '@types/node' + - babel-plugin-macros + - bluebird + - jiti + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + '@react-router/dev@7.1.2(@react-router/serve@7.1.2(react-router@7.1.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(typescript@5.7.3))(@types/node@22.10.7)(babel-plugin-macros@3.1.0)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(react-router@7.1.2(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(sass@1.82.0)(stylus@0.62.0)(typescript@5.7.3)(vite@6.0.7(@types/node@22.10.7)(jiti@2.4.1)(less@4.2.1)(lightningcss@1.28.2)(sass@1.82.0)(stylus@0.62.0)(yaml@2.7.0))(wrangler@3.103.1(@cloudflare/workers-types@4.20250109.0)(bufferutil@4.0.9)(utf-8-validate@5.0.10))(yaml@2.7.0)': dependencies: '@babel/core': 7.26.0 From c7c5e413af8942c43ade38662a1f7e26f4ed9d8f Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 13:40:01 +0100 Subject: [PATCH 02/18] globally ignore playwright output --- .gitignore | 6 +++++- deployables/app/e2e/connectWallet.ts | 3 ++- deployables/extension/.gitignore | 3 --- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index dc8d0a1f8..5277c1112 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,8 @@ coverage .turbo .env -*.log \ No newline at end of file +*.log + +playwright/.cache/ +playwright-report/ +test-results/ \ No newline at end of file diff --git a/deployables/app/e2e/connectWallet.ts b/deployables/app/e2e/connectWallet.ts index ff76e416e..c4d286fc5 100644 --- a/deployables/app/e2e/connectWallet.ts +++ b/deployables/app/e2e/connectWallet.ts @@ -5,7 +5,8 @@ export const connectWallet = async ( page: Page, account: `0x${string}` = defaultMockAccount, ) => { - await page.getByRole('button', { name: 'Connect with MetaMask' }).click() + await page.getByRole('button', { name: 'Connect wallet' }).click() + await page.getByRole('button', { name: 'MetaMask' }).click() await expect( page.getByRole('textbox', { name: 'Pilot Account' }), ).toHaveValue(account) diff --git a/deployables/extension/.gitignore b/deployables/extension/.gitignore index 2bd8ac9d1..c36e2cfad 100644 --- a/deployables/extension/.gitignore +++ b/deployables/extension/.gitignore @@ -3,9 +3,6 @@ public/manifest.json zodiac-pilot.zip -/test-results/ -/playwright-report/ /blob-report/ -/playwright/.cache/ walletconnect.db \ No newline at end of file From 18e63f0e9c76548c39cee382dd932fae66c02c48 Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 13:46:43 +0100 Subject: [PATCH 03/18] make some adjustments to tests --- .../app/e2e/accountHandling/lockedAccount.spec.ts | 12 ++++++------ .../e2e/accountHandling/unavailableWallet.spec.ts | 4 ++-- .../app/e2e/accountHandling/wrongChain.spec.ts | 6 ++++-- deployables/app/e2e/connectWallet.ts | 2 +- packages/test-utils/src/e2e/mockWeb3.ts | 4 ++++ 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/deployables/app/e2e/accountHandling/lockedAccount.spec.ts b/deployables/app/e2e/accountHandling/lockedAccount.spec.ts index 703177ba3..9d20a01e4 100644 --- a/deployables/app/e2e/accountHandling/lockedAccount.spec.ts +++ b/deployables/app/e2e/accountHandling/lockedAccount.spec.ts @@ -6,10 +6,10 @@ test.describe('Locked account', () => { const account = '0x1000000000000000000000000000000000000000' test('handles wallet disconnect gracefully', async ({ page }) => { - await page.goto('/new-route') - const { lockWallet } = await mockWeb3(page) + await page.goto('/new-route') + await connectWallet(page) await lockWallet() @@ -19,12 +19,12 @@ test.describe('Locked account', () => { }) test('it is possible to reconnect an account', async ({ page }) => { - await page.goto('/new-route') - const { lockWallet } = await mockWeb3(page, { accounts: [account], }) + await page.goto('/new-route') + await connectWallet(page, account) await lockWallet() @@ -36,10 +36,10 @@ test.describe('Locked account', () => { }) test('it is possible to disconnect a locked account', async ({ page }) => { - await page.goto('/new-route') - const { lockWallet } = await mockWeb3(page) + await page.goto('/new-route') + await connectWallet(page) await lockWallet() diff --git a/deployables/app/e2e/accountHandling/unavailableWallet.spec.ts b/deployables/app/e2e/accountHandling/unavailableWallet.spec.ts index fa8393468..c465d0c2b 100644 --- a/deployables/app/e2e/accountHandling/unavailableWallet.spec.ts +++ b/deployables/app/e2e/accountHandling/unavailableWallet.spec.ts @@ -4,12 +4,12 @@ import { connectWallet } from '../connectWallet' test.describe('Account unavailable', () => { test('handles unavailable accounts gracefully', async ({ page }) => { - await page.goto('/new-route') - const { loadAccounts } = await mockWeb3(page, { accounts: ['0x1000000000000000000000000000000000000000'], }) + await page.goto('/new-route') + await connectWallet(page, '0x1000000000000000000000000000000000000000') await loadAccounts(['0x2000000000000000000000000000000000000000']) diff --git a/deployables/app/e2e/accountHandling/wrongChain.spec.ts b/deployables/app/e2e/accountHandling/wrongChain.spec.ts index 2add645b0..b164a7ecd 100644 --- a/deployables/app/e2e/accountHandling/wrongChain.spec.ts +++ b/deployables/app/e2e/accountHandling/wrongChain.spec.ts @@ -4,10 +4,10 @@ import { connectWallet } from '../connectWallet' test.describe('Wrong chain selected', () => { test('it is possible to switch to the correct chain', async ({ page }) => { - await page.goto('/new-route') - const { switchChain } = await mockWeb3(page) + await page.goto('/new-route') + await connectWallet(page) await switchChain(10) @@ -21,6 +21,8 @@ test.describe('Wrong chain selected', () => { }) => { const { switchChain } = await mockWeb3(page) + await page.goto('/new-route') + await connectWallet(page) await switchChain(10) diff --git a/deployables/app/e2e/connectWallet.ts b/deployables/app/e2e/connectWallet.ts index c4d286fc5..ee6afb6cc 100644 --- a/deployables/app/e2e/connectWallet.ts +++ b/deployables/app/e2e/connectWallet.ts @@ -6,7 +6,7 @@ export const connectWallet = async ( account: `0x${string}` = defaultMockAccount, ) => { await page.getByRole('button', { name: 'Connect wallet' }).click() - await page.getByRole('button', { name: 'MetaMask' }).click() + await page.getByRole('button', { name: 'Browser Wallet' }).click() await expect( page.getByRole('textbox', { name: 'Pilot Account' }), ).toHaveValue(account) diff --git a/packages/test-utils/src/e2e/mockWeb3.ts b/packages/test-utils/src/e2e/mockWeb3.ts index 28c523452..5656ab3d9 100644 --- a/packages/test-utils/src/e2e/mockWeb3.ts +++ b/packages/test-utils/src/e2e/mockWeb3.ts @@ -54,6 +54,10 @@ export const mockWeb3 = async ( } const getConnectFrame = (page: Page) => { + if (process.env.CONNECT_IFRAME_URL == null) { + return page + } + const frame = page.frame({ url: process.env.CONNECT_IFRAME_URL, }) From da9ec8748b4cbd999cbcfd1d8b58fa26a9a34c7d Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 13:49:50 +0100 Subject: [PATCH 04/18] run app e2e tests --- .github/workflows/app-preview.yaml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/app-preview.yaml b/.github/workflows/app-preview.yaml index 35b084273..dafa63e96 100644 --- a/.github/workflows/app-preview.yaml +++ b/.github/workflows/app-preview.yaml @@ -1,4 +1,4 @@ -name: Pilot App +name: Companion App on: pull_request: @@ -10,7 +10,7 @@ defaults: jobs: deploy: runs-on: ubuntu-latest - name: Deploy + name: Deploy & Test steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 @@ -19,12 +19,33 @@ jobs: node-version: latest cache: 'pnpm' cache-dependency-path: '**/pnpm-lock.yaml' + - run: pnpm install --prefer-offline + - run: pnpm build + - name: Deploy + id: deploy uses: cloudflare/wrangler-action@v3.13.1 with: workingDirectory: deployables/app apiToken: ${{ secrets.CF_API_TOKEN }} accountId: ${{ secrets.CF_ACCOUNT_ID }} command: versions upload + + - name: Install Playwright Browsers + run: pnpm playwright install --with-deps chromium + + - name: Run Playwright tests + run: xvfb-run pnpm playwright test + env: + PLAYWRIGHT_TEST_BASE_URL: ${{ steps.deploy.outputs.deployment-url }} + VERCEL_PROTECTION_BYPASS: ${{ secrets.VERCEL_PROTECTION_BYPASS }} + PW_CHROMIUM_ATTACH_TO_OTHER: 1 + + - uses: actions/upload-artifact@v4 + if: ${{ !cancelled() }} + with: + name: playwright-report + path: playwright-report/ + retention-days: 30 From 24809f293460e54e906cb2891ceca33ba8bbd69d Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 13:53:46 +0100 Subject: [PATCH 05/18] adjust commands --- .github/workflows/app-preview.yaml | 2 -- .github/workflows/tests.yaml | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/app-preview.yaml b/.github/workflows/app-preview.yaml index dafa63e96..a44b067d2 100644 --- a/.github/workflows/app-preview.yaml +++ b/.github/workflows/app-preview.yaml @@ -40,8 +40,6 @@ jobs: run: xvfb-run pnpm playwright test env: PLAYWRIGHT_TEST_BASE_URL: ${{ steps.deploy.outputs.deployment-url }} - VERCEL_PROTECTION_BYPASS: ${{ secrets.VERCEL_PROTECTION_BYPASS }} - PW_CHROMIUM_ATTACH_TO_OTHER: 1 - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d00d2e3ec..e76dff9cc 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -23,7 +23,7 @@ jobs: cache: 'pnpm' cache-dependency-path: '**/pnpm-lock.yaml' - run: pnpm install --prefer-offline - - run: pnpm test:unit + - run: pnpm test - name: 'Report Coverage' # Set if: always() to also generate the report if tests are failing # Only works if you set `reportOnFailure: true` in your vite config as specified above From d1053e873ebcd085992c5fa9e19305d8e8509cc2 Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 13:55:31 +0100 Subject: [PATCH 06/18] change default working directory --- .github/workflows/app-preview.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/app-preview.yaml b/.github/workflows/app-preview.yaml index a44b067d2..33a921d87 100644 --- a/.github/workflows/app-preview.yaml +++ b/.github/workflows/app-preview.yaml @@ -11,6 +11,9 @@ jobs: deploy: runs-on: ubuntu-latest name: Deploy & Test + defaults: + run: + working-directory: ./deployables/app steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 From 13e9989280b030088e68f532ba7754608dfe0f94 Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 13:59:07 +0100 Subject: [PATCH 07/18] add type import --- deployables/app/e2e/connectWallet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployables/app/e2e/connectWallet.ts b/deployables/app/e2e/connectWallet.ts index ee6afb6cc..b0d49879f 100644 --- a/deployables/app/e2e/connectWallet.ts +++ b/deployables/app/e2e/connectWallet.ts @@ -1,4 +1,4 @@ -import { expect, Page } from '@playwright/test' +import { expect, type Page } from '@playwright/test' import { defaultMockAccount } from '@zodiac/test-utils/e2e' export const connectWallet = async ( From 51ea55f3fc08ecc2499e6d5b9d1e6e95c8e6b264 Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 15:34:35 +0100 Subject: [PATCH 08/18] hacky way to get the deployment url --- .github/workflows/app-preview.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/app-preview.yaml b/.github/workflows/app-preview.yaml index 33a921d87..7867a937a 100644 --- a/.github/workflows/app-preview.yaml +++ b/.github/workflows/app-preview.yaml @@ -36,13 +36,23 @@ jobs: accountId: ${{ secrets.CF_ACCOUNT_ID }} command: versions upload + # If you think this sucks, you are right. + # Check https://github.com/cloudflare/wrangler-action/issues/343 + # and we can just use the deployment-url output of + # the deploy action + - uses: actions-ecosystem/action-regex-match@v2 + id: regex + with: + text: ${{ steps.deploy.outputs.deployment-url }} + regex: https?:\/\/[a-zA-Z0-9-./]+ + - name: Install Playwright Browsers run: pnpm playwright install --with-deps chromium - name: Run Playwright tests run: xvfb-run pnpm playwright test env: - PLAYWRIGHT_TEST_BASE_URL: ${{ steps.deploy.outputs.deployment-url }} + PLAYWRIGHT_TEST_BASE_URL: ${{ steps.regex.outputs.group1 }} - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} From 235d3ed328ef7ee2a1da6462c08509dde47e7c1f Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 15:35:23 +0100 Subject: [PATCH 09/18] use correct output field --- .github/workflows/app-preview.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app-preview.yaml b/.github/workflows/app-preview.yaml index 7867a937a..8cac0bb32 100644 --- a/.github/workflows/app-preview.yaml +++ b/.github/workflows/app-preview.yaml @@ -43,7 +43,7 @@ jobs: - uses: actions-ecosystem/action-regex-match@v2 id: regex with: - text: ${{ steps.deploy.outputs.deployment-url }} + text: ${{ steps.deploy.outputs.command-output }} regex: https?:\/\/[a-zA-Z0-9-./]+ - name: Install Playwright Browsers From 6621e0d8f204cf612d1008f8dbeaaa5c1a704feb Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 15:41:48 +0100 Subject: [PATCH 10/18] use explicit string --- .github/workflows/app-preview.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app-preview.yaml b/.github/workflows/app-preview.yaml index 8cac0bb32..73550fb00 100644 --- a/.github/workflows/app-preview.yaml +++ b/.github/workflows/app-preview.yaml @@ -44,7 +44,7 @@ jobs: id: regex with: text: ${{ steps.deploy.outputs.command-output }} - regex: https?:\/\/[a-zA-Z0-9-./]+ + regex: "https?:\/\/[a-zA-Z0-9-./]+" - name: Install Playwright Browsers run: pnpm playwright install --with-deps chromium From e4a9d20732a77088d324788aedca01834067e609 Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 15:43:14 +0100 Subject: [PATCH 11/18] reduce test flakiness --- deployables/app/app/routes/edit-route.$data.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deployables/app/app/routes/edit-route.$data.spec.ts b/deployables/app/app/routes/edit-route.$data.spec.ts index 013e03b3b..c4bbdaf7e 100644 --- a/deployables/app/app/routes/edit-route.$data.spec.ts +++ b/deployables/app/app/routes/edit-route.$data.spec.ts @@ -432,7 +432,7 @@ describe('Edit route', () => { const roleId = randomAddress() await userEvent.type( - screen.getByRole('textbox', { name: 'Role ID' }), + await screen.findByRole('textbox', { name: 'Role ID' }), roleId, ) @@ -520,9 +520,9 @@ describe('Edit route', () => { await render(`/edit-route/${btoa(JSON.stringify(route))}`) - expect(screen.getByRole('textbox', { name: 'Role Key' })).toHaveValue( - 'TEST-KEY', - ) + expect( + await screen.findByRole('textbox', { name: 'Role Key' }), + ).toHaveValue('TEST-KEY') }) it('is possible to update the role key', async () => { From 5c2afc88bb9d30226e7a158df22e5510ba2d5d11 Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 15:47:25 +0100 Subject: [PATCH 12/18] fix yaml.. maybe... --- .github/workflows/app-preview.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app-preview.yaml b/.github/workflows/app-preview.yaml index 73550fb00..0ec7b268e 100644 --- a/.github/workflows/app-preview.yaml +++ b/.github/workflows/app-preview.yaml @@ -44,7 +44,7 @@ jobs: id: regex with: text: ${{ steps.deploy.outputs.command-output }} - regex: "https?:\/\/[a-zA-Z0-9-./]+" + regex: 'https?:\/\/[a-zA-Z0-9-./]+' - name: Install Playwright Browsers run: pnpm playwright install --with-deps chromium From 3f761e2a7b6a28e8ecd33702dcf853f0bdb0deae Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 15:52:17 +0100 Subject: [PATCH 13/18] maybe fix regex --- .github/workflows/app-preview.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app-preview.yaml b/.github/workflows/app-preview.yaml index 0ec7b268e..a4e03c65e 100644 --- a/.github/workflows/app-preview.yaml +++ b/.github/workflows/app-preview.yaml @@ -44,7 +44,7 @@ jobs: id: regex with: text: ${{ steps.deploy.outputs.command-output }} - regex: 'https?:\/\/[a-zA-Z0-9-./]+' + regex: 'https?:\/\/[a-zA-Z0-9-.\/]+' - name: Install Playwright Browsers run: pnpm playwright install --with-deps chromium From 2cfe88f3474743c179b1bde68f4d38847d15b07e Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 15:59:29 +0100 Subject: [PATCH 14/18] try newer action --- .github/workflows/app-preview.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app-preview.yaml b/.github/workflows/app-preview.yaml index a4e03c65e..4ebc8ad42 100644 --- a/.github/workflows/app-preview.yaml +++ b/.github/workflows/app-preview.yaml @@ -40,7 +40,7 @@ jobs: # Check https://github.com/cloudflare/wrangler-action/issues/343 # and we can just use the deployment-url output of # the deploy action - - uses: actions-ecosystem/action-regex-match@v2 + - uses: kaisugi/action-regex-match@v1.0.1 id: regex with: text: ${{ steps.deploy.outputs.command-output }} From e0f601af3d6f018acb06eb342983ba14ab6e74ca Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 16:03:44 +0100 Subject: [PATCH 15/18] simplify regex --- .github/workflows/app-preview.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app-preview.yaml b/.github/workflows/app-preview.yaml index 4ebc8ad42..7169734a1 100644 --- a/.github/workflows/app-preview.yaml +++ b/.github/workflows/app-preview.yaml @@ -44,7 +44,7 @@ jobs: id: regex with: text: ${{ steps.deploy.outputs.command-output }} - regex: 'https?:\/\/[a-zA-Z0-9-.\/]+' + regex: 'https:\/\/.+\.gnosisguild\.workers\.dev' - name: Install Playwright Browsers run: pnpm playwright install --with-deps chromium From 37e091572accc1f4d90830faf085542f3698cfe1 Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 16:05:31 +0100 Subject: [PATCH 16/18] use match --- .github/workflows/app-preview.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app-preview.yaml b/.github/workflows/app-preview.yaml index 7169734a1..9da150e54 100644 --- a/.github/workflows/app-preview.yaml +++ b/.github/workflows/app-preview.yaml @@ -52,7 +52,7 @@ jobs: - name: Run Playwright tests run: xvfb-run pnpm playwright test env: - PLAYWRIGHT_TEST_BASE_URL: ${{ steps.regex.outputs.group1 }} + PLAYWRIGHT_TEST_BASE_URL: ${{ steps.regex.outputs.match }} - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} From be200d5123a2316459e5a4c825849814d448015a Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 17:13:25 +0100 Subject: [PATCH 17/18] remove console log --- deployables/app/app/routes/edit-route.$data.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/deployables/app/app/routes/edit-route.$data.tsx b/deployables/app/app/routes/edit-route.$data.tsx index fce193437..a6eb55bd8 100644 --- a/deployables/app/app/routes/edit-route.$data.tsx +++ b/deployables/app/app/routes/edit-route.$data.tsx @@ -127,8 +127,6 @@ export const clientAction = async ({ const chainId = verifyChainId(getInt(data, 'chainId')) const providerType = verifyProviderType(getInt(data, 'providerType')) - console.log({ account, chainId, providerType }) - return editRoute( request.url, updatePilotAddress( From 3a589dd386c398baa1aedec5a80fed232c99561a Mon Sep 17 00:00:00 2001 From: Philipp Giese Date: Fri, 17 Jan 2025 17:18:49 +0100 Subject: [PATCH 18/18] fix wrong assertion --- deployables/app/e2e/accountHandling/lockedAccount.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployables/app/e2e/accountHandling/lockedAccount.spec.ts b/deployables/app/e2e/accountHandling/lockedAccount.spec.ts index 9d20a01e4..ae2320804 100644 --- a/deployables/app/e2e/accountHandling/lockedAccount.spec.ts +++ b/deployables/app/e2e/accountHandling/lockedAccount.spec.ts @@ -46,7 +46,7 @@ test.describe('Locked account', () => { await page.getByRole('button', { name: 'Disconnect' }).click() await expect( - page.getByRole('button', { name: 'Connect with MetaMask' }), + page.getByRole('button', { name: 'Connect wallet' }), ).toBeInViewport() }) })