Commit Graph
64 Commits
Author SHA1 Message Date
Nguyễn Văn Hiếu b56e8ed525 docs(web): clarify media emulation tab scope (#1772) 2026-11-14 10:23:18 +00:00
Brendan Irvine-BroqueandOskar Kwaśniewski 352b774b33 feat(browser-run): add Cloudflare hosted browsers (#1634)
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
2026-11-13 08:46:31 +00:00
Donny/강동윤andClaude Opus 5.5 0920ef5f94 feat(web): tabs in the browser fixture, with switch_tab and close_tab agent verbs (#1710)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 17:00:57 +00:00
Krzysztof Moch 046bd08f4a fix(web)!: scope headers and basicAuth to the app's origin (#1393) 2026-11-12 08:49:48 +00:00
Xiangxuan Qu d1b0ff61c2 feat(e2e): add screen.doubleTapAt for viewport gestures (#1331)
* feat(web): add coordinate double-click to browser mouse

* test: handle Unicode checkout paths in hosted-session fixtures

* test(web): simplify double-click regressions after review

* feat(e2e): add screen.doubleTapAt for viewport gestures
2026-11-11 13:49:51 +01:00
Kacper Kapuściak df0795ae52 docs: name the authentication and session reuse guide (#1594) 2026-11-06 13:33:22 +00:00
Kacper Kapuściak f185ca8ba2 docs: retire sidebar page icons (#1582)
* docs: retire sidebar page icons

The docs sidebar no longer shows icons. Drop icon: from every page's frontmatter, delete the grey silhouettes in docs/images/icons/, and make check-docs-logos fail on any frontmatter icon instead of requiring one on vendor pages. Card logos stay required. The authoring-docs skill trades its Page icons section for a short Vendor logos one.

* docs: require a migrate overview card for each migration guide

* docs: match only top-level icon keys in check-docs-logos
2026-11-05 18:23:59 +00:00
Oskar Kwaśniewski 9267248c4c fix(web): browser.evaluate survives clobbered page globals (#1553) 2026-11-05 11:23:38 +01:00
Oskar Kwaśniewski 4e7e8b8412 fix(web): classify aborted navigations and capture screenshots across navigations (#1550) 2026-11-05 09:51:53 +01:00
Oskar Kwaśniewski d2953bb9bb feat(e2e): timeout 0 means no step deadline; settle by-design Playwright gaps (#1554) 2026-11-05 09:40:25 +01:00
Oskar Kwaśniewski 0c0469605a chore: replace e2e.tester.army with e2e.com (#1572) 2026-11-05 09:23:45 +01:00
4c44e44957 perf(web): make element handles for observed nodes when an action needs one (#1571)
* perf(agent): hash screenshots natively instead of byte by byte

pixelDigest looped over every byte of a screenshot in script (FNV-1a),
about 8 ms of event loop per megabyte, on every settle poll and screen
update that carries pixels. SHA-256 through node:crypto takes about
0.4 ms for the same megabyte and cannot read two screens as one on a
32-bit collision. The digest is only compared in memory, never stored.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* perf(web): make element handles for observed nodes when an action needs one

An observation created an ElementHandle for every listed node (up to
3000) and released them all when the next observation replaced it: one
CDP round trip each way per node, and about 100 ms of synchronous
event-loop time in RefRegistry.dispose at 3000 nodes. The reader already
returns its elements in one in-page array, so keep that array behind a
single handle (ElementList) and make a node's handle the first time an
action reaches for it. A ref still names the element the walk read; only
iframe boundary elements are fetched during capture, for contentFrame.

RefRegistry.lookup becomes async; dispatchLocatorAction takes an async
lookup for the second side of a drag. Disposing a generation releases
each list once. This is the "lazy element handles per observation"
follow-on #107 left out.

Observe on a 3000-node page: 360 ms -> 78 ms median (400 nodes:
57 -> 14 ms). A tap after a fresh observe is unchanged within noise.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(web): start no action when its ref resolves after the operation ended

An observed ref's element handle is now made on first use, so the lookup
can outlast the operation's deadline. Check the operation's signal after
the lookup, for the target and for the second side of a drag, so a handle
that arrives late dispatches nothing. Key the scripted handles in the
element-list tests by index so a lookup that read the wrong position fails.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* docs(web): describe list-backed observation refs in JSDoc

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
2026-11-05 07:46:35 +00:00
Oskar Kwaśniewski 40826e4705 fix(web): binary bodies, header deletes, and multiple set-cookie in route handlers (#1548) 2026-11-04 20:01:39 +01:00
Oskar Kwaśniewski 94e6e76548 feat(agent)!: keep model screenshots after a secret fill (#1437) 2026-10-28 19:11:24 -07:00
555e226dc5 feat(web): inspect upstream responses from route handlers (#1044)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
2026-10-28 17:32:28 -07:00
5879bfc6ba feat(web): clear selected cookies without resetting app storage (#1046)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
2026-10-28 17:32:17 -07:00
7f4475cef9 feat(web): collect multiple downloads from one trigger (#1048)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
2026-10-28 13:35:01 -07:00
Krzysztof Moch 3a841bb99e feat(web): grant browser permissions from a web target's app.permissions (#1429) 2026-10-28 13:33:46 -07:00
491199e589 feat(web): clear all browser fixture routes (#1041)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
2026-10-19 15:57:16 +02:00
f7c76720bf feat(web): expose native dialog kinds to handlers (#1050)
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
2026-10-17 15:40:10 +02:00
Kacper Kapuściak c304924e53 docs(reference): rewrite the API reference in the Next.js shape (#1197)
* docs(reference): rewrite the API reference in the Next.js shape

Every reference page now opens with a lede and a minimal example, groups its
API under ## sections that start with a summary table linking to one ###
entry per member, and keeps the TypeScript declarations under ## Types.

* docs(reference): fix claims the review caught

Narrow the security summary rows to their sections, generate the screenshot
file name in the engine example instead of building it from the label, and
correct defaults, exit codes, and examples on config, cli, screen, web,
mobile, test, runner, and engine.

* docs(reference): address review findings

Scope error classes to runner errors, guard a zero-slot prepare in the engine
example, keep the cli #help-and-version anchor, and correct poll cancellation,
same-run screenshots, openLink schemes, type_secret, longPress durations,
runner signals and close failures, empty usernames, and the feedback exit
code. Make the reporter and extract examples self-contained.

* docs(reference): trim the summary tables to the minimum

Each group's summary table keeps the linked name and one or two short
columns (type, default, or a few-word description). Examples and details
live in the entries; facts that only a table cell held moved into its entry.
The expect overview is headed Reference instead of Entry points, and the
security rules table names what each section covers instead of restating
its claims.

* docs(reference): open every page's API under one Reference heading

Each page's first section after the lede is now ## Reference. A page with
one group lists its entries at ### right under it; a page with several keeps
each group as a ### with its summary table and its entries at ####.
Explanatory sections (behavior, budgets, setup, types) follow it. Linked
sub-parts that moved to ##### keep their anchors through explicit ids.

* docs(skills): describe the reference page shape in authoring-docs

Reference pages open their API under ## Reference, keep summary tables to
the name and one or two short columns, and nest entries at ### or ####
because Mintlify drops anchors below ####. ship-pr points reference edits
at these rules instead of the guide shortening pass.

* docs(reference): address cubic review on tables and skill

Keep readonly in the mobile device type, show the keyboard and mouse
object shapes, say a locator assertion times out as ASSERTION_FAILED, and
give reference pages a narrower shortening pass in authoring-docs.

* docs(reference): tighten the reference pages

Merge facts said twice into one place, move each declaration's JSDoc to a
single home, link timeout defaults, key grammar, and secure-field rules to
the pages that own them, and split long sentences. No fact is cut.

* docs(reference): address cubic review of the tightening pass

Qualify the GitHub token for fork pull requests, provider recording URLs,
duplicate device entries, MODEL_UNAVAILABLE timing, the APP_UNREACHABLE log
quote, UNKNOWN_TOOL versus UNSUPPORTED_CAPABILITY, node-less agent tools,
which model receives screenshots, passing assert evidence, and config-path
hosts; fix three garbled sentences.

* docs(reference): say device, not simulator, for worker isolation
2026-10-16 14:41:30 +00:00
Piotr Pasztor de7afd6cf3 fix(web): reject connect without a cdpEndpoint resolver at config load (#1164) 2026-10-15 20:33:25 +02:00
Oskar Kwaśniewski 236611fafb docs: fix packaged docs against source, ship snippets, check anchors (#1168)
* docs: fix packaged docs against source, ship snippets, check anchors

* docs: tighten review wording, harden anchor check fences and ids

* docs: address review on tool errors, CLI failure output, anchor check

* docs(security): base64 is decoded in text downloads

* docs(telemetry): shorten the telemetry page (#1174)

* docs(telemetry): shorten the telemetry page

* docs(telemetry): engine versions are semver or unversioned

* docs(migrate): shorten the Playwright migration guide (#1172)

* docs(debugging): shorten the debugging guide (#1170)

* docs(auth): merge repeated secret facts on the signing-in page (#1169)
2026-10-15 17:56:13 +02:00
Rudy Mizrahi CelekliandOskar Kwaśniewski d863b52517 feat(web): support held keyboard keys and modifiers (#1042)
Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
2026-10-15 13:27:02 +02:00
Oskar Kwaśniewski 5a644cb79e test(web): stop asserting popup load-time media, a race (#1159) 2026-10-15 11:26:16 +02:00
Rudy Mizrahi Celekli edf3423641 feat(web): expose saved download absolute paths (#1043) 2026-10-14 19:00:09 +02:00
Kacper Kapuściak e6885dccb8 feat(skills): add migrate-to-e2e for moving a suite one slice at a time (#1109)
* feat(skills): add migrate-to-e2e, a slice-per-session migration skill

Ports a Playwright, Cypress, Selenium, Detox, or Maestro suite one slice per session, with a MIGRATION.md progress file the next session resumes from, reading the runner's migration guide first. Docs link it from each migration guide and the coding agents page.

* docs(skills): exempt retired tests from the resume check

* docs(skills): fix what a cal.com Playwright migration hit in migrate-to-e2e

Ran the skill on calcom/cal.com (425 Playwright tests in 60 files) through
the harness and one slice. Skill changes:

- Progress rows are per source file; a file splits into test rows only
  when its tests differ in status. Count tests with the runner's listing,
  not grep (grep found 291 of 425).
- The ported assertion count is at least the source's: a wait that fails
  on timeout becomes an assertion.
- A seed helper that imports the app's code is reused, and run in a child
  process with the repo's TypeScript runner when e2e's ES module loading
  rejects it (__dirname, CommonJS named exports, directory imports).
- app.command does not inherit the shell environment; load the old
  config's env file in the e2e config.
- Monorepos put e2e beside the source runner's config; Playwright's own
  *.e2e.ts names leave directories as the only separation.
- init's test:e2e script, skipped source tests ported in full, hidden
  test-id twins, and helpers the e2e suite still uses.

Guide rows: page.click(selector) and the other first-match page methods,
fixed storageState cookies, and the string rules of waitForURL (an exact
URL) and waitForResponse (a glob on the full URL, never resolved against
app.url).

* docs(skills): apply the fresh-context review of the cal.com fixes

- One mapped e2e assertion per source assertion, in steps 5 and 6 alike.
- The env file a config loads does not reach app.command; command.env does.
- Both collision directions, and playwright test --list counting per project.
- A skipped port says so in its row; clearer init script, hidden-copy, and
  helper-deletion wording.
- waitForResponse globs match the whole URL; the web reference lists the
  ? wildcard and the backslash escape.

* docs(skills): count a Playwright test listed under several projects once
2026-10-14 11:39:32 +02:00
Rei DodaandOskar Kwaśniewski ea0737f654 feat(web): add dark mode and reduced motion emulation (#1030)
* feat(web): add dark mode and reduced motion emulation

Set media preferences in config or tests so CSS rules use the requested settings. Keep them through restarts and reconnects.

Part of #1020.

* fix(web): preserve concurrent media updates and safe errors

Keep both preferences when media changes overlap. Report invalid values safely, including circular objects.

* fix(web): emulate media on tabs the app opens itself

A tab the app opened got only the configured media from context options, so a
test's emulateMedia change never reached it, and on a persistent context it
got nothing. The session now listens for each page the context opens and
emulates the attempt's current media on it, and emulateMedia reaches every
open tab. Docs and tests follow.

* fix(web): re-emulate media on the app's own tabs after CDP recovery

The new transport set media only on the attempt's page, so a tab the app had
opened lost it. Recovery now reapplies to every open tab. The popup test
also pins what the tab paints with: the configured values, since Playwright
emulates per page, and a test's change once it exists.

* fix(web): let a tab the app closes drop out of a media batch

Emulating on every open tab rejected the whole batch when a popup closed
meanwhile, which marked recovery failed with the attempt's page fine. The
attempt's own page still propagates; another tab's error counts only while
it is open.

---------

Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
2026-10-14 10:33:22 +02:00
Kacper Kapuściak 5d4053e8fa docs: render an Open Graph card for every docs page with @vercel/og (#1062) 2026-10-12 15:10:32 +02:00
Kacper Kapuściak 521988496e docs(security): split the security page into a short guide and a rules reference (#1008)
The guide answers what most readers ask: how secrets stay out of the model,
what can still leak, and what runs with your permissions. Every rule moves to
docs/reference/security.mdx. smol host-loopback access moves to the smol
page's warning. Fixes facts that no longer matched src/: defineTool errors are
INVALID_CONFIG, the CI cache default skips a cache.store, start-screen replay
matches routes, and outbound connections now list login, models, init, and the
smol image pull.
2026-10-09 13:13:28 +00:00
Rudy Mizrahi Celekli 0dffb3baad fix(web): dismiss an unanswered dialog when its handler throws (#889)
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
2026-10-08 13:45:49 +02:00
Oskar Kwaśniewski 1b92a6ddfa feat: e2e trace pages replace the Playwright trace (#869) 2026-10-07 11:28:27 +02:00
Kacper Kapuściak 63482bd6fe docs: reorganize the sidebar into platforms and a deep dive (#870) 2026-10-05 20:39:06 +02:00
Oskar Kwaśniewski 60bf04d576 fix(web): evaluate a browser.evaluate string as an expression (#860)
* fix(web): evaluate a browser.evaluate string as an expression

* docs(web): say evaluate returns a string's value and awaits a promise
2026-10-05 13:26:21 +02:00
Oskar Kwaśniewski 3b026fa81b feat(web): init scripts run before the page's own, from web({ initScripts }) or browser.addInitScript (#795)
* feat(web): init scripts run before the page's own, configured with web({ initScripts }) or added per test with browser.addInitScript

* refactor(web): one owner for configured init scripts, read beside the browser launch

* feat(web): export WebInitScript

* fix(web): settle the browser launch before a failed init-script read throws; docs examples compile

* fix(web): refuse sparse initScripts, keep an own __proto__ key in the init-script argument

* docs(web): seed Math.random in the init-script examples

* docs(web): trim init-script docs to what users need

* docs(skill): addInitScript takes arg with a function only
2026-10-03 22:25:15 +02:00
Oskar Kwaśniewski 02ad48a94e feat(web)!: pin playwright-core and add a browser install command (#798)
* feat(web)!: pin playwright-core and add an install command

@e2e-dev/web depends on playwright-core 1.63.0 instead of peering on
playwright. New e2e-web bin installs browsers for the pinned version:
npx @e2e-dev/web install chromium --with-deps. e2e init no longer adds
playwright.

* test(web): run the e2e-web bin for real, and in CI

* test(web): spawn the built e2e-web bin so Node 22.12 runs it
2026-10-03 22:22:20 +02:00
Oskar Kwaśniewski f88233fdce feat(web): locale and timezoneId options set the language and time zone every attempt runs in (#786)
* feat(web): locale and timezoneId options set the language and time zone every attempt runs in

* docs(web): timezoneId validation is best effort, the browser has the final word
2026-10-03 17:40:21 +02:00
Oskar Kwaśniewski cdc3a53e81 fix(web): continue skips earlier routes, decisions take or reject Playwright options (#723)
* fix(web): continue skips earlier routes, decisions take or reject Playwright options

continue went through Playwright fallback, so an earlier route answered. It now continues to the network, merging site headers itself; fallback() keeps chaining. continue takes url/method/headers/postData (url via resolveUrl), fulfill takes path/contentType; unknown options are INVALID_ARGUMENT. waitForResponse timeout bounds the match only; setCookies passes the resolved url.

* fix(web): route header overrides follow the web({ headers }) grammar

* refactor(web): route options reuse rejectUnknownOptions

* test(web): route url fake follows the http(s) navigation allowlist

* fix(web): fulfill keeps a content-type header over the json or path type
2026-10-03 13:54:37 +02:00
Oskar Kwaśniewski f0f9c8daae fix(security): allow only http(s) and about:blank on explicit navigation (#722)
* fix(security): allow only http(s) navigation, refuse wrapped schemes on device links

view-source:file:// passed the file:/data:/javascript: denylist and loaded local files via app.open, browser.goto, and the navigate verb. resolveNavigationUrl now admits http: and https: only; mobile links also refuse view-source:, blob:, filesystem:.

* fix(security): admit exact about:blank, sync rule text in AGENTS.md and SECURITY.md

* fix(web): refuse about:blank cookie URL, qualify scheme rule text
2026-10-03 13:16:39 +02:00
Oskar Kwaśniewski 84155791f7 fix(web): read each locate match in the task that finds it (#748)
* fix(web): read each locate match in the task that finds it

Locate queried matches, then read them in a later protocol call. A page
that replaces a match every frame detached it in between whenever a frame
passed, so on a starved runner every retry read a detached match and
the locate livelocked until the action timeout (LOCATOR_NOT_FOUND, node
became stale). The pinned label/display-value path had the widest gap.

A new e2e-read selector engine, appended to the projected locator, reads
each match inside the query and records the read on the element under a
per-locate token; locate takes the reads back from the returned elements
(or from the pinned handles). The detached-read plumbing is gone.

* fix(web): refuse a capture selector the locate read cannot follow

* test(e2e): starve the runner with Atomics.wait, not a spinning core
2026-10-02 13:24:59 +02:00
Oskar Kwaśniewski c6c39ad3f6 fix(expect): Playwright matcher options are honored or refused, never silently ignored (#579)
* fix(expect): matcher options are honored or rejected, never silently ignored

* refactor(web): reuse core rejectUnknownOptions, presence toHaveAttribute reads third arg

- e2e/engine exports rejectUnknownOptions; web drops its timeout-only copy
- toHaveAttribute(name, undefined, options) validates and times out on options
- waitForURL waitUntil refusal tested and noted in migration table

* docs(engine): rejectUnknownOptions takes code, options must be plain object

* fix(expect): toHaveAttribute refuses a null value or options; tests use the @e2e-dev scope

* fix(expect): use the browser fixture name after the web rename
2026-10-02 12:31:57 +02:00
Oskar Kwaśniewski 3dc4ec9614 feat!: browser fixture, getByRole name arg, toMatchSchema, top-level hooks, separate credential namespace (#704)
* feat!: browser fixture, getByRole name arg, toMatchSchema, top-level hooks, separate credential namespace

API review feedback before launch:

- web fixture renamed browser (Web -> Browser, WebExpectation ->
  BrowserExpectation); requires: ['browser']; destructuring web hints the
  new name. web() factory and other Web* types unchanged.
- getByRole(role, name, options?) beside the object form; MCP locate
  writes the short form.
- expect(value).toMatchSchema(standardSchema): sync, returns the typed
  output; poll resolves to it, soft returns undefined after a kept failure.
- describe, beforeEach, afterEach, beforeAll, afterAll exported from e2e;
  web and mobile export typed beforeEach/afterEach.
- credentials and secrets are separate namespaces: a password handle is
  <name>.password, secrets.get() never returns it. Committed recordings
  migrated offline (old key hash verified, then recomputed).
- runtime test.skip keeps Playwright semantics; docs say it throws.

* docs(web): browser acts on one active tab; cookies, routes, dialogs cover the whole browser

* fix(secrets): judge a fill's purpose by the config, not the handle; no old-name hints

A config-time secrets.get() handle reads its purpose from the run's
registry again, and authorizeSecretFill checks the registered purpose, so a
handle claiming generic-secret cannot put a password into a plain field.
Drop the web fixture migration hint. Changesets name the on-screen marker
change for replay entries.

* docs(skill): browser fixture, getByRole name arg, toMatchSchema, top-level hooks, credential namespace on the rewritten skill

* fix(expect): negated toMatchSchema returns nothing, as its type says

* fix(expect,docs): soft double negation stays soft, null ~standard is INVALID_ARGUMENT, Playwright samples keep Playwright's getByRole

Also documents SoftExpectCall, SoftValueExpectation, and NegatedPollExpectation
on the expect reference, requires: ['browser'] in the skill's options table,
and tightens the poll and secret-purpose tests.

* docs(babysit): triage pattern for scripted renames that rewrite another library's code

* docs: engine options take a secrets entry, web package hook exports, vault example imports

* refactor(secrets)!: credentials hold their password, allSecrets feeds fills; engines export describe and every hook; BrowserRoute, BrowserResponse

From the maintainability review:
- ResolvedConfig.secrets is the config.secrets entries only; a credential
  carries its password; allSecrets is the one map fills, the ledger, and
  redaction read. The per-consumer purpose filters and the .password
  suffix parsing are gone, and e2e mcp builds handles from config.
- The config load and a running test name the credential a missing
  secrets.get() most likely meant.
- @e2e-dev/web and @e2e-dev/mobile export describe and all four hooks
  beside test, so a test file registers from one import.
- WebRoute and WebResponse are BrowserRoute and BrowserResponse.
- getByRole normalizes its arguments once; isTextMatch is the one
  string-or-RegExp check; poll reuses ValueMatcherName.

* revert(web): keep WebRoute and WebResponse; Browser names the fixture, Web the network and option types
2026-09-30 20:58:52 +02:00
Oskar Kwaśniewski 4d488f8286 feat!: the app is declared on its target; engines only drive it (#698)
* feat!: the app is declared on its target; engines only drive it

The app under test moves from the engine's options to `targets: [{ engine,
app }]`: `url`, `bundleId`, `appPath`, `identity`, `environment`,
`launchArguments`, `permissions`, `command`, and `readyUrl`. `web()` and
`mobile()` refuse every moved option in one `INVALID_CONFIG` naming the
target block; `defineEngine({ app })` is gone and engines check what their
platform needs in `validateApp`. `requires: ['browser' | 'native-app']` is
derived from the target's app. Replay cache and session keys are byte for
byte what they were, pinned by target-identity.test.ts.

Dependency services are not part of this version: `services` anywhere, and
`web({ services })`, fail saying so. `app.command` on port 0 without a
command, and `reuseExisting` on a free port, are refused. An `e2e mcp`
open cancelled or disconnected mid-start stops what it started, and a hung
shared start is abandoned once no session waits on it.

* fix: review follow-ups: cancelled opens, abandoned starts, null targets, stale docs

* refactor: drop the moved-option messages; old app keys are unknown keys

* test: give the replaced-nodes suite a budget that survives a loaded runner

* test: size the replaced-nodes hook budget to its seven tests
2026-09-30 19:48:00 +02:00
Oskar Kwaśniewski f5bc45ac14 fix(web,kernel): Kernel downloads, crashed-worker leaks, icon-font names, and clearer attempt-scope limits (#669)
* fix(web): names read generated content and drop icon-font glyphs

The tree named <button><i class="fa fa-sign-in"> Login</i></button> "Login"
while getByRole read the ::before glyph and found nothing. Names now read
::before/::after content as accname, Chrome, and Playwright do; private-use
glyphs are dropped from the reported name, and a role query's string name
tolerates them in the browser's name.

* fix(web,kernel): waitForDownload works on a Kernel browser

A remote browser saves downloads to its own disk, so Playwright's saveAs
over CDP always failed with 'canceled'. BrowserProvider gains an optional
downloads { dir, read }: the engine points the context's downloads at dir
on the browser's machine and reads the finished file back. kernel()
implements it with the browser filesystem API. Without it, the failure
names the provider.

* fix(web): forward worker-side lease progress to the reporter

Attempt-scope and replacement leases were acquired with a discarded log,
so Kernel's live-view line never showed. Use the worker's init log.

* fix(web,kernel): sweep leases a dead worker left open

A worker killed mid-attempt in kernel({ scope: 'attempt' }) leaked its
browser until Kernel's timeout. BrowserProvider gains an optional sweep,
called once per target in finish after the held leases are released;
kernel() deletes every active browser tagged with the run and target.

* fix(web,e2e): name persistent-context limits early

app.clearState() in attempt scope said 'engine web does not implement it';
the engine now refuses it naming the mode. A session consumed on a target
without a state capability fails selection with COLLECTION_ERROR instead
of failing session.save() after the setup test logged in.

* fix(kernel): trim Kernel error messages; docs: attempt scope rules out userAgent

The SDK keeps the newline Kernel ends an error body with, splitting the
run's error line. Trim every SDK failure's message.

* fix(web): absolute downloads.dir; crosscheck spaces glyphs as the tree does

Also guards the provider-downloads test cleanup and notes in the changeset
that a role query by a glyph-only control's title finds nothing.
2026-09-30 14:40:47 +02:00
Oskar Kwaśniewski 10d392ea3c fix(config): follow-ups to the config redesign: output data loss, engine-held secrets, migration messages, agents (#662) 2026-09-30 14:04:23 +02:00
Oskar Kwaśniewski 0073644863 fix(config): refuse silent config mistakes: secret references as strings, nested unknown keys, directory globs (#670)
* test(skill): fail a skill or docs paragraph that passes the removed --artifacts

* fix(config): name the replacement for a removed createAgent import

* fix(config): keep the code of a config error raised while the config evaluates

* fix(secrets): refuse a secrets.get() reference where a string is needed

* fix(config): reject unknown keys in engine, command, test, and query options

* fix(config): refuse a tests entry naming a directory, name the ! entry excluding a positional

* refactor(config): derive option key lists from their types

* fix(config): one shared unknown-key check; drop undefined env values

Setup and describe option keys typed from their interfaces; a directory tests entry is INVALID_GLOB like a trailing slash.

* fix(collect): name the excluding ! entry when exclusions left nothing, and in on-disk casing

* fix(config): address review - exclusion hint for bare names, array env, qualified hints

* test(select): use a missing tmp root, not /root, which CI cannot stat

* fix(mobile): accept videoTouches, added on main by #671, in the mobile() key list

* fix(mobile): reject unknown permission names and states in mobile() and device.openApp

Names and states are checked against DevicePermission and PermissionState
through satisfies-typed key lists. INVALID_CONFIG at load, INVALID_ARGUMENT
from device.openApp, before any device command. rejectUnknownKeys takes an
optional code for the test-time case.

* fix(eas): reject unknown easSimulators() options with INVALID_CONFIG

Its options are its own, mapped onto EAS's create input, not a passed-through
SDK body, so a typo such as buildID was dropped silently. Its two other option
refusals are INVALID_CONFIG too. e2e is now a peer, for e2e/engine.

* fix(mobile): require a plain object for permissions; clarify eas and permission notes

A Map passed the object check with no own keys, and the preset applied none
of it.
2026-09-30 10:36:32 +02:00
Oskar Kwaśniewski 8904b02ab5 docs(reference): fix stale and missing claims, sync JSDoc (#655)
* docs(reference): fix stale and missing claims, sync JSDoc

* docs(reference): only the built-in agent needs a model to acquire the fixture
2026-09-29 22:53:18 +02:00
Oskar Kwaśniewski d7a218af07 feat(config)!: config shape, part 1: recording modes, output root, test-glob exclusions, renames, secrets in engine options (#645)
* feat(config)!: remove specVersion from the config

The runner version is the format version. A config that still sets
specVersion fails INVALID_CONFIG telling the author to remove it. The
report's run.specVersion and the replay cache key keep their hard-coded
copies.

* feat(collect): "!" exclusions in the tests globs

An entry starting with "!" removes files an including glob matched,
in any order. Discovery never reads a directory an exclusion takes
whole, unless an including glob could reach a dot name beneath it.
A list of only exclusions is INVALID_CONFIG.

* refactor!: CacheStore and web({ screencast }) renames

TraceCacheStore is CacheStore, and the docs, skill, and CLI call the
cache the replay cache. web({ video: { size, quality } }) is
web({ screencast }) with WebScreencastOptions; web({ video }) fails
INVALID_CONFIG naming screencast.

* feat(secrets): secrets.get() in engine options, resolved per attempt

At config evaluation, before any run exists, secrets.get(name) returns
a reference by name. An engine declares the handles its options hold
in defineEngine({ secrets }); the config load fails INVALID_CONFIG for
a name no secret or credential has. The engine reads the value through
EngineAttemptContext.resolveSecret, which runs a provider fresh and
registers the value in the session and process ledgers before it
returns, without tainting the viewport. e2e/engine exports isSecret.

web({ basicAuth: { password } }) takes a Secret and declares it. Docs
show process.loadEnvFile('.env') in the config.

* feat(run)!: trace and video share recording modes; artifacts holds only store

One RecordingMode ('off' | 'on' | 'retain-on-failure' | 'on-first-retry' |
'on-all-retries') for trace and video, set on the config, a target, the CLI
(--trace [mode], --video [mode]) and a test, one precedence rule: config,
target, CLI, test. Trace defaults to on locally, on-first-retry in CI, with
a plan-time notice when a retry mode meets retries: 0. Serial members cannot
set trace.

Capability rule: a mode from the config root or a flag applies to targets
whose engine can record it, one notice naming the rest; a mode set on a
target or a test is required and fails with UNSUPPORTED_ARTIFACT.

artifacts.kinds (both forms) and artifacts.trace are removed and fail
INVALID_CONFIG naming the trace mode they meant. Failure screenshot and
screen text are always captured when the engine can. MCP sessions keep the
target's trace mode and trace only under 'on'.

* feat(run)!: output directory for every run result; ArtifactStore.putLink

output (default .e2e) and --output <dir> on run and explore hold report.json,
junit.xml, summary.md, ai-trace.json, artifacts/, sessions/ and the e2e mcp
session files; --last-failed reads <output>/report.json. The reportSibling
derivation from the artifacts dir is gone. --artifacts stays as a hidden
flag that fails with the --output it maps to.

A run clears <output>/artifacts at start. cache.dir stays independent. An
output that is the project root or outside it, is or sits in cache.dir,
would hold cache.dir under artifacts/, sessions/ or videos/, or holds a
tests glob root fails INVALID_CONFIG with the reason.

ArtifactStore gains optional putLink(link) for provider-hosted video links;
its ref lands beside the url. A passed retain-on-failure attempt's link is
never handed over, and a failing putLink never fails the run.

bench-ab and the mobile workflow move to --output.

* test(secrets): a hold's registry is probed by an unknown name, now that get() defers without one

* test(web): the download trigger's measured wait tolerates a timer firing early

* fix(secrets): rewrite the trace of an attempt whose engine holds a secret

A Playwright trace records the context options, basic-auth password in
plaintext, but a trace was rewritten only after a fill. resolveSecret now
marks the session so its trace goes through the redactor, screencast
frames kept since the value never reached the screen. The fake engine
writes a real trace archive, and the basic-auth fixture escapes its echo
and refuses a malformed header.

* fix(web): race the basic-auth secret with the attempt's signal

A provider still resolving after the launch timeout set the session after
the runner ended the attempt, so the retry failed with an attempt already
running. Resolution now runs first, raced with the signal.

* fix(mcp): a session notes a configured trace its engine cannot record

* test: a shadow-free fake trace archive and an ungarbled exclusion title

* docs: output paths, replay cache wording, and review corrections

--last-failed, --ai-trace, and the json reporter name <output> paths;
the skill says output never moves cache/ or the app's log; the
INVALID_GLOB row states the check the code makes; serial members list
only; the engine vocabulary names Secret and isSecret; the basic-auth
example uses a provider; the last trace cache wording is replay cache.

* chore(changeset): leave released notes alone; pending notes match the renames

Released CHANGELOG entries keep TraceCacheStore, the name they shipped
with; cache-store-rename.md announces the rename. The pending video and
provider recording changesets name on-all-retries and web({ screencast }).

* chore(bench): refuse a forwarded --output the harness would not clean up

* fix(secrets): a rewritten trace drops its screencast frames, engine-held secrets included
2026-09-29 19:51:02 +02:00
Oskar Kwaśniewski aadcb5dddb feat(run)!: video modes on the config, targets, the CLI, and tests, with provider recordings (#610)
* feat(run)!: video modes on the config, targets, the CLI, and tests, with step captions

video: off | on | retain-on-failure | on-first-retry at the config root, per
target, --video [mode], and per test or describe, innermost winning.
artifacts.kinds: ['video'] and artifacts.video are removed. Kept recordings
get WebVTT step captions; a video can be a link to a hosted recording. The
engine contract's VideoSegment is a file or a link, and e2e/engine exports
the provider recording seam.

* feat(web): a browser provider records the attempts it serves, and the screencast takes a size and quality

BrowserProvider.record starts the service's own recording of the browser in
place of the page screencast. The session drives one AttemptVideo, the
screencast or the provider's. web({ video: { size, quality } }) tunes the
screencast.

* feat(mobile): a device provider records the attempts it serves

DeviceProvider.record starts the service's own recording of the leased
device in place of agent-device's. The worker learns its slot's lease id,
so record gets the lease as it traveled.

* feat(integrations): Kernel replays record the attempts that record video

* fix(run): captions never fail a video, provider values are normalized, and one list of modes

- Step captions create their directory and are best-effort.
- A provider's recording is checked at start in both engines and its URL
  and start time are stored in the shapes the report schema admits; the
  list reporter bounds a hosted URL.
- --video no longer hides an invalid target mode.
- A describe inside a serial group cannot set video.
- A mobile provider may keep its own leaseId field on a lease.

* fix(mobile): keep the lease type narrowed when checking its declared fields

* fix(run): MCP recordings get their step captions, a step spanning a restart is captioned in both recordings, and video.size refuses unknown keys

* fix: address review on the video API

- One stop in flight per provider recording, shared by a retry; mobile
  dispose stops it, and a cancelled operation never starts one.
- Kernel retries a failed download without stopping the replay twice.
- Links from any engine are held to an http(s) URL with a host; a file a
  provider names must be a regular file; media types are trimmed.
- web({ video }) takes a plain object only; the markdown page labels a
  hosted artifact by its kind.
- Tests: fixture byte totals, captions linked by id, temp directories
  removed, signals asserted, empty sizes, non-object options.
- Docs: engine support qualified, the explore row, the standalone preflight,
  caption status text, a checked stop in the provider example.

* fix(run): a bad engine video link costs no other recording, captions path per recording in debugging guide

* test: fake engine video links doc matches segment order

* fix(mcp): session recordings follow video modes and list a provider's link

* test(web): provider test's fake page reports its viewport

* refactor(run): drop step captions from the video API, tracked in #636

* fix(web): a late provider start never replaces a newer recording, abandon keeps a failed stop's handle, video.size must be a plain object; provider recording errors and hosted URLs bounded
2026-09-29 15:24:26 +02:00
Oskar Kwaśniewski 43769a2dc4 fix(web): setViewport works before the first navigation (#625) 2026-09-29 12:01:27 +02:00