diff --git a/docs/guide/browser/trace-view.md b/docs/guide/browser/trace-view.md index 4a82a8134aaf..e54a7a42788b 100644 --- a/docs/guide/browser/trace-view.md +++ b/docs/guide/browser/trace-view.md @@ -126,9 +126,3 @@ Under the hood, Playwright still records its own low-level action events as usua Keep in mind that plain assertions like `expect(value).toBe(...)` run in Node, not the browser, so they won't show up in the trace. For anything not covered automatically, you can use `page.mark()` or `locator.mark()` to add your own trace groups — see [Trace markers](#trace-markers) above. - -::: warning - -Currently a source view of a trace can be only displayed properly when viewing it on the machine generated a trace with `playwright show-trace` CLI. This is expected to be fixed soon (see https://github.com/microsoft/playwright/pull/39307). - -::: diff --git a/examples/lit/package.json b/examples/lit/package.json index 833fccf70f7d..3641127b636b 100644 --- a/examples/lit/package.json +++ b/examples/lit/package.json @@ -19,7 +19,7 @@ "devDependencies": { "@vitest/browser-playwright": "latest", "jsdom": "latest", - "playwright": "^1.58.2", + "playwright": "^1.59.0", "vite": "latest", "vitest": "latest" }, diff --git a/package.json b/package.json index 2f103ddf59ce..9fe39ba13532 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "devDependencies": { "@antfu/eslint-config": "^7.6.1", "@antfu/ni": "^28.3.0", - "@playwright/test": "^1.58.2", + "@playwright/test": "catalog:", "@rollup/plugin-commonjs": "^29.0.2", "@rollup/plugin-json": "^6.1.0", "@rollup/plugin-node-resolve": "^16.0.3", diff --git a/packages/browser-playwright/package.json b/packages/browser-playwright/package.json index 828071749227..80fde84c8787 100644 --- a/packages/browser-playwright/package.json +++ b/packages/browser-playwright/package.json @@ -59,7 +59,7 @@ "tinyrainbow": "catalog:" }, "devDependencies": { - "playwright": "^1.58.2", + "playwright": "catalog:", "vitest": "workspace:*" } } diff --git a/packages/utils/src/source-map.ts b/packages/utils/src/source-map.ts index d4577887ccb1..738a13cf3f0f 100644 --- a/packages/utils/src/source-map.ts +++ b/packages/utils/src/source-map.ts @@ -233,7 +233,13 @@ export function parseStacktrace( : parseV8Stacktrace(stack) // remove assertion helper's internal stacks - const helperIndex = stacks.findLastIndex(s => s.method === '__VITEST_HELPER__' || s.method === 'async*__VITEST_HELPER__') + const helperIndex = stacks.findLastIndex(s => + s.method === '__VITEST_HELPER__' + // firefox + || s.method === 'async*__VITEST_HELPER__' + // webkit + || s.method === 'async __VITEST_HELPER__', + ) if (helperIndex >= 0) { stacks = stacks.slice(helperIndex + 1) } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 72bd5b39d5d8..ff3e04afcd76 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,6 +27,9 @@ catalogs: '@jridgewell/trace-mapping': specifier: 0.3.31 version: 0.3.31 + '@playwright/test': + specifier: ^1.59.0 + version: 1.59.0 '@rolldown/plugin-babel': specifier: ^0.2.1 version: 0.2.1 @@ -106,8 +109,8 @@ catalogs: specifier: ^2.0.3 version: 2.0.3 playwright: - specifier: ^1.58.2 - version: 1.58.2 + specifier: ^1.59.0 + version: 1.59.0 sinon: specifier: ^21.0.3 version: 21.0.3 @@ -198,8 +201,8 @@ importers: specifier: ^28.3.0 version: 28.3.0 '@playwright/test': - specifier: ^1.58.2 - version: 1.58.2 + specifier: 'catalog:' + version: 1.59.0 '@rollup/plugin-commonjs': specifier: ^29.0.2 version: 29.0.2(rollup@4.59.0) @@ -407,8 +410,8 @@ importers: specifier: latest version: 29.0.1(@noble/hashes@1.8.0) playwright: - specifier: ^1.58.2 - version: 1.58.2 + specifier: ^1.59.0 + version: 1.59.0 vite: specifier: 7.1.5 version: 7.1.5(@types/node@24.12.0)(jiti@2.6.1)(lightningcss@1.31.1)(sass-embedded@1.97.3)(sass@1.97.3)(terser@5.44.1)(tsx@4.21.0)(yaml@2.8.2) @@ -589,8 +592,8 @@ importers: version: 3.1.0 devDependencies: playwright: - specifier: ^1.58.2 - version: 1.58.2 + specifier: 'catalog:' + version: 1.59.0 vitest: specifier: workspace:* version: link:../vitest @@ -1234,8 +1237,8 @@ importers: specifier: link:./cjs-lib version: link:cjs-lib playwright: - specifier: ^1.58.2 - version: 1.58.2 + specifier: 'catalog:' + version: 1.59.0 react: specifier: ^19.2.4 version: 19.2.4 @@ -1319,7 +1322,7 @@ importers: version: 2.1.1 playwright: specifier: 'catalog:' - version: 1.58.2 + version: 1.59.0 test-dep-invalid: specifier: link:./deps/dep-invalid version: link:deps/dep-invalid @@ -4509,8 +4512,8 @@ packages: resolution: {integrity: sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} - '@playwright/test@1.58.2': - resolution: {integrity: sha512-akea+6bHYBBfA9uQqSYmlJXn61cTa+jbO87xVLCWbTqbWadRVmhxlXATaOjOgcBaWU4ePo0wB41KMFv3o35IXA==} + '@playwright/test@1.59.0': + resolution: {integrity: sha512-TOA5sTLd49rTDaZpYpvCQ9hGefHQq/OYOyCVnGqS2mjMfX+lGZv2iddIJd0I48cfxqSPttS9S3OuLKyylHcO1w==} engines: {node: '>=18'} hasBin: true @@ -8874,13 +8877,13 @@ packages: pkg-types@2.3.0: resolution: {integrity: sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==} - playwright-core@1.58.2: - resolution: {integrity: sha512-yZkEtftgwS8CsfYo7nm0KE8jsvm6i/PTgVtB8DL726wNf6H2IMsDuxCpJj59KDaxCtSnrWan2AeDqM7JBaultg==} + playwright-core@1.59.0: + resolution: {integrity: sha512-PW/X/IoZ6BMUUy8rpwHEZ8Kc0IiLIkgKYGNFaMs5KmQhcfLILNx9yCQD0rnWeWfz1PNeqcFP1BsihQhDOBCwZw==} engines: {node: '>=18'} hasBin: true - playwright@1.58.2: - resolution: {integrity: sha512-vA30H8Nvkq/cPBnNw4Q8TWz1EJyqgpuinBcHET0YVJVFldr8JDNiU9LaWAE1KqSkRYazuaBhTpB5ZzShOezQ6A==} + playwright@1.59.0: + resolution: {integrity: sha512-wihGScriusvATUxmhfENxg0tj1vHEFeIwxlnPFKQTOQVd7aG08mUfvvniRP/PtQOC+2Bs52kBOC/Up1jTXeIbw==} engines: {node: '>=18'} hasBin: true @@ -13057,9 +13060,9 @@ snapshots: '@pkgr/core@0.2.9': {} - '@playwright/test@1.58.2': + '@playwright/test@1.59.0': dependencies: - playwright: 1.58.2 + playwright: 1.59.0 '@polka/url@1.0.0-next.24': {} @@ -18123,11 +18126,11 @@ snapshots: exsolve: 1.0.7 pathe: 2.0.3 - playwright-core@1.58.2: {} + playwright-core@1.59.0: {} - playwright@1.58.2: + playwright@1.59.0: dependencies: - playwright-core: 1.58.2 + playwright-core: 1.59.0 optionalDependencies: fsevents: 2.3.2 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index c18207096e7e..7b8c9e0daf7e 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -50,6 +50,7 @@ catalog: '@iconify/vue': ^5.0.0 '@jridgewell/remapping': ^2.3.5 '@jridgewell/trace-mapping': 0.3.31 + '@playwright/test': ^1.59.0 '@rolldown/plugin-babel': ^0.2.1 '@types/chai': ^5.2.2 '@types/estree': ^1.0.8 @@ -76,7 +77,7 @@ catalog: msw: ^2.12.10 obug: ^2.1.1 pathe: ^2.0.3 - playwright: ^1.58.2 + playwright: ^1.59.0 sinon: ^21.0.3 sinon-chai: ^4.0.1 sirv: ^3.0.2 diff --git a/test/browser/docker-compose.yaml b/test/browser/docker-compose.yaml index 957372c91e09..f10812153ecc 100644 --- a/test/browser/docker-compose.yaml +++ b/test/browser/docker-compose.yaml @@ -1,7 +1,7 @@ services: playwright: - image: mcr.microsoft.com/playwright:v1.58.2-noble - command: /bin/sh -c "npx -y playwright@1.58.1 run-server --port 6677 --host 0.0.0.0" + image: mcr.microsoft.com/playwright:v1.59.0-noble + command: /bin/sh -c "npx -y playwright@1.59.0 run-server --port 6677 --host 0.0.0.0" init: true ipc: host user: pwuser @@ -15,8 +15,8 @@ services: # Run it by: # pnpm run docker up playwright-host playwright-host: - image: mcr.microsoft.com/playwright:v1.58.2-noble - command: /bin/sh -c "npx -y playwright@1.58.1 run-server --port 6677" + image: mcr.microsoft.com/playwright:v1.59.0-noble + command: /bin/sh -c "npx -y playwright@1.59.0 run-server --port 6677" init: true ipc: host user: pwuser diff --git a/test/browser/package.json b/test/browser/package.json index b8f6f1d5ac5b..ce82afe9e147 100644 --- a/test/browser/package.json +++ b/test/browser/package.json @@ -39,7 +39,7 @@ "@vitest/browser-webdriverio": "workspace:*", "@vitest/bundled-lib": "link:./bundled-lib", "@vitest/cjs-lib": "link:./cjs-lib", - "playwright": "^1.58.2", + "playwright": "catalog:", "react": "^19.2.4", "react-dom": "^19.2.4", "test-dep-error": "file:./deps/test-dep-error", diff --git a/test/browser/settings.ts b/test/browser/settings.ts index c6bb019a38f9..d8220aae83db 100644 --- a/test/browser/settings.ts +++ b/test/browser/settings.ts @@ -40,7 +40,10 @@ export const instances: BrowserInstanceOption[] = process.env.BROWSER ? [ { browser: process.env.BROWSER as any, - headless: process.env.BROWSER === 'safari' ? false : undefined, + headless: + wsEndpoint + ? true + : process.env.BROWSER === 'safari' ? false : undefined, }, ] : provider.name === 'playwright' diff --git a/test/browser/specs/assertion-helper.test.ts b/test/browser/specs/assertion-helper.test.ts index 8cc463c2be95..befd819a272c 100644 --- a/test/browser/specs/assertion-helper.test.ts +++ b/test/browser/specs/assertion-helper.test.ts @@ -35,15 +35,12 @@ test('vi.defineHelper hides internal stack traces', async () => { `) } else if (name === 'webkit') { - // async stack trace is incomplete on webkit - // waiting for https://github.com/WebKit/WebKit/pull/57832 to land on playwright - // bun has already landed https://github.com/oven-sh/bun/pull/22517 expect.soft(tree).toMatchInlineSnapshot(` { "basic.test.ts": { "async": [ "expected 'async' to deeply equal 'x' - at basic.test.ts:9:20", + at basic.test.ts:26:21", ], "soft": [ "expected 'soft' to deeply equal 'x' @@ -51,7 +48,7 @@ test('vi.defineHelper hides internal stack traces', async () => { ], "soft async": [ "expected 'soft async' to deeply equal 'x' - at basic.test.ts:18:25", + at basic.test.ts:34:25", ], "sync": [ "expected 'sync' to deeply equal 'x' diff --git a/test/browser/test/userEvent.test.ts b/test/browser/test/userEvent.test.ts index 88c692f5c62b..6e0cd6f6a80a 100644 --- a/test/browser/test/userEvent.test.ts +++ b/test/browser/test/userEvent.test.ts @@ -710,6 +710,11 @@ describe.each(inputLike)('userEvent.fill', async (getInput) => { } await userEvent.fill(input, 'Hello') + if (input.tagName === 'DIV' && server.provider === 'playwright' && server.browser === 'webkit') { + // broken since playwright 1.59.0 https://github.com/microsoft/playwright/issues/39983 + expect(value()).toBe('') + return + } expect(value()).toBe('Hello') }) })