-
Notifications
You must be signed in to change notification settings - Fork 4.9k
docs: 1.57 release notes #38267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: 1.57 release notes #38267
Changes from all commits
323e145
fbc321f
b329e72
e77a874
c53dd9e
324c92a
a93b28a
35871e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -6,6 +6,83 @@ toc_max_heading_level: 2 | |||
|
|
||||
| import LiteYouTube from '@site/src/components/LiteYouTube'; | ||||
|
|
||||
| ## Version 1.57 | ||||
|
|
||||
| ### Speedboard | ||||
|
|
||||
| In HTML reporter, there's a new tab we call "Speedboard": | ||||
|
|
||||
|  | ||||
|
|
||||
| It shows you all your executed tests sorted by slowness, | ||||
| and can help you understand where your test suite is taking longer than expected. | ||||
| Take a look at yours - maybe you'll find some tests that are spending a longer time waiting than they should! | ||||
|
|
||||
| ### Chrome for Testing | ||||
|
|
||||
| Starting with this release, Playwright switches from Chromium, to using [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing/) builds. | ||||
| Both headed and headless browsers are subject to this. | ||||
| Your tests should still be passing after upgrading to Playwright 1.57. | ||||
| We're expecting no functional changes to come from this switch - the biggest change is the new icon and title in your toolbar: | ||||
|
|
||||
|  | ||||
|
|
||||
| If you still see an unexpected behaviour change, please [file an issue](https://github.com/microsoft/playwright/issues/new). | ||||
|
|
||||
| On Arm64 Linux, Playwright continues to use Chromium. | ||||
|
|
||||
| ### Waiting for webserver output | ||||
|
|
||||
| [`property: TestConfig.webServer`] added a `wait` field. Pass a regular expression, and Playwright will wait until the webserver logs match it. | ||||
|
|
||||
| ```js | ||||
| import { defineConfig } from '@playwright/test'; | ||||
|
|
||||
| export default defineConfig({ | ||||
| webServer: { | ||||
| command: 'npm run start', | ||||
| wait: { | ||||
| stdout: '/Listening on port (?<my_server_port>\\d+)/' | ||||
| }, | ||||
| }, | ||||
| }); | ||||
| ``` | ||||
|
|
||||
| If you include a named capture group into the expression, then Playwright will provide the capture group contents via environment variables: | ||||
|
|
||||
| ```js | ||||
| import { test, expect } from '@playwright/test'; | ||||
|
|
||||
| test.use({ baseUrl: `http://localhost:${process.env.MY_SERVER_PORT ?? 3000}` }); | ||||
|
|
||||
| test('homepage', async ({ page }) => { | ||||
| await page.goto('/'); | ||||
| }); | ||||
| ``` | ||||
|
|
||||
| This is not just useful for capturing varying ports of dev servers: | ||||
| You can also use it to wait for readiness of a service that doesn't expose an HTTP readiness check, but instead prints a readiness message to stdout or stderr. | ||||
|
|
||||
| ### Breaking Change | ||||
|
|
||||
| After 3 years of being deprecated, we removed `Page#accessibility` from our API. Please use other libraries such as [Axe](https://www.deque.com/axe/) if you need to test page accessibility. See our Node.js [guide](https://playwright.dev/docs/accessibility-testing) for integration with Axe. | ||||
|
|
||||
| ### New APIs | ||||
|
|
||||
| - New property [`property: TestConfig.tag`] adds a tag to all tests in this run. This is useful when using [merge-reports](./test-sharding.md#merging-reports-from-multiple-shards). | ||||
| - [`event: Worker.console`] event is emitted when JavaScript within the worker calls one of console API methods, e.g. console.log or console.dir. [`method: Worker.waitForEvent`] can be used to wait for it. You can opt out of this using the `PLAYWRIGHT_DISABLE_SERVICE_WORKER_CONSOLE` environment variable. | ||||
| - [`method: Locator.description`] returns locator description previously set with [`method: Locator.describe`], and `Locator.toString()` now uses the description when available. | ||||
| - New option [`option: Locator.click.steps`] in [`method: Locator.click`] and [`method: Locator.dragTo`] that configures the number of `mousemove` events emitted while moving the mouse pointer to the target element. | ||||
| - Network requests issued by [Service Workers](./service-workers.md#network-events-and-routing) are now reported and can be routed through the [BrowserContext](./api/class-browsercontext.md), only in Chromium. You can opt out using the `PLAYWRIGHT_DISABLE_SERVICE_WORKER_NETWORK` environment variable. | ||||
| - New methods [`method: Request.postData`], [`method: Request.postDataBuffer`] and [`method: Request.postDataJSON`]. | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
| - Option [`property: TestConfig.webServer`] added a `wait` field to check readiness based on stdout/stderr. | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
|
|
||||
| ### Browser Versions | ||||
|
|
||||
| - Chromium 143.0.7499.4 | ||||
| - Mozilla Firefox 142.0.1 | ||||
| - WebKit 26.0 | ||||
|
|
||||
| ## Version 1.56 | ||||
|
|
||||
| <LiteYouTube | ||||
|
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -779,6 +779,31 @@ export default defineConfig({ | |
| }); | ||
| ``` | ||
|
|
||
| If your webserver runs on varying ports, use `wait` to capture the port: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is good, but I think we should expand the webserver guide, link from this doc to the guide, and perhaps trim this doc instead. |
||
|
|
||
| ```js | ||
| import { defineConfig } from '@playwright/test'; | ||
|
|
||
| export default defineConfig({ | ||
| webServer: { | ||
| command: 'npm run start', | ||
| wait: { | ||
| stdout: '/Listening on port (?<my_server_port>\\d+)/' | ||
| }, | ||
| }, | ||
| }); | ||
| ``` | ||
|
|
||
| ```js | ||
| import { test, expect } from '@playwright/test'; | ||
|
|
||
| test.use({ baseUrl: `http://localhost:${process.env.MY_SERVER_PORT ?? 3000}` }); | ||
|
|
||
| test('homepage', async ({ page }) => { | ||
| await page.goto('/'); | ||
| }); | ||
| ``` | ||
|
|
||
| ## property: TestConfig.workers | ||
| * since: v1.10 | ||
| - type: ?<[int]|[string]> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry to bother, but does this change anything related to #33566? / https://playwright.dev/docs/release-notes#try-new-chromium-headless ?
I don't know what I'm actually wanting to ask but does Playwright still provides this "old" Chromium Headless (1.48 figure/
--only-shell) or everything is using the new "new headless" (section "Opt-in to new headless")?
Please ignore if this question if it doesn't make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing changes in regards to headless shell, new headless and headed.