Aller au contenu
verdict:

Playwright 1.60.0

featured

note: la synthèse et les notes de version sont en anglais

note: pas de synthèse pour cette release plus ancienne

Nous synthétisons les releases récentes. Les notes de version originales de cette version sont ci-dessous.

release-notesgithub.com/microsoft/playwright · 93 lignes
  1. ## 🌐 HAR recording on Tracing
  2. [tracing.startHar()](https://playwright.dev/docs/api/class-tracing#tracing-start-har) / [tracing.stopHar()](https://playwright.dev/docs/api/class-tracing#tracing-stop-har) expose HAR recording as a first-class tracing API, with the same `content`, `mode` and `urlFilter` options as `recordHar`. The returned [Disposable](https://playwright.dev/docs/api/class-disposable) makes it easy to scope a recording with `await using`:
  3. ```js
  4. await using har = await context.tracing.startHar('trace.har');
  5. const page = await context.newPage();
  6. await page.goto('https://playwright.dev');
  7. // HAR is finalized when `har` goes out of scope.
  8. ```
  9. ## 🪝 Drop API
  10. New [locator.drop()](https://playwright.dev/docs/api/class-locator#locator-drop) simulates an external drag-and-drop of files or clipboard-like data onto an element. Playwright dispatches `dragenter`, `dragover`, and `drop` with a synthetic [DataTransfer] in the page context — works cross-browser and is great for testing upload zones:
  11. ```js
  12. await page.locator('#dropzone').drop({
  13. files: { name: 'note.txt', mimeType: 'text/plain', buffer: Buffer.from('hello') },
  14. });
  15. await page.locator('#dropzone').drop({
  16. data: {
  17. 'text/plain': 'hello world',
  18. 'text/uri-list': 'https://example.com',
  19. },
  20. });
  21. ```
  22. ## 🎯 Aria snapshots
  23. - [expect(page).toMatchAriaSnapshot()](https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-match-aria-snapshot) now works on a [Page](https://playwright.dev/docs/api/class-page), in addition to a [Locator](https://playwright.dev/docs/api/class-locator) — equivalent to asserting against `page.locator('body')`.
  24. - New `boxes` option on [locator.ariaSnapshot()](https://playwright.dev/docs/api/class-locator#locator-aria-snapshot) / [page.ariaSnapshot()](https://playwright.dev/docs/api/class-page#page-aria-snapshot) appends each element's bounding box as `[box=x,y,width,height]`, useful for AI consumption.
  25. ## 🛑 test.abort()
  26. New [test.abort()](https://playwright.dev/docs/api/class-test#test-abort) aborts the currently running test from a fixture, hook, or route handler with an optional message. Use it when you have detected an unrecoverable misuse and want to fail the test right away:
  27. ```js
  28. test('does not publish to the shared page', async ({ page }) => {
  29. await page.route('**/publish', route => {
  30. test.abort('Tests must not publish to the shared page. Use the `clone` option.');
  31. return route.abort();
  32. });
  33. // ...
  34. });
  35. ```
  36. ## New APIs
  37. ### Browser, Context and Page
  38. - Event [browser.on('context')](https://playwright.dev/docs/api/class-browser#browser-event-context) — fired when a new context is created on the browser.
  39. - [BrowserContext](https://playwright.dev/docs/api/class-browsercontext) now mirrors lifecycle events from its pages: [browserContext.on('download')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-download), [browserContext.on('frameattached')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-frame-attached), [browserContext.on('framedetached')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-frame-detached), [browserContext.on('framenavigated')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-frame-navigated), [browserContext.on('pageclose')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-page-close), [browserContext.on('pageload')](https://playwright.dev/docs/api/class-browsercontext#browser-context-event-page-load).
  40. ### Locators and Assertions
  41. - New option `description` in [page.getByRole()](https://playwright.dev/docs/api/class-page#page-get-by-role) / [locator.getByRole()](https://playwright.dev/docs/api/class-locator#locator-get-by-role) / [frame.getByRole()](https://playwright.dev/docs/api/class-frame#frame-get-by-role) / [frameLocator.getByRole()](https://playwright.dev/docs/api/class-framelocator#frame-locator-get-by-role) for matching the [accessible description](https://www.w3.org/TR/wai-aria-1.2/#dfn-accessible-description).
  42. - New option `pseudo` in [expect(locator).toHaveCSS()](https://playwright.dev/docs/api/class-locatorassertions#locator-assertions-to-have-css) reads computed styles from `::before` or `::after`.
  43. - New option `style` in [locator.highlight()](https://playwright.dev/docs/api/class-locator#locator-highlight) applies extra inline CSS to the highlight overlay, plus new [page.hideHighlight()](https://playwright.dev/docs/api/class-page#page-hide-highlight) to clear all highlights.
  44. ### Network
  45. - [webSocketRoute.protocols()](https://playwright.dev/docs/api/class-websocketroute#web-socket-route-protocols) returns the WebSocket subprotocols requested by the page.
  46. - New option `noDefaults` in [browserType.connectOverCDP()](https://playwright.dev/docs/api/class-browsertype#browser-type-connect-over-cdp) disables Playwright's default overrides on the default context (download behavior, focus emulation, media emulation), so attaching to a user's daily-driver browser doesn't disturb its state.
  47. ### Errors and Reporting
  48. - New [webError.location()](https://playwright.dev/docs/api/class-weberror#web-error-location) mirrors [consoleMessage.location()](https://playwright.dev/docs/api/class-consolemessage#console-message-location).
  49. - [consoleMessage.location()](https://playwright.dev/docs/api/class-consolemessage#console-message-location) now exposes `line` / `column` properties (`lineNumber` / `columnNumber` are deprecated).
  50. - New [testInfoError.errorContext](https://playwright.dev/docs/api/class-testinfoerror#test-info-error-error-context) surfaces additional diagnostic context, such as the aria snapshot of the receiver at the time of an `expect(...)` matcher failure.
  51. - [reporter.onError()](https://playwright.dev/docs/api/class-reporter#reporter-on-error) now receives a `workerInfo` argument with details about the worker for fixture teardown errors.
  52. ### Test runner
  53. - New `{testFileBaseName}` token in [testProject.snapshotPathTemplate](https://playwright.dev/docs/api/class-testproject#test-project-snapshot-path-template) — file name without extension.
  54. - Test runner now errors when a config tries to override a non-option fixture, and rejects `workers: 0` or negative values.
  55. ## 🛠️ Other improvements
  56. - HTML reporter:
  57. - `npx playwright show-report` accepts `.zip` files directly — no need to unzip first.
  58. - Steps that contain attachments inside nested children show an indicator on the parent step.
  59. - The `repeatEachIndex` is shown in the test header when non-zero.
  60. - Trace Viewer adds a pretty-print toggle for JSON / form request and response bodies in the network details panel.
  61. ## Breaking Changes ⚠️
  62. - Removed long-deprecated APIs:
  63. - `Locator.ariaRef()` — use the standard [locator.ariaSnapshot()](https://playwright.dev/docs/api/class-locator#locator-aria-snapshot) pipeline.
  64. - `handle` option on `BrowserContext.exposeBinding` and `Page.exposeBinding`.
  65. - `logger` option on `BrowserType.connect` and `BrowserType.connectOverCDP` — use [tracing](https://playwright.dev/docs/trace-viewer) instead.
  66. - Context options `videosPath` / `videoSize` — use `recordVideo` instead.
  67. ## Browser Versions
  68. - Chromium 148.0.7778.96
  69. - Mozilla Firefox 150.0.2
  70. - WebKit 26.4
  71. This version was also tested against the following stable channels:
  72. - Google Chrome 147
  73. - Microsoft Edge 147

voir sur githubimported 2026-09-28 via npm