Assertions

Web-first assertion patterns for Playwright + TypeScript — always await expect(locator).toXxx() (never snapshot-style expect(await locator.textContent())), never page.waitForTimeout, never waitForLoadState('networkidle'), expect.soft for supplementary checks, expect.poll for non-locator values, waitForResponse set up BEFORE the triggering action. Use when writing assertions, fixing flaky waits, debugging timing issues, removing hardcoded sleeps, asserting on API responses, or reviewing test assertion code.

antongulin c24be6b 9.4 KB Updated

File contents

antongulin/pw-kit/tree/main/skills/assertions commit c24be6bb95

Frequently asked questions

npx skillmds@latest add antongulin/assertions