Skip to content

v1.29.0

Compare
Choose a tag to compare
@aslushnikov aslushnikov released this 16 Dec 22:51
· 17 commits to release-1.29 since this release
00895e3

New APIs

  • New method route.fetch() and new option json for route.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();
  • Locator.selectOption matches now by value or label:

    <select multiple>
      <option value="red">Red</div>
      <option value="green">Green</div>
      <option value="blue">Blue</div>
    </select>
    await element.selectOption('Red');
  • 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

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