Playwright - v1.18.0


Locator Improvements

  • [locator.dragTo(locator)]
  • [expect(locator).toBeChecked({ checked })]
  • Each locator can now be optionally filtered by the text it contains:
    js await page.locator('li', { hasText: 'my item' }).locator('button').click();
    Read more in locator documentation.

Testing API improvements

  • [expect(response).toBeOK()]
  • [testInfo.attach()]
  • [test.info()]

Improved TypeScript Support

  1. Playwright Test now respects tsconfig.json's baseUrl and paths, so you can use aliases
  2. There is a new environment variable PW_EXPERIMENTAL_TS_ESM that allows importing ESM modules in your TS code, without the need for the compile step. Don't forget the .js suffix when you are importing your esm modules. Run your tests as follows:
npm i --save-dev @playwright/test@1.18.0
PW_EXPERIMENTAL_TS_ESM=1 npx playwright test

Create Playwright

The npm init playwright command is now generally available for your use:

# Run from your project's root directory
npm init playwright
# Or create a new project
npm init playwright new-project

This will scaffold everything needed to get started with Playwright Test: configuration file, optionally add examples, a GitHub Action workflow and a first test example.spec.ts.

New APIs & changes

  • new [testCase.repeatEachIndex] API
  • new option fixtures
  • [acceptDownloads] option now defaults to true

Browser Versions

  • Chromium 99.0.4812.0
  • Mozilla Firefox 95.0
  • WebKit 15.4

This version was also tested against the following stable channels:

  • Google Chrome 97
  • Microsoft Edge 97

(1.18.0-beta-1642620709000)


Details

date
Jan. 20, 2022, noon
name
v1.18.0
type
Minor
👇
Register or login to:
  • 🔍View and search all Playwright releases.
  • 🛠️Create and share lists to track your tools.
  • 🚨Setup notifications for major, security, feature or patch updates.
  • 🚀Much more coming soon!
Continue with GitHub
Continue with Google
or