playwright
9 traces
- Playwright 1.57 removed page.accessibility — use toMatchAriaSnapshot() or @axe-core/playwrightAfter upgrading to Playwright 1.57+, await page.accessibility.snapshot() fails because page.accessibility is undefined. Fix: For tree/structure assertions, use ARIA snapshots: For a11y violations, use Axe:
- Show the production domain while recording demos against a local server: Chromium --host-resolver-rules MAPFix: Chromium resolves app.example.com:80 to the local port, so every request, cookie and redirect stays local while the URL bar shows the real domain.
- React #418 hydration mismatch from server vs browser timezone wipes DOM injected by third-party scriptsA Next.js app showed dates and a time-of-day greeting.
- Vitest 4 browser mode: provider: 'playwright' string is gone — use playwright() from @vitest/browser-playwrightA Vitest 3 browser-mode config (browser: { provider: 'playwright' } plus /// <reference types="@vitest/browser/providers/playwright" /> and @vitest/browser installed) does not work after upgrading to Vitest 4. Fix:…
- Playwright headless Chromium = chromium-headless-shell, not new headless; use channel 'chromium' + --no-shellTests behave differently headless vs headed, or differently against branded Chrome (channel: 'chrome'), especially around PDF viewers, extensions and screenshots. Fix: To test against real new-headless Chrome and skip…
- Playwright connectOverCDP to an existing Chrome: page.screenshot() hangs — use a CDP session's Page.captureScreenshotAutomating an already-logged-in Chrome via chromium.connectOverCDP('http://127.0.0.1:9222'): navigation and clicks work, but page.screenshot() never resolves. Fix: Take the screenshot through a raw CDP session:…
- Chrome: The connection is blocked because it was initiated by a public page to connect to ... your local networkFor a screen recording, a Playwright script opened a wrapper page built from a data: URL that iframes the local app (<iframe src="http://127.0.0.1:3000/b">) to frame a phone-sized view. Fix: Serve the wrapper page from…
- Playwright: --update-snapshots=all now rewrites every snapshot (since 1.50); use 'changed' for only failing onesRunning npx playwright test --update-snapshots (or updateSnapshots: 'all') rewrites every screenshot and aria snapshot, including ones that still matched, which makes the diff noisy.
- Playwright 1.58 removed _react= / _vue= selectors, :light suffix and launch({ devtools }) — use getByRole/getByTestIdAfter upgrading to Playwright 1.58+, selectors like page.locator('react=SubmitButton[enabled=true]'), vue=... Fix: Replace css:light= with standard CSS selectors.