Repository navigation
feat(web)!: WebDriver BiDi driver replaces Playwright - #1503
okwasniewski wants to merge 317 commits into
Conversation
🟢 e2e web: 93 passedAll 93 tests in 42 files
Tested by e2e 0.23.1 · 1m 30s · web · run artifacts |
🟢 e2e web agent: 34 passed34 agent steps · 26 replayed from cache · 23 model calls · 113.1k tokens (94% cached) · $0.0044 All 34 tests in 5 files
Tested by e2e 0.23.1 · 1m 43s · web · run artifacts |
🟢 e2e android agent: 20 passed24 agent steps · 15 replayed from cache · 40 model calls · 229.8k tokens (84% cached) · $0.0147 All 20 tests in 1 file
Tested by e2e 0.23.1 · 7m 9s · android-emulator · run artifacts |
🟢 e2e android: 1 flaky, 57 passed, 1 skipped
|
| Test | Time | |
|---|---|---|
| tests/controls.e2e.ts · 1 flaky, 23 passed, 1 skipped | 2m 57s | |
| control inventory › a label query resolves a labeled text field (1 failed attempt first) | 6.6s | |
| 🟢 | control inventory › a labeled field answers name, display value, value reads, fill, and clear | 13.0s |
| 🟢 | control inventory › a placeholder query and attribute reads find the field | 7.0s |
| 🟢 | control inventory › a secure field takes a fill and denies value reads | 7.2s |
| 🟢 | control inventory › press sends a character and Enter through the soft keyboard | 8.6s |
| 🟢 | control inventory › a field autofocuses on mount and focus() moves the focus | 10.9s |
| 🟢 | control inventory › toBeFocused follows the focus | 13.0s |
| 🟢 | control inventory › a switch checks, unchecks, and reports its state | 9.5s |
| 🟢 | control inventory › checkbox and radio roles answer getByRole, and a checkbox toggles by tap | 8.0s |
| 🟢 | control inventory › checkbox and radio roles check, uncheck, and report their state | 12.1s |
| 🟢 | control inventory › a tab role answers getByRole | 4.7s |
| 🟢 | control inventory › a radio group reports the checked option | 8.3s |
| 🟢 | control inventory › buttons report disabled, enabled, and a state that arrives later | 8.5s |
| 🟢 | control inventory › a display: none element is absent rather than hidden, its visible twin attached | 8.3s |
| 🟢 | control inventory › a header answers its accessible name | 4.7s |
| 🟢 | control inventory › a tab row answers count, all, texts, filters, positions, and switching | 6.1s |
| 🟢 | control inventory › a list answers counts, list-form text, reads, and boxes in order | 6.5s |
| ⏭️ | control inventory › a row contains its texts (skipped: React Native flattens a plain View out of the accessibility tree on both platforms: XCTest and the Android helper report a View with a testID as a leaf beside its children, so filter({ has }) and a query scoped to it match nothing; only Sc…) | |
| 🟢 | control inventory › a long press lands as one | 7.4s |
| 🟢 | control inventory › a double tap lands inside the 300 ms window | 8.3s |
| 🟢 | control inventory › an ambiguous locator fails at once | 5.5s |
| 🟢 | control inventory › screenshot, restart, and clearState reopen the app on its home list | 9.6s |
| 🟢 | refusals › verbs a device never declares are refused before the engine | 6ms |
| 🟢 | refusals › keys the soft keyboard cannot send are refused by the engine | 1.7s |
| 🟢 | refusals › a missing locator fails as not found once its timeout passes | 1.1s |
| 🟢 | tests/device-fixture.e2e.ts · 11 passed | 1m 36s |
| 🟢 | device fixture › setOrientation rotates the window the app measures | 5.5s |
| 🟢 | device fixture › home leaves the app, openApp brings it back where it was | 6.7s |
| 🟢 | device fixture › foregroundApp sees the home screen after home() | 5.0s |
| 🟢 | device fixture › closeApp then openApp relaunches on the home list | 8.5s |
| 🟢 | device fixture › closeApp leaves the next commands on the same device | 9.8s |
| 🟢 | device fixture › foregroundApp after closeApp reports the closed session as APP_NOT_OPEN | 4.9s |
| 🟢 | device fixture › openLink opens the scenario a deep link names | 5.5s |
| 🟢 | device fixture › device.back pops the scenario | 5.1s |
| 🟢 | device fixture › unstable_raw reaches the test session through the raw driver | 3.9s |
| 🟢 | device fixture › setNetwork and setAirplaneMode change what the app sees | 17.2s |
| 🟢 | device fixture › setLocation and clearLocation change what the app reads | 23.7s |
| 🟢 | tests/device.e2e.ts · 5 passed | 49.2s |
| 🟢 | permission prompt › allowing the system dialog enables the microphone | 6.5s |
| 🟢 | permission prompt › a denied prompt recovers once the permission is granted outside | 17.2s |
| 🟢 | sequential onboarding echoes the exact values | 11.6s |
| 🟢 | onboarding rejects a malformed email before advancing | 6.4s |
| 🟢 | dismissing the keyboard over choice controls leaves them as they were | 7.4s |
| 🟢 | tests/flows-lists.e2e.ts · 7 passed | 3m 21s |
| 🟢 | infinite scroll reaches the target item | 30.9s |
| 🟢 | product catalog adds exactly two of the right variant | 10.8s |
| 🟢 | gestures: long-press, then swipe left | 9.3s |
| 🟢 | gestures: double-tap completes the flow | 10.5s |
| 🟢 | sticky chrome: accept below the fold, then continue | 11.7s |
| 🟢 | async states: load, pull to refresh, claim through the toast | 12.8s |
| 🟢 | huge virtualized list reaches row 512 | 1m 55s |
| 🟢 | tests/flows.e2e.ts · 7 passed | 1m 0s |
| 🟢 | text inputs unlock the submit button | 7.4s |
| 🟢 | filled text inputs report their values | 6.4s |
| 🟢 | modal flow confirms through the native alert | 10.2s |
| 🟢 | bottom tabs act inside the last tab | 7.2s |
| 🟢 | error recovery retries, then confirms the delete | 8.8s |
| 🟢 | choice controls place the exact order | 8.7s |
| 🟢 | debounced search selects the target once results arrive | 11.2s |
| 🟢 | tests/login-form.e2e.ts · 3 passed | 30.8s |
| 🟢 | login form › rejects a malformed email | 8.9s |
| 🟢 | login form › rejects an unknown account | 9.3s |
| 🟢 | login form › signs in and logs out | 12.7s |
| 🟢 | tests/smoke.e2e.ts · 1 passed | 6.6s |
| 🟢 | home lists the scenarios and opens one | 6.6s |
Tested by e2e 0.23.1 · 10m 49s · android-emulator · run artifacts
🟢 e2e ios: 56 passed, 1 skippedAll 57 tests in 7 files
Tested by e2e 0.23.1 · 7m 6s · ios-simulator · run artifacts |
🟢 e2e ios agent: 1 flaky, 20 passed, 1 skipped25 agent steps · 11 replayed from cache · 63 model calls · 465.9k tokens (83% cached) · $0.0316
|
| Test | Agent | Time | |
|---|---|---|---|
| tests-agent/scenarios.e2e.ts · 1 flaky, 20 passed, 1 skipped | 25 steps · 63 calls | 9m 11s | |
| 🟢 | act completes Login Form | 1 step | 41.0s |
| 🟢 | act completes Infinite Scroll List | 1 step | 37.6s |
| 🟢 | act completes Modal Flow | 1 step | 10.2s |
| 🟢 | act completes Bottom Tabs | 1 step | 7.5s |
| 🟢 | act completes Text Input Variations | 1 step | 12.7s |
| 🟢 | act completes Broken Accessibility | 2 steps · 6 calls | 26.9s |
| 🟢 | act completes Vision Only | 2 steps · 6 calls | 28.0s |
| act completes Gestures (1 failed attempt first) | 1 step · 9 calls | 37.7s | |
| 🟢 | act completes Async States | 1 step · 10 calls | 37.7s |
| 🟢 | act completes Debounced Search | 1 step · 1 call | 27.8s |
| 🟢 | act completes Flattened Registration Form | 2 steps · 1 call | 27.2s |
| 🟢 | act completes Flattened Login | 2 steps · 10 calls | 53.4s |
| 🟢 | act completes Sticky Chrome Target | 1 step · 4 calls | 39.7s |
| 🟢 | act completes WebView Accessibility | 1 step | 14.0s |
| 🟢 | act completes Permission Prompt | 1 step | 13.3s |
| 🟢 | act completes Photo Picker | 1 step · 2 calls | 32.8s |
| 🟢 | act completes Product Catalog | 1 step | 10.7s |
| 🟢 | act completes Error Recovery | 1 step | 10.0s |
| 🟢 | act completes Choice Controls | 1 step · 6 calls | 37.2s |
| 🟢 | act completes Stripe PaymentSheet | 1 step · 8 calls | 33.0s |
| 🟢 | act completes Apple Pay | 1 step | 12.7s |
| ⏭️ | act completes Apple Pay Billing Address (skipped: the CI simulator's Apple Pay sheet skips the billing-address step, so the scenario cannot be completed there) |
Tested by e2e 0.23.1 · 10m 9s · ios-simulator · run artifacts
741aeec to
30f1ce3
Compare
2411751 to
7e2fbc6
Compare
b9422fc to
22d080f
Compare
7e2fbc6 to
53e9af7
Compare
ff9683d to
34d49bb
Compare
Main's new on-demand fixtures test quotes the hint as main words it; this branch says web target, since the engine is no longer Playwright.
|
[claude-fable-5-2] responding on behalf of okwasniewski @kdy1 thanks for the three reviews. All 13 inline threads have a reply and a fix. The findings that had no thread:
Two things the fixes changed were caught by the testbed's Playwright suite and fixed before the push: key events for text typed under a held Shift (9335b67) and an option label that starts with a non-breaking space (same commit). The selector change also made a page that replaced One thing I noticed and did not fix: on Firefox a cookie value with a non-ASCII character ( Local runs on this head: |
kdy1
left a comment
There was a problem hiding this comment.
Note
This text was drafted with AI and posted after human approval.
- Harnesses: T3 Code, Claude Code, Codex
- AI agents: Claude Opus 5.5 (claude-opus-5-5), Claude Code: co-review, verification runs, and this text, GPT-6.2 Astra (gpt-6.2-astra), Codex: Review Once reviewer, GPT-6.1 Sol (gpt-6.1-sol), Codex: Review Once reviewer, Claude Opus 5.5 (claude-opus-5-5), Claude Code: Review Once reviewer, Claude Sonnet 5.5 (claude-sonnet-5-5), Claude Code: Review Once reviewer
Requesting changes: I ran the cases below on Chromium against main (Playwright, 9d240ac9) and this branch (9bc0c61b) with the same script on each side. One P1 and nine P2 cases behave differently from main. The inline comments give each case, its input, and the result on each side (15 comments).
Most of these regressions are in code that Playwright ran in the browser before and that this PR now implements itself: the selector tokenizer, text normalization, the edit path, the MIME table, and the screenshot mask. More cases of this type are probable. Please add the inputs from the inline comments to the selector-parity and Playwright-parity tests.
Findings that are not inline
- WebKit removal without a deprecation period (question).
web({ browser: 'webkit' })is accepted onmain. On this branch it isINVALID_CONFIGimmediately, with no warning first.CONTRIBUTING.md:308-318requires a 6-month deprecation for a breaking change to a public contract, so the first removal date would be 2027-04-01. The policy does not list@e2e-dev/webexports explicitly, so this depends on whetherweb({ browser })counts as a config key. Please say which interpretation applies. - Mapper and browser versions (risk, no failure found).
packages/web/package.json:63pinschromium-bidi159.0.8147-0, but the pinned Chrome is 157.0.8103.38. I did not find a failure that this causes.
Limits
- I could not start Firefox on my machine ("Could not find profile folder"), so the Firefox item is from reading the code only.
- I ran the race in
actions.ts:67throughopenHostand the engine contract (locate, thenperform), because the public API cannot add a step between locate and dispatch.
| } else { | ||
| return { kind: 'refused', reason: 'Element is not an <input>, <textarea> or [contenteditable] element' }; | ||
| } | ||
| const edited = text === '' ? document.execCommand('delete') : document.execCommand('insertText', false, text); |
There was a problem hiding this comment.
P1: fill writes a value that the page cancels in beforeinput.
When the page calls preventDefault() in beforeinput, execCommand('insertText') inserts nothing and returns false. The fallback at L104-107 then sets the value directly and fires input. Thus an input mask or an editor that refuses a value still receives it in a test.
Input: a <textarea> and an <input> with the value original whose beforeinput handler calls preventDefault(), then locator('#t').fill('replace') and locator('#i').fill('replace').
| value | events | |
|---|---|---|
main |
original |
beforeinput only |
| this PR | replace |
input only |
Suggested fix: when the page cancels beforeinput, do not write the value. For example, record defaultPrevented from a beforeinput listener and skip setState when it is set.
| } | ||
| const deadline = new Deadline(timeoutMs); | ||
| const target = session.refs.lookup(ref); | ||
| if (!session.refs.claimFresh(ref)) await stillLocated(session, target); |
There was a problem hiding this comment.
P2: claimFresh skips the uniqueness check, so an action can go to the wrong element.
When no input occurs after locate, claimFresh returns true and stillLocated does not run. If the app adds a second match between locate and dispatch, the action goes to the first ref and does not fail.
Input: a page with one button.match. A held fetch makes the app prepend a second button.match after locate. Then engine.perform(ref, { kind: 'tap' }) on the first ref, through openHost and the engine contract. I ran it 2 times on each side.
| result | clicks | |
|---|---|---|
main |
NODE_STALE (2/2) |
none |
| this PR | ok (2/2) |
["first"] |
The app must change the DOM in the one round trip between locate and dispatch, so I rate it P2. Suggested fix: run the uniqueness check also when the ref is fresh, or invalidate fresh refs on a DOM mutation of the scope.
| @@ -0,0 +1,27 @@ | |||
| /** The media type of a file by its extension: a fulfilled route's `content-type`, and an uploaded `File`'s `type`. */ | |||
| export const CONTENT_TYPES: Readonly<Record<string, string>> = { | |||
There was a problem hiding this comment.
P2: the extension table is too short for its two uses.
This table sets the content-type of route.fulfill({ path }) (network-decisions.ts:391) and the File.type of an upload on a provider's browser (actions.ts:629). Types that are not in the table get no header or an empty type. Playwright used a full MIME table.
Input 1: route.fulfill({ path }) for m.wasm, f.docx, f.xlsx, f.avif, then WebAssembly.instantiateStreaming(fetch('/files/m.wasm')).
.wasm content-type |
instantiateStreaming |
|
|---|---|---|
main |
application/wasm |
ok |
| this PR | none | MIME type error |
Input 2: setInputFiles with a.docx, a.xlsx, a.avif, a.wasm on a BrowserProvider browser (local Chrome over CDP), then read File.type.
File.type of all four |
|
|---|---|
main |
the standard MIME types |
| this PR | "" |
.txt and .png are the same on both sides. Suggested fix: use a complete MIME table (for example the mime database, or a copy of Playwright's table).
| return nested.name === 'not' ? !any : any; | ||
| }; | ||
| const matchesCompound = (element: Element, step: CssStep): boolean => { | ||
| if (step.compound.includes(':scope') ? !isScope(element) : element === scope) return false; |
There was a problem hiding this comment.
P2: :scope in an attribute value is read as the :scope pseudo-class.
step.compound.includes(':scope') is a substring test on the compound text. It also matches :scope in a quoted attribute value, so the compound then matches only the scope element.
Input: <div data-x=":scope"><b>hello</b></div>, then locator('[data-x=":scope"] > b').count().
| count | |
|---|---|
main |
1 |
| this PR | 0 |
Suggested fix: detect :scope from the tokens of the compound (outside strings and attribute groups), not from its text.
| end = groupEnd(source, index); | ||
| tokens.push({ kind: 'group', text: source.slice(index, end) }); | ||
| } else { | ||
| while (end < source.length && !SPECIAL.test(source[end]!)) end += 1; |
There was a problem hiding this comment.
P2: a CSS comment in a selector gives INVALID_LOCATOR.
tokenizeSelector has no case for /* ... */. A comment becomes part of a text token, and the selector is then invalid. CSS allows comments anywhere whitespace is allowed, and Playwright accepts them.
Input: <article>art</article>, then locator('body /* x */ article').count().
| result | |
|---|---|
main |
1 |
| this PR | INVALID_LOCATOR |
Suggested fix: tokenize /* ... */ as whitespace (outside strings).
| type: (text) => run('keyboard.type', (session, { signal }) => typeInto(session, text, signal), { input: true }), | ||
| }, | ||
| mouse: { | ||
| move: (x, y) => run('mouse.move', (session, { signal }) => session.input.send(moveSources(Math.round(x), Math.round(y)), signal), { input: true }), |
There was a problem hiding this comment.
P3: mouse.move(NaN, …) and mouse.wheel(NaN, …) succeed.
Math.round(NaN) is NaN, and the input is sent without a check. On main the same calls fail.
mouse.move(NaN, 5) |
mouse.wheel(NaN, 5) |
|
|---|---|---|
main |
ENGINE_FAILURE |
ENGINE_FAILURE |
| this PR | ok | ok |
Suggested fix: reject non-finite coordinates and deltas with INVALID_ARGUMENT.
| throw new ConfigurationError('INVALID_CONFIG', `smol: port ${app.port} is both app.port and in hostPorts; the browser's localhost:${app.port} can be only one of them`); | ||
| } | ||
| } | ||
| if (prepareTimeout !== undefined && (typeof prepareTimeout !== 'number' || !Number.isFinite(prepareTimeout) || prepareTimeout <= 0)) { |
There was a problem hiding this comment.
P3: smol() accepts a prepareTimeout that attachBrowser then refuses.
This check accepts any finite positive number. attachBrowser (packages/web/src/attach.ts:52) accepts only an integer from 1 to its maximum. Thus the config loads, and then each attempt fails.
prepareTimeout |
smol config | attachBrowser |
|---|---|---|
1000 |
ok | ok |
1.5, 0.5 |
ok | INVALID_ARGUMENT |
3e9 |
ok | INVALID_ARGUMENT |
This option is new, so I ran it on this branch only. Suggested fix: use the same rule as attachBrowser here, so the error occurs at config load.
| "@e2e-dev/core": patch | ||
| --- | ||
|
|
||
| A standalone session opened while a run is in progress, such as `attachBrowser()` inside a test, no longer hides the run's secrets while it is open or clears them when it closes. `app.resolveUrl` resolves an absolute URL on a target with no `app.url`; a relative one is still `APP_URL_REQUIRED`. |
There was a problem hiding this comment.
P3: the changeset says more than the change does.
The text says that a standalone session opened during a run "no longer hides the run's secrets while it is open". This is true for a session with no secrets of its own. It is not true for a host that has its own secrets.
| case, inside a run | main |
this PR |
|---|---|---|
| open standalone hold with no secrets: run's secret | SECRET_UNAVAILABLE |
bound |
open launch() host with its own secrets: run's secret |
SECRET_UNAVAILABLE |
SECRET_UNAVAILABLE |
| after the host closes | no registry | bound |
Suggested fix: say that only a session without secrets of its own leaves the run's secrets available, or make a host with secrets add to the run's registry instead of replacing it.
|
|
||
| | Throws | When | | ||
| | --- | --- | | ||
| | `UNSUPPORTED_CAPABILITY` | The browser comes from a browser provider without [`downloads`](/browser#downloads-on-the-provider). | |
There was a problem hiding this comment.
P3: the docs say downloads without provider downloads throw, but they work.
With a local BrowserProvider that has no downloads, browser.waitForDownload saves the file (report.csv) on main and on this branch. These places still say UNSUPPORTED_CAPABILITY:
docs/reference/web.mdx:384docs/reference/web.mdx:980(this line)skills/e2e/references/setup.md:219
Please make these lines agree with the behavior. I ran only a provider whose browser runs on the runner's machine; I did not run a remote browser. Please also check docs/integrations/testmu.mdx:246. I did not read it.
| * sent, on a browser whose key events cannot. | ||
| */ | ||
| async typeAsWritten(characters: readonly string[], signal?: AbortSignal): Promise<boolean> { | ||
| if (!this.target.traits.cdp) return false; |
There was a problem hiding this comment.
P3 (from reading the code, not run): on Firefox, typing with Shift held sends no key events.
Without CDP, typeAsWritten returns false. The text then goes in through execCommand, so keydown and keyup do not occur. On Chromium the key events occur. docs/reference/web.mdx:1006 says only that the text "still arrives as written", and the Firefox limits table does not list this.
I could not start Firefox on my machine, so I did not run this. Suggested fix: add this to the Firefox limits table, or send BiDi key actions for the characters that a key can enter.
kdy1
left a comment
There was a problem hiding this comment.
Note
This text was drafted with AI and posted after human approval.
- Harness: T3 Code
- AI agent: Claude Opus 5.5 (claude-opus-5-5), with 5 Claude Opus 5.5 subagents
I ran the deterministic suites of 14 open-source projects that use @e2e-dev/web on main (402a6157) and on this PR's head (9bc0c61b). Each project used the same packed e2e, @e2e-dev/core, and @e2e-dev/web tarballs from each build, on macOS with Node 26, and I reran every PR-only failure at least twice. Two tests that pass on main fail on this PR, and the changeset does not mention either one. Several documented breaks also need clearer wording or a migration path. The inline comments give the details (8 comments).
Requested changes
- A chained text query no longer matches the scope element itself. This breaks UniClipboard's
relay-overviewtest. See the comment onpackages/core/src/engine/resolve.ts. - An attempt-scope
BrowserProviderthat returns an ElectroncdpEndpointstill fails atapp.open. My earlier comment listed this case in its table. The fix addedconnect: { context: 'existing' }, but this case is still not fixed. It breaks the pattern in coder/xum'stests/stories/electronProvider.ts. See the comment onpackages/web/src/driver/browser-source.ts. - The changeset, the
INVALID_CONFIGmessages, and the skill do not give the migration for:visible,reconnectEndpoint, and WebKit. Error text from the chromium-bidi mapper also reads[object Object].
One finding is in a file this PR does not change: docs/integrations/notte.mdx:80 still says that each attempt runs "in a fresh session's default context, on its first tab". On this PR, an attempt-scope lease opens a new tab (see item 2), so this sentence is no longer true.
Results
This table shows only the projects that I did not report in my earlier reviews. openbot, cezar, and quivr give the same results as in those reviews.
| Project | main | PR |
|---|---|---|
| UniClipboard/UniClipboard (root suite) | 2/2 | 1/2: relay-overview fails (item 1) |
| SakuraByteCore/codexmate | 10/10 | 2/10: :visible is INVALID_LOCATOR (documented in screen.mdx, not in the changeset) |
| coder/xum (bugbash repros, 126 tests) | 114 pass, 12 fail | the same tests and errors |
| coder/xum Electron provider (repro with Electron 44) | app.open passes |
ENGINE_FAILURE: browsingContext.create: unknown error: Not supported (item 2) |
| MarcosCamara01/ecommerce-template | 23/23 | 23/23 |
| wraps-team/wraps | failures shared by both builds | the same |
SolZeroAI/solstatus, aranlucas/react-hook-form-mantine, e2e-inc/e2e-iframes, sjdonado/idonthavespotify, expo/examples with-e2e (web) |
pass | pass |
The context: 'existing' migration works well for openbot's pattern. In a reproduction of its setup (Electron 45, viewport: null, app.command with readyUrl), it is better than main, because one app launch now serves many tests and retries.
I did not run steps that call a model (no key), UniClipboard's WebView2 suite (Windows only), or openbot's live provider tests (they need sign-ins). I used local reproductions of the last two attach patterns.
| const { rank } = treeIndex(); | ||
| return candidates.filter((node) => matches.has(node)).toSorted((a, b) => (rank.get(a) ?? 0) - (rank.get(b) ?? 0)); | ||
| } | ||
| case 'query': { |
There was a problem hiding this comment.
A chained query searches only the strict descendants of its scope (descendantsOf), so getByTestId('x').getByText('…') no longer finds text that the x element holds itself. On main, Playwright resolved the chain, and Playwright's text query also matches the scope element. This changes behavior, and neither the changeset nor screen.mdx mentions it.
Found with UniClipboard/UniClipboard apps/gui-go/frontend/e2e/tester-army/relay-overview.e2e.mjs:98, applied().getByText('网络节点尚未启动', { exact: false }).waitFor(). It passes on main and fails on this PR, 2 of 2 runs:
LOCATOR_NOT_FOUND: locator did not become visible: getByTestId("relay-overview-applied") >> getByText("网络节点尚未启动")
Minimal repro (main: pass, PR: fail, 3 of 3 runs):
<p data-testid="applied">Node not started yet</p>await screen.getByTestId('applied').getByText('Node not started').waitFor({ timeout: 3000 });
await screen.getByTestId('applied').getByText(/not started/).waitFor({ timeout: 3000 });Text in a child element still matches on both builds. With .filter({ hasText }) at the three affected lines, the UniClipboard test passes on this PR.
Please match the scope element too for text queries, as main did. If the new behavior is intended, add it to the changeset as a break, with filter({ hasText }) as the replacement. (getByRole on the scope element itself fails on both builds, so this applies only to text.)
| scope: leases.scope, | ||
| userContext: leases.scope === 'attempt' | ||
| ? { | ||
| mode: 'default', |
There was a problem hiding this comment.
My earlier comment on this file listed this case in its table (BrowserProvider with scope: 'attempt'). The fix added connect: { context: 'existing' }, but this case still fails at 9bc0c61b.
In attempt scope, a lease gets user context mode 'default'. session.ts adopts the browser's existing tab only in mode 'adopt-tab' (createContext, line 284), so openTab always sends browsingContext.create (line 325). Electron refuses that command. On main, Playwright used the leased browser's first page.
This breaks coder/xum's tests/stories/electronProvider.ts (xumElectron()). It starts one Electron per attempt with --remote-debugging-port=0 and returns { id, cdpEndpoint } from a scope: 'attempt' provider. With the same provider and Electron 44.10.0, a test that calls app.open('/') passes on main and fails on this PR, 3 of 3 runs:
ENGINE_FAILURE: navigation: browsingContext.create: unknown error: Not supported
The changeset's replacement, connect: { cdpEndpoint, context: 'existing' }, passes, but it does not fit this pattern. connect keeps one browser per worker and calls no release, so xum would lose its fresh Electron per attempt and the cleanup. BrowserLease has no context: 'existing' equivalent.
Please adopt the leased browser's existing tab in attempt scope (as main did, and as docs/integrations/notte.mdx:80 still says), or give BrowserLease an equivalent of context: 'existing'. If neither is done, add this to the changeset.
|
|
||
| if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href) { | ||
| serve().catch((cause: unknown) => { | ||
| process.stderr.write(`${cause instanceof Error ? cause.message : String(cause)}\n`); |
There was a problem hiding this comment.
chromium-bidi rejects with a plain { code, message } object, not an Error, so String(cause) writes [object Object] here and in the unhandledRejection handler at line 140. With a host that does not implement Target.getBrowserContexts (WebView2-like, simulated in a CDP proxy), both builds fail. main reports:
'Target.getBrowserContexts' wasn't found
This PR reports:
the chromium-bidi mapper exited (code 1): [object Object]
UniClipboard's webview2.mjs looks for the CDP method name in this text to decide that the host is unsupported, so with this message that check cannot work. Please serialize non-Error causes, for example their message field or JSON.stringify.
This has the same cause as my earlier setCookies comment: the mapper turns a CDP error object into a string. The fix for that comment replaces the [object Object] text in cookies.ts only (lines 58-63), so other paths still show it. If the error object is serialized where the mapper turns it into text, both cases are fixed, and the workaround in cookies.ts is not necessary.
| if (!isPlainObject(connect)) { | ||
| throw new ConfigurationError('INVALID_CONFIG', `web({ connect }) must be a plain object: { cdpEndpoint, context? }, got ${kindOf(connect)}`); | ||
| } | ||
| rejectUnknownKeys('web({ connect })', connect, ['cdpEndpoint', 'context'] satisfies (keyof WebConnectOptions)[]); |
There was a problem hiding this comment.
A config that still has reconnectEndpoint (nightly-labs/openbot scripts/provider-live/e2e.config.ts, UniClipboard apps/gui-go/e2e/tester-army-native/engine.mjs) gets:
INVALID_CONFIG: web({ connect }) has unknown key "reconnectEndpoint"; expected one of cdpEndpoint, context
The message does not say that the key was removed or what replaces it. Both projects use reconnectEndpoint only to attach to an Electron or WebView host, and for that context: 'existing' is the replacement. The removed video key (line 44) already names its replacement. Please give reconnectEndpoint the same kind of message, for example "reconnectEndpoint was removed; to drive the page an Electron or WebView host already shows, set context: 'existing'".
I checked the migration: in a reproduction of openbot's setup (Electron 45, viewport: null, app.command with readyUrl), the config with context: 'existing' typechecks and all tests pass, retries included.
| - Lightpanda no longer works: with `lightpanda()` or `connect` to a Lightpanda server, a test that opens a page times out. Run those targets on `chromium`. | ||
| - Moli reads a page but cannot act on it: with `moli()` or `connect` to a Moli server, an action on an element fails with `ACTION_FAILED` or `LOCATOR_NOT_FOUND`, and a screenshot throws `ENGINE_FAILURE`. Run those tests on `chromium`. | ||
| - `surfaceOf` and `PlaywrightLiveSurface` are removed, so there is no raw Playwright `Page` or `BrowserContext` to reach for. | ||
| - `browser.locator` takes CSS and XPath, alone or in `>>` chains: no `text=`, `nth=`, or other Playwright engines. Chain `nth()` and screen queries instead. |
There was a problem hiding this comment.
SakuraByteCore/codexmate builds its nav selectors with Playwright's :visible pseudo-class (tests/e2e-browser/web-ui.e2e.ts). 8 of its 10 tests pass on main and fail on this PR:
INVALID_LOCATOR: selector #side-tab-dashboard:visible, #tab-dashboard:visible is not a CSS or XPath selector
:visible is a pseudo-class, not an engine, so this line does not clearly cover it. screen.mdx:275 says that browser.locator has no :visible, but main's screen.mdx showed browser.locator('p:visible') as a form that works. Please name :visible here, and the other Playwright pseudo-classes (:has-text(), :text()), with the replacement.
The replacement also has a gap. screen.getByTestId(…, { visible: true }) works for codexmate's simple selectors (all 10 tests pass with it). But browser.locator takes no options and filter() has no visible, so a selector such as [data-nav][aria-current="page"]:visible (codexmate's activeNavItem) has no direct replacement.
| - `surfaceOf` and `PlaywrightLiveSurface` are removed, so there is no raw Playwright `Page` or `BrowserContext` to reach for. | ||
| - `browser.locator` takes CSS and XPath, alone or in `>>` chains: no `text=`, `nth=`, or other Playwright engines. Chain `nth()` and screen queries instead. | ||
| - `getByRole('textbox')` finds a `contenteditable` host whatever its tag, and the tag's own role no longer does: `getByRole('heading')` does not find an `<h1 contenteditable>`. `getByRole` also finds a control with only an icon by its `title`. A query that matched one node before can now match two. | ||
| - `connect.reconnectEndpoint` and `BrowserLease.reconnectEndpoint` are removed, and `reconnectEndpoint` in `connect` is `INVALID_CONFIG`: a dropped connection fails the attempt, and the next attempt attaches again through `cdpEndpoint`. A host that cannot create a browser context, such as an Electron app, takes `connect: { cdpEndpoint, context: 'existing' }` instead: the test drives the page the host already shows. |
There was a problem hiding this comment.
Three points about this line, from the openbot and xum checks:
- "the next attempt attaches again through
cdpEndpoint": the drop error isretryable: false(driver/connection.ts:143), soretriesdoes not run the failed test again. Only the next test attaches again. The sentence reads as if a retry would recover. context: 'existing'refuses a host that shows two tabs (UNSUPPORTED_CAPABILITY: cannot tell which tab … 2 are open … 2 of them are visible). On main, the same Electron app with a second window passed, because the first page was used.web.mdx:365documents the refusal, but this breaking-changes list does not. An Electron app with a helper window and no DevTools proxy breaks.- The Electron migration covers
connectonly. An attempt-scopeBrowserProviderthat returns an Electron endpoint now fails (see the comment onbrowser-source.ts).
|
|
||
| **Breaking:** the web engine drives Chromium and Firefox over WebDriver BiDi and no longer uses Playwright. Tests, fixtures, and `web()` options stay the same, except: | ||
|
|
||
| - WebKit is gone: `web({ browser: 'webkit' })` is `INVALID_CONFIG`. |
There was a problem hiding this comment.
open-mercato/cezar has configs where one target uses webkit and another uses chromium (e2e.manager-start.config.ts, e2e.build-reload.config.ts). On this PR the whole config is INVALID_CONFIG, so the Chromium target does not run either. Please say that one webkit target makes the whole config fail to load, so that users remove the target and not only expect it to be skipped. With webkit changed to chromium, manager-start passes 2/2 on this PR.
This is separate from the question in my previous review about a deprecation period for the WebKit removal. Whatever the answer to that question, this line should say what happens to the other targets in the config.
| | `connect` | `{ cdpEndpoint }` attaches to a remote Chromium over CDP; `cdpEndpoint` is required, and both it and `reconnectEndpoint` are resolvers `(signal) => url` or `(signal) => ({ endpoint, headers })` for authenticated CDP connections, not strings, else `INVALID_CONFIG` at load. With `reconnectEndpoint` it rides one persistent default context, needs a fresh browser from `cdpEndpoint` every attempt, and reconnects only to the original browser and page. | | ||
| | `headers` | Sent to the app's origin only (scheme, host, and port of `app.url`; Vercel's `x-vercel-protection-bypass`, ngrok's `ngrok-skip-browser-warning`), `agent.act` included; `credentialOrigins: ['https://api.example.com']` adds exact origins for `headers` and `basicAuth`. A request keeps them through its redirects, to any origin. Disables the browser HTTP cache and service workers. | | ||
| | `basicAuth` | `{ username, password }` for a `401` challenge from the app's origin, or one `credentialOrigins` lists (a redirect to `www` or `https:` is another origin; WebKit answers any origin when one is on a default port or an IPv6 host); `password` may be `secrets.get('name')`, resolved per attempt and redacted like any secret, the base64 `Authorization` credential too. | | ||
| | `connect` | `{ cdpEndpoint }` attaches to a remote Chromium over CDP; `cdpEndpoint` is a resolver `(signal) => url`, or `(signal) => ({ endpoint, headers })` for an authenticated CDP connection, not a string, else `INVALID_CONFIG` at load. A dropped connection fails the attempt and is reacquired at the next one. | |
There was a problem hiding this comment.
The connect row does not mention context: 'existing', which is now the only way to drive an Electron or WebView host. Two of the projects I checked (openbot, UniClipboard) need it. docs/reference/web.mdx documents it, but agents that follow this skill will not find it. Please add { cdpEndpoint, context: 'existing' } to this row, with what it does (it drives the page the host already shows, one worker, and refuses when two tabs are visible).
michal-e2e
left a comment
There was a problem hiding this comment.
Note
Drafted with AI (T3 Code, Claude Code, Codex; Claude Opus 5.5, with GPT-6.2 Astra, GPT-6.2 Sol and Claude Fable 5.2 as second readers), checked and posted by me.
Reviewed at 9bc0c61b0 (merge base 9d240ac95, main). Main's tip was a2d036312 when I last checked.
@okwasniewski, @kdy1's two reviews and 23 open threads at this same commit are still open (I did not rerun them), and I do not repeat them. This review adds what they do not cover: the merge with main, the core peer floor, saved sessions, masking on a tab opened before attach, uploads over connect, a browser left running after a hangup, and a scroll test that passes without the change it tests.
Must fix
-
Merge with main.
git merge-tree --write-tree a2d036312 9bc0c61b0stops on 39 conflicts (32 content, 7 modify/delete); main's newest commit, #1953 (the desktop engine), added two. Five of them are files this PR deletes and main has changed since the merge base. A rebase that keeps this PR's side drops main's work there without a conflict marker:- #1919 adds
blurto the engine contract (KNOWN_LOCATOR_ACTION_KINDS) and implements it inpackages/web/src/actions.ts. The BiDi engine declaresactions: LOCATOR_ACTION_KINDSanddriver/actions.tshas noblurcase, solocator.blur()on a web target stops working after the merge. - #1621 adds
web({ chromiumSandbox })(defaulttrue,falseon Linux) and launches Chromium with its sandbox. The new launcher always passes'--no-sandbox', andchromiumSandboxappears nowhere inpackages/web/srcat this commit. - #1957 changes
in-page/read-semantics.ts(presentational table and list roles), and #1976 names the engine handle types. - Release #1763 consumed
.changeset/bump-deps-2026-11-14.mdand.changeset/init-ci-workflow.md. This PR edits both, so keeping them would release those entries a second time.
Neither #1919 nor #1621 is released yet, so keep both APIs rather than listing them as breaks. Rebase, port
blurandchromiumSandboxto the BiDi driver, and drop the two consumed changesets. Add one test that runslocator.blur()through the new driver on Chromium and Firefox, and one that launches Chromium withchromiumSandbox: trueon macOS. - #1919 adds
-
Core peer floor.
packages/web/package.json:68declares"@e2e-dev/core": ">=0.23.2 <1". That range admits@e2e-dev/core@0.24.0, which is on npm and does not exportcreateResolverorcreateTextMatching; I checked its packeddist/engine/index.js.in-page/readers.ts:9imports both, so a project on core 0.24.0 that updates only@e2e-dev/webfails at import. Set the floor to the first core version that ships them. Main's tip already has">=0.24.1 <1": take it in the rebase if 0.24.1 is the release that carries this PR, otherwise use the version that does. -
Saved sessions from the current release no longer restore. See
packages/web/src/driver/state.ts:173. Your changeset says "Tests, fixtures, andweb()options stay the same, except:", and its list does not mention saved state. Meanwhiledocs/core.mdxtells users how "to keep a state between program runs". I exported a state withsaveState()andstate.export({ key })and restored the same bytes throughlaunch(), one run each:Exported on Restored on Result merge base merge base cookie and localStoragerestoredthis PR this PR cookie and localStoragerestoredmerge base this PR APP_NOT_OPEN: unsupported state format playwright-storage-state@1The old format string is
playwright-storage-state; the new one isbidi-storage-state. Fix it one of two ways:- Restore the old format (one way, untried: its cookies and per-origin
localStoragelook like they map onto the new shape). - Or add this bullet to
.changeset/web-bidi-only.md, and a matching sentence to the saved-state section ofdocs/core.mdx:
- A `SessionState` exported by an earlier `@e2e-dev/web` does not restore: `host.newSession({ state })` fails with `APP_NOT_OPEN` ("unsupported state format playwright-storage-state@1"). Sign in again and export a new state.
- Restore the old format (one way, untried: its cookies and per-origin
-
Masking on a tab that was open before attach.
packages/web/src/in-page/mask.ts:185leaves a password field uncovered when it sits in a closed shadow root that the page created before e2e attached:- Closed roots are found through the
attachShadowhook the preload installs, so a root made earlier is in no record.attach-browser.test.ts:156asserts exactly that for queries. - The mask and its check walk the same incomplete set of roots, so nothing reports the missed field:
app.screenshot()returned normally with it uncovered. - How I ran it. Chrome for Testing 157 headless was started on a page with two red
<input type=password>: one in the light DOM, one in a closed root. I then ranlaunch(web({ connect: { cdpEndpoint, context: 'existing' } }))andapp.screenshot(), once. The light-DOM field came back black (masked). The closed-root field came back red (not masked). Afterapp.open('/')in the same session, the preload ran and both came back black, so the gap is the document that was loaded before the attach. - Why it blocks. AGENTS.md requires masked pixels only when masking is proven, and failing closed when that cannot be enforced.
connect: { context: 'existing' }andattachBrowserare new in this PR and are built to drive a page that is already loaded. The old driver found closed roots the same way, so an attempt-scope provider whose page loaded before the lease may have had this gap too; I did not run that. - To what. Fail closed on an adopted document. Until a navigation runs the preload in that document, withhold pixels and evidence screenshots (
pixelsWithheld: 'MASKING_UNPROVEN', the reason core already has), and add the closed-root password field to the adopted-tab test with an assertion on that.
- Closed roots are found through the
-
Uploads over
connectto a browser on another machine.packages/web/src/driver/browser-source.ts:156givesconnectsourcesfiles: 'local'.setInputFilesthen sends this machine's paths, and a remote browser cannot read them.- Main. It attached with Playwright's
connectOverCDPwithoutisLocal, which marks the browser as not collocated (_isBrowserCollocatedWithServer = falsein playwright-core 1.65.1). Playwright then sent the files' bytes. - The changeset. It names the byte upload for "a browser provider's browser" only.
- Evidence. Read on both sides; not run, since it needs a browser on another machine.
- To what. Use
files: 'remote'for aconnectendpoint whose host is not loopback, or for everyconnect, as main effectively did. Add an upload test overconnectbesidetests/integration/chromium/provider-uploads.test.ts.attachBrowserand smol'sprepareshare this source.
- Main. It attached with Playwright's
-
A hangup leaves the browser running.
packages/web/src/driver/browser-watchdog.ts:116handlesSIGTERMandSIGINTonly.-
Why the browser outlives it. The browser runs in its own process group, so a terminal hangup does not reach it.
-
What I ran. I started the built watchdog on Chrome for Testing 157 with stdin held open and sent it each signal:
Signal Watchdog Chrome Profile directory SIGTERMexits killed removed SIGHUPexits still running left on disk -
What a user hits. Closing the terminal or losing the SSH session mid-run leaves one headless Chrome per worker.
-
Main. It launched through Playwright with
handleSIGINTandhandleSIGTERMoff andhandleSIGHUPat its default,true(read in playwright-core 1.65.1, not run), so a hangup closed the browser. -
To what. One line beside the other two:
process.on('SIGHUP', kill);
-
-
The scroll test passes without the change. The test is
packages/e2e/tests/integration/agent-scroll-settle.test.ts, "keeps paging a list that holds still while it loads its next page"; the code is atpackages/core/src/agent/action-dispatcher.ts:619. Your changesetscroll-until-load-pause.mdsays the list "counts as ended only once the screen stays unchanged for a second as well as three pages".- What I ran. With main's
action-dispatcher.tsput back on this commit, the test passes, 3 runs of 3 (load average about 7 to 10). I loggedresteach time the branch at line 619 was reached: the test never reaches it, and across all 42 tests in the five scroll test files it was reached 3 times, withrestat -2231, -2233 and -2234 ms. Mutants on lines 619 to 623 and onchangedAtalso survive every e2e unit test andengine-contract. - Why.
readScrolledPage(line 666, already on main) re-reads every page that has not moved for up toHELD_STILL_MS, one second. By the third still page more than a second has passed sincechangedAt, sorestis negative and the new wait does not run. The test's row arrives after 700 ms, inside the first beat, which main also waits. - To what. Either show a case main gets wrong (a list whose next page lands after the three beats and less than a second after the last change, if one exists) and test that, or drop the new code and the changeset.
- What I ran. With main's
Optional
packages/web/src/driver/network-decisions.ts:208: Basic auth answers byrecord.url ?? event.request.url.record.urlis the URL frombeforeRequestSent(network-binding.ts:345), andcontinue()never updates it afterroute.continue({ url })rewrites the request. The chromium-bidi mapper reports the rewritten URL onauthRequired.- So on Chromium, a route that rewrites an app request to an unlisted origin answering 401 sends that origin the app's credentials. One that rewrites to an origin listed in
credentialOriginsgets a 401 instead. - Playwright decided by the challenge's own origin. Read, not run.
- Prefer
event.request.url, or updaterecord.urlincontinue().
packages/web/src/driver/user-context.ts:260: withconnect: { context: 'existing' }, a target that grants a permission cleans up withBrowser.resetPermissions({}). That clears every override in the host's default context, including ones the host set itself. Read, not run. One way: refusepermissionson a borrowed context withUNSUPPORTED_CAPABILITY, asclearStateis refused there.packages/core/src/run/fixtures.ts:576:NS_ERROR_UNKNOWN_HOSTwas added for Firefox'sAPP_UNREACHABLE, but no test names it. Removing it passes every e2e unit test andengine-contract. Add it to theit.eachatengine-contract.test.ts:442, besideNS_ERROR_CONNECTION_REFUSED.packages/web/tests/types/connection.tslost its@ts-expect-errorlines forCdpTargetheaders. The types are still public (CdpTarget,BrowserProvider.cdpHeaders), so nothing pins them at compile time now. Put the lines back.
Verified
- CI is green at this commit. I took
check,test, the testbed on Chromium and Firefox,web (windows), the benchmarks and mobile from it, and did not rerun them. - I built the merge base and this commit in clean worktrees (macOS arm64, Node 26.13.1). Every run below is on those builds, one run each unless stated.
- Saved-session restore across versions, masking on an adopted tab, and the watchdog signals: the tables above.
web({ browser: 'webkit' })andconnect.reconnectEndpointareINVALID_CONFIGon this commit, as the changeset says.webkitwas accepted on the merge base.playwright-coreis no longer a dependency of@e2e-dev/web. It remains in the lockfile only asnotte-sdk's optional peer.- No wire schema or fixture changed (
git diff 9d240ac95 9bc0c61b0 -- packages/e2e/schemais empty).formatis a free string insession-v1andsession-state-v1, so the envelope stays valid; the break is the restore above. - Mutation testing, run with each mutant applied to
9bc0c61b0:- What was mutated. 16 places where this PR adds or changes a branch, a condition or a constant: those in
secrets.ts,action-dispatcher.ts,observation.ts,locator/engine.ts,run/fixtures.tsandrun/standalone.ts, plus three web places under a claim in the changeset or description. - Result. 19 mutants. 9 were killed by a failing assertion and 8 survived. I reran each survivor against the whole e2e unit project plus the scroll, contract and abort integration tests, at a load average of 7 to 25.
- Survivors:
- The new scroll wait's condition inverted, its "moved meanwhile" branch disabled (two forms), and
changedAtnever reset. These back the scroll finding above. NS_ERROR_UNKNOWN_HOSTremoved (optional above).- The saved-state format check removed, so no test pins which formats restore. That belongs with the saved-session fix.
perMessageDeflate: falseturned totrue. The description says compression is off, and no test pins it.- The live-hold preference in
secrets.ts, which this PR carries over from main unchanged.
- The new scroll wait's condition inverted, its "moved meanwhile" branch disabled (two forms), and
- Not counted. One mutant did not compile and was rewritten. Another, which makes
resolveUrlrequire an app URL again, failsattach-browser.test.tswith thatConfigurationErrorrather than an assertion. - Not mutated. The driver and in-page code, which I did not read in full, and
core/src/engine/resolve.tsandinternal/text.ts. I readresolve.ts: it movesresolveExpressionontocreateResolver, and a scope still searches strict descendants as it did on main, so mobile's rules look unchanged. - Firefox. The web mutants ran on unit and Chromium integration tests only, because Firefox is not installed here.
- What was mutated. 16 places where this PR adds or changes a branch, a condition or a constant: those in
Not run
- Most of the driver (
packages/web/src/driver/, 51 files, +11,082 lines) and of the in-page code (packages/web/src/in-page/, 17 files). I read the security paths (masking, secret fill, navigation, credentials, handshake headers) and sampled the rest; kdy1's threads cover much of that code. - Firefox by hand. The Firefox evidence is CI's.
- The 1,177 removed check lines the packet lists, line by line. I traced which deleted files moved and spot-checked five behaviors (readStyle
NODE_STALE,clearCookiesrefusals, focus lossNOT_ACTIONABLE, the handshake token kept out of errors, hidden frames). The rest is not traced. - Uploads over
connectto a remote browser: needs a browser on another machine. - Which of the new tests fail under some mutant: not measured, since mutants cover 16 places only and the PR adds hundreds of tests.
- The area scripts (
hazards.sh,docs_impact.py) and a full pass ofreview-triage.mdandMUSTHAVE.md: not run for this size; the public type diff (api-diff.sh, merge base against this commit) was run and matches the changeset (surfaceOf,PlaywrightLiveSurface,reconnectEndpointremoved;attachBrowser,connect.contextadded; the otherweb()options unchanged). - The benchmark table in the description: not rerun.
pnpm bench:abneeds a quiet machine, and this one was loaded.
For the maintainer
- Scope. Besides the driver, this PR carries seven other user-visible changes, each with its own changeset:
attachBrowser, smol'spreparebrowser, the scroll-until pause,vision: 'only'waits, exact operation timeouts, standalone-session secrets, and cookies withoutapp.url. Splitting them would make the rebase and the release notes easier to check. - smol imports the engine.
@e2e-dev/smolnow importsattachBrowserfrom@e2e-dev/webat runtime. AGENTS.md says an integration imports the engine's types only. - Lightpanda.
@e2e-dev/lightpandaships as apatchalthough it can no longer open a page. Deprecating it may say that better. - Questions still open. From the 2026-11-17 comment: were the breaks confirmed with the users who rely on WebKit,
surfaceOfandreconnectEndpoint, and is a 66% slower Firefox cold launch acceptable? kdy1 also asked whether the WebKit removal needs the six-month deprecation inCONTRIBUTING.md. - Firefox testbed. The Firefox testbed job runs with
--exclude-tag playwright, which leaves out the describe blocks taggedplaywrightin 32 test files (routes, downloads, frames, uploads, request continue and fulfill). The description's "Tests never skip a browser" does not cover those: the testbed skips them on Firefox. - Error code. A saved state the engine refuses reads
APP_NOT_OPEN, becauseINVALID_STATEis translated to it.SESSION_MISMATCHis the documented code for a stored session that does not match.
…ots (#2007) * fix(web): read content hidden under a closed details across shadow roots isInClosedDetails walked up with closest('details'), which stops at a shadow boundary, so a shadow tree under a closed <details>, or an element slotted into one, read as visible and passed toBeVisible(). It now walks the flat tree with flatParentOf, the change from #1503's f57eeb7. It knows a <details> and its first <summary> by name and the HTML namespace, so a <details> adopted from another frame still folds. isSkippedContent stepped up with assignedSlot, which is null for a slot in a closed root, so content slotted into a closed root under content-visibility: hidden read as visible. It now steps with flatParentOf too. slotOf, which the visibility walk now asks for every light child of a closed root's host, scanned every slot's assigned elements per element. It now reads a closed root's HTML slots once per read into a map, by exact slot name or, for a root that assigns by hand, by element. Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(web): fold and skip only what the browser hides, once per read A closed <details> folds its body when its ::details-content computes content-visibility: hidden, so a page whose CSS shows a closed body reads visible; without that pseudo element the open attribute decides. Its first HTML <summary> child is looked up once per read, so a wide <details> is walked once instead of once per child. content-visibility: hidden skips nothing on display: contents, an inline element, a table row or row group, or ruby text, which checkVisibility() reads as visible in Chromium. One predicate, skipsContents, answers that for isSkippedContent, the tree walk and directTextOf, so a control that reads visible is also in the agent's tree. The e2e-shown, e2e-read and e2e-label selector engines read each candidate in its own reader call. They now pass the reader one closed-slot map for a synchronous selector operation and drop it in a microtask, so a locator reads a closed root's slots once per operation, not per match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(web): drop the selector-operation slot cache, read slots plainly The e2e-shown, e2e-read and e2e-label selector engines are back to main: they no longer share a closed-slot map across the reads of one selector operation, which only paid off on contrived pages. Within one read, slotOf now maps each element a closed root's HTML slots hold to its slot from assignedElements, the browser's own assignment, instead of reimplementing named assignment. Comments are shorter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(web): skip content only where the box skips it, and find closed slots by name content-visibility: hidden skips nothing on a table, an inline table, ruby, or an inline list item, as Chromium paints them, and a closed <details> body laid out with ::details-content { display: contents } renders, so both read visible. An HTML <button> or <fieldset> makes a box of its own whatever its display, short of display: contents, so content under one reads hidden. In SVG only an outermost <svg> has a box for the property to act on: it skips whatever its display, and other SVG elements, a nested <svg> included, ignore it. In a closed root that assigns by name, slotOf finds an element's slot from its slot attribute, the first HTML slot of that name, both read outside any namespace, so a locator's read of one match never lists what the slots hold. A root that assigns by hand still reads assignedElements(). isInClosedDetails asks whether a <details> folds its body before looking for its summary, so an open one never looks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: michal-e2e <357875193+michal-e2e@users.noreply.github.com> Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
A data point for the open question about who depends on We use it from test-support code to collect V8 precise coverage per test. Each attempt gets its page through As of 9bc0c61 there is no public route to a CDP session on the attempt's target.
If neither is planned, could the changeset or Written with Claude Code on this account owner's behalf. |
Summary
@e2e-dev/webdrives Chromium and Firefox over WebDriver BiDi. Playwright is removed: noplaywright-coredependency, no WebKit, nosurfaceOf.chromium-bidimapper in a child process. No chromedriver or geckodriver.wswith compression off. Node 22's built-in WebSocket drops the Chromium connection on a CDP message over 4 MB, and Firefox closes a connection after that client's 4096th frame.connect: { cdpEndpoint, context: 'existing' }drives the page a host already shows, for one that can create no browser context (an Electron app). It replaces whatreconnectEndpointwas used for there.npx @e2e-dev/web install, each checked against a pinned SHA-256.credentialOrigins(fix(web)!: scope headers and basicAuth to the app's origin #1393), CDP handshake headers (feat(browser-run): add Cloudflare hosted browsers #1634),readStyle(feat(agent): read computed styles in project tools #1633), tabs (feat(web): tabs in the browser fixture, with switch_tab and close_tab agent verbs #1710), corelaunch(refactor: move e2e's core into @e2e-dev/core, and engines peer on it #1737), check through a covering label (fix(web): list a checkbox or radio its own label draws over no box #1595), screenshot retry after navigation (fix: page a list that appends at the end, and retry a screenshot after navigation #1614),toHaveRole(feat(expect): add toHaveRole locator matcher #1857), a download's suggested file name for provider reads (feat(notte): add @e2e-dev/notte, a browser provider for Notte cloud browsers #1726), and the Japanese and Chinese docs (docs(ja): translate all 81 documentation pages #1875, docs(zh): translate all 81 documentation pages into Simplified Chinese #1886): the 31 pages whose English this PR changes are updated in both.dragToon an HTML5draggabledropped nothing silently (nowUNSUPPORTED_CAPABILITY, bug 1515879).web (windows)CI job: launch, keyboard, and tabs on both browsers.What breaks is in
.changeset/web-bidi-only.md. Limits are indocs/reference/web.mdx.Benchmark totals (before the rebase; 20 warm / 10 cold iterations, M5 Pro, headless)
Firefox cold launch is slower: the Remote Agent holds
session.newuntil startup finishes (925 ms vs 314 ms), once per worker.Issue
Spike, no issue.
Verified
Ran it locally: yes
@e2e-dev/web: 2735 tests on Chromium and Firefox, 0 failures, on Node 24 and on Node 22.22.3. One env-gated skip: the crosscheck benchmark scenarios, which run inbenchmark.yml.route.fetch(), attach on a loaded tab, Electron 45.3.3, a consumer project withskipLibCheck: false): all pass.e2e4899 and core tests pass, and the 13 other packages' tests. Build, typecheck, oxlint, fallow, docs, plugin, MCP, peer-range, consumer-types, and changeset checks are clean.Checklist
pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only.!, the changeset body names what breaks and what replaces it.docs/**/*.mdxpage for the behavior, andskills/e2e/if the skill describes it..d.tsreviewed,tests/types/sdk-types.tsupdated; wire change edits the schema and both fixtures.e2e/engine): changesets fore2e,@e2e-dev/web, and@e2e-dev/mobile.