New APIs
-
New method
route.fetch()
and new optionjson
forroute.fulfill()
:await page.route('**/api/settings', async route => { // Fetch original settings. const response = await route.fetch(); // Force settings theme to a predefined value. const json = await response.json(); json.theme = 'Solorized'; // Fulfill with modified data. await route.fulfill({ json }); });
-
New method
locator.all()
to iterate over all matching elements:// Check all checkboxes! const checkboxes = page.getByRole('checkbox'); for (const checkbox of await checkboxes.all()) await checkbox.check();
-
Retry blocks of code until all assertions pass:
await expect(async () => { const response = await page.request.get('https://api.example.com'); await expect(response).toBeOK(); }).toPass();
Read more in our documentation.
-
Automatically capture full page screenshot on test failure:
// playwright.config.ts import type { PlaywrightTestConfig } from '@playwright/test'; const config: PlaywrightTestConfig = { use: { screenshot: { mode: 'only-on-failure', fullPage: true, } } }; export default config;
Miscellaneous
- Playwright Test now respects
jsconfig.json
. - New options
args
andproxy
forandroidDevice.launchBrowser()
. - Option
postData
in methodroute.continue()
now supports serializable values.
Browser Versions
- Chromium 109.0.5414.46
- Mozilla Firefox 107.0
- WebKit 16.4
This version was also tested against the following stable channels:
- Google Chrome 108
- Microsoft Edge 108