Playwright 1.65 upgrade: what breaks and what to check
By qtrl Team · Engineering
Most Playwright upgrades are a version bump and a green CI run. 1.65 is a little different. The release notes list ten breaking changes, and a few of them change what your existing tests see on the page: when an element counts as clickable, which text makes up an accessible name, which cookies come back for a URL. None of that is hard to fix. It just helps to know where to look before you open the upgrade PR.
This is the checklist we'd run, in order. The full notes are on playwright.dev and the GitHub releases page.
Step 1: target 1.65.1, not 1.65.0
1.65.0 shipped on November 5. A patch, 1.65.1, followed on November 13 with two fixes. One is a regression where a decorated class with a static field fails to load ("_initClass is not a function") when useDefineForClassFields is off. The other is test locations being one column off under Bun 1.4.4 and later. If you use decorators in test helpers or page objects, the first one would have looked like a broken upgrade. Skip it and go straight to the patch.
1.65.1 also moves Chromium to 159.0.8154.6. Firefox stays on 159.0 and WebKit on 27.2.
Step 2: check your Node version
Playwright no longer tests on Node.js 20. The supported versions are now 22, 24 and 26. Nothing in the notes says 20 stops working outright, but running an untested runtime in CI is a bad trade for a test tool whose whole job is to be the boring, reliable part of the pipeline. Bump the Node version in your CI image and .nvmrc in the same PR as Playwright.
If you use the official Docker images, they now ship Node.js 26 instead of 24. That's fine for most suites, but it's a second runtime change hiding inside the image tag, so pin it deliberately rather than finding out from a stack trace.
Step 3: run the whole suite once and sort the failures
Don't fix as you go. Run everything on the new version, collect the failures, and group them by which breaking change caused them. Most failures will fall into one of a handful of buckets, and fixing a bucket at a time is much faster than fixing tests one at a time.
Here are the ten changes, roughly ordered by how likely they are to hit a typical end-to-end suite:
| Change | Who it hits | What to do |
|---|---|---|
| Actions wait for elements to stop being inert | Apps with modals, drawers and overlays | Usually a real bug in the test. See below |
| Accessible names skip text the browser doesn't render | getByRole with a name, aria snapshots, web components with slots, closed <details> | Review snapshot diffs, don't bulk-update them |
TypeScript class fields follow useDefineForClassFields | Page objects with field initializers that read constructor parameters | Move the init into the constructor, or set the flag to false |
| Cookie matching follows RFC 6265 | Tests that read cookies across subdomains or similar paths | Fix the URL or path you pass to cookies() |
| Sharded runs with zero matching tests now fail | CI jobs that filter by tag or grep | Add --pass-with-no-tests where an empty run is expected |
| Proxy credentials only answer proxy challenges | Suites that relied on proxy auth leaking to the site | Use httpCredentials for site auth |
API request params append to the URL query instead of replacing it | API tests with a query string already in the URL | Pick one place to put query params |
| CSS imports in test files load as empty modules | Component-adjacent tests that import styles | Make sure the imported file actually exists |
| Blob reporter clears its output directory again | Custom report merging setups | Write blobs to their own directory |
| CJS test locations point to the callee start | Tooling that parses file:line:col | Update any column-sensitive parsing |
Three of these deserve more than a table row.
Inert elements: the failures that are telling you something
Actions such as click, check, tap, fill, clear and selectOption now wait until the target isn't inert. Playwright counts an element as inert when it has the inert attribute or sits inside an element that does. Plenty of modal and drawer libraries set that attribute on the page behind them while they're open. If the element stays inert, the action times out.
Clicks were already fairly safe here, because Playwright checks that the element actually receives the click. The bigger change is for actions without that check. Before 1.65, fill() or selectOption() could still put a value into a field inside an inert region, which no user could do. So when one of these timeouts shows up after the upgrade, start by asking why the region is still inert, not how to force the action through. Sometimes the test forgot to close a modal. Sometimes the app has a bug where the overlay never fully goes away. Either way, the new behavior is closer to what a person can actually do.
Accessible names: read the diff before you accept it
Accessible names and aria snapshots now leave out text the browser doesn't render, like light DOM content that isn't assigned to a slot, or content directly inside a closed <details>. That can change what getByRole('button', { name }) matches, what ariaSnapshot() returns, and whether toMatchAriaSnapshot() passes.
The temptation is to run --update-snapshots and move on. Resist it for at least one pass. A changed snapshot after this upgrade means a screen reader user probably wasn't hearing that text either. Most of the time that's fine and you accept the new snapshot. Sometimes it's a label that was only "there" because hidden text padded it out, which is an accessibility bug the old snapshot was hiding.
The accessible-name change matters more if agents write or maintain your tests. Role-and-name locators are what we recommend in our locator guide, and they're also what browser agents lean on, because the accessibility tree is the most stable description of a page they get. When the rules for that tree change, agent-authored locators shift with them. Re-run any AI-generated specs as part of the upgrade, not after.
Class fields: the one that fails before a test runs
TypeScript class fields now follow useDefineForClassFields from your tsconfig, the same way tsc does. It's on by default for ES2022 and later targets, and when target isn't set. The practical effect: a field initializer that reads a constructor parameter property now throws a TypeError.
That pattern is common in page objects:
class CheckoutPage {
// Throws in 1.65: this.page isn't assigned yet
readonly payButton = this.page.getByRole('button', { name: 'Pay' })
constructor(private readonly page: Page) {}
}The fix is to assign in the constructor:
class CheckoutPage {
readonly payButton: Locator
constructor(private readonly page: Page) {
this.payButton = page.getByRole('button', { name: 'Pay' })
}
}Setting "useDefineForClassFields": false also works, but it's a workaround, and it's exactly the setting that triggers the 1.65.0 decorator regression from step 1. The constructor version behaves the same whatever the flag says, so you're not depending on a tsconfig setting. Running tsc --noEmit before the upgrade should point you at most of these spots.
What to turn on once you're green
Failure-only reports
There's a new failures terminal reporter that prints failures and successful retries as they happen, then a summary, with no progress noise. The html, json and junit reporters gain an onlyFailures option that keeps unexpected, flaky and interrupted tests and drops the rest:
reporter: [
['failures'],
['html', { onlyFailures: true }],
],On a large suite this shrinks CI artifacts a lot, and it makes the report something a person (or an agent triaging failures) can read without scrolling past a thousand passes. Note that flaky tests stay in the report, which is what you want. If you're working through a flaky backlog, our guide to fixing flaky tests covers what to do with them.
An exclusive test lock
1.63 added named locks so tests that share a resource don't run at the same time. 1.65 adds a built-in -exclusive- lock for a test that needs the whole environment to itself:
test('restart the server', { lock: '-exclusive-' }, async () => {
// runs only when no other test is running
})That's cleaner than splitting a suite into a serial project just for one or two tests that restart a service or reset shared data.
Descriptions on skip and fixme
test.skip(), test.fixme(), test.fail() and test.slow() can take just a description, which ends up in the annotation. Small change, but a skipped test with a reason in the report is far easier to clean up six months later than one without.
Should you run tests under Bun?
The test runner now runs under Bun with bunx --bun playwright test. Without --bun, bunx still runs it on Node. Playwright tests it under Bun 1.4.3 on Linux.
The limitations are real, though. There's no watch mode, so UI mode won't rerun on file changes. --tsconfig and the JSX tsconfig options have no effect, and custom ESM loaders aren't supported. Stack traces lose async frames, and API names drop their class prefix (click instead of locator.click), which changes step titles and error messages. Test console output also doesn't make it into the trace.
Our take: if your app already runs on Bun, try it locally and enjoy not having two runtimes. For CI, stay on Node for now. The trace is the thing you reach for when a run fails at 2am, and losing console output and async frames there costs more than skipping a second runtime saves.
Should you upgrade?
Yes, to 1.65.1. Budget an afternoon if your suite is mostly plain end-to-end tests, and more if you have a lot of aria snapshots or page objects with field initializers. The inert and accessible-name changes will probably surface a few tests that were passing for the wrong reason, which is a good outcome for an upgrade.
If you skipped the last few releases, read 1.63 and 1.64 too. 1.63 added named test locks. 1.64 added --shuffle for catching order-dependent tests, locator.within(), and page.webmcp for testing WebMCP tools, which we cover in how to test WebMCP tools. Our post on Playwright 1.61 and 1.62 covers the releases before that.
A framework upgrade tells you which spec files broke. It doesn't tell you which user flows still work. qtrl keeps your user journeys as structured test cases and runs them with AI agents in real browsers, alongside your Playwright suite, with a record of what each run checked. So an upgrade on one side doesn't leave you guessing about the other. See how it works.
Have more questions about AI testing and QA? Check out our FAQ