sincecutoff.com
← all changes

Playwright supports expect.soft.poll

Introduced 2026-06-15 · score 0.97

HOW TO USE IT

When a test needs to poll an assertion without stopping at the first failure, call `expect.soft.poll(...)` and chain the matcher, such as `.toBe(200)`.

await expect.soft.poll(async () => { const response = await page.request.get('https://api.example.com'); return response.status(); }).toBe(200);

WHY THIS HELPS

Poll an assertion in a test while keeping it soft.

REQUIREMENTS AND LIMITATIONS

  • Version: v1.61.0
  • actual (callback) (required): Function polled until the chained matcher passes or polling times out.
  • timeout: Polling timeout in milliseconds; default is 5 seconds. Set to 0 to disable timeout.
  • intervals: Polling intervals in milliseconds; default is [100, 250, 500, 1000].
  • chained matcher (required): Assertion applied to the callback result, such as `.toBe(200)`.
  • Prerequisite: Soft assertions work only with the Playwright test runner.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card