Skip to content

Commit 2bb0565

Browse files
committed
e2e: replace browse/promote with a cli browser dev tool
The browse/promote pipeline (drive a flow, record it, codegen a test) was more scope than intended. Developing and testing are two uses of the same in-repo browser, not an auto-conversion between them. Replace it with `cli browser <target>`: spin up a persistent, logged-in Chromium pointed at the running instance (the same config the Browser test surface uses) and drive it with goto / click / fill / type / press / eval / look, or attach any CDP tool to the printed endpoint. A small detached daemon owns the browser (Playwright's pipe-based launch, so no flaky connectOverCDP) and serves drive commands over loopback. Developing with it and writing a scenario() are the same primitive, with no recording or codegen. Removes src/journey/ (steps/codegen/run) and the browse/promote CLI commands.
1 parent f173b2a commit 2bb0565

6 files changed

Lines changed: 388 additions & 758 deletions

File tree

e2e/AGENTS.md

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -130,37 +130,32 @@ When handing results to the user, follow the evidence contract in the root
130130
[AGENTS.md](../AGENTS.md) (direct run links + a live instance + what to try);
131131
[RUNNING.md](../RUNNING.md) has the current sharing/demo mechanics.
132132

133-
## Authoring from a live browser (`browse``promote`)
133+
## Driving the app while developing (`cli browser`)
134134

135-
You don't have to hand-write a browser scenario. Drive a running instance's web
136-
UI one step at a time, then turn the recorded journey into a committed scenario.
137-
The generated test drives the same Browser surface the exploration drove, so it
138-
is the real test, not a transcript of one — develop the flow, then crystallize
139-
it.
135+
The dev CLI can spin up a real browser pointed at a running instance and already
136+
signed in, so you can develop against the UI the way a test does. It is the SAME
137+
browser the `Browser` test surface uses (Chromium, dark mode, 1280x800, the
138+
identity's cookies), so developing with it and writing a `scenario()` are the
139+
same primitive: you drive it to figure the flow out, then write the scenario with
140+
those surfaces. There is no recording or codegen between the two.
140141

141142
```sh
142143
cd e2e
143-
bun run cli up cloud # a live instance to develop against
144-
bun run cli browse cloud goto / # each step REPLAYS the whole flow from a
145-
bun run cli browse cloud click link Policies # clean browser and prints the page's controls
146-
bun run cli browse cloud at-url /policies # (role · name) + a screenshot, so the next
147-
bun run cli browse cloud see "No policies yet" # step is written against what's actually there
148-
bun run cli promote cloud "Policies · a fresh workspace has none"
144+
bun run cli up cloud # a live instance
145+
bun run cli browser cloud up # logged-in browser, prints a CDP endpoint + page controls
146+
bun run cli browser cloud goto /policies # drive it; each verb prints the page's controls + a screenshot
147+
bun run cli browser cloud click "Add policy"
148+
bun run cli browser cloud look # re-read the page (url, title, controls)
149+
bun run cli browser cloud down # stop it
149150
```
150151

151-
Each `browse` replays every step so far, so what you are building is, at every
152-
moment, exactly what `promote` emits — a step that doesn't reproduce fails here,
153-
not in CI. Steps: `goto <path>`, `click <role> <name>`, `click-text <text>`,
154-
`fill <field> <value>`, `press <key>`, and the assertions `see <text>` /
155-
`at-url <substring>`. `--label "…"` names a step (it becomes the `step(...)`
156-
group); `browse <target> show | undo | reset` manages the journey.
157-
158-
`promote` writes `<target>/<slug>.gen.test.ts` and runs it against the live
159-
instance, producing the usual run artifacts (session.mp4, step screenshots,
160-
trace). A journey with no assertion is refused — a scenario must prove
161-
something. From then on the file is an ordinary scenario: edit it, add API/MCP
162-
checks, drop the `.gen` once it's yours. The journey itself lives in
163-
`.dev/<target>.journey.json` (gitignored), not the repo.
152+
Verbs: `goto <path>`, `click <text>` (matches a link/button by name, else any
153+
text), `fill <field> <value>`, `type <text>`, `press <key>`, `eval <js>`, `look`.
154+
`up --headed` shows a real window (for a human to watch); `up --no-org` signs in
155+
without an active org. The browser is a detached process that persists across
156+
calls; its state lives in `.dev/<target>.browser.json` (gitignored). Because it
157+
exposes CDP, you can also point any CDP-speaking tool (Playwright `connectOverCDP`,
158+
devtools, an agent's own browser automation) at the printed endpoint.
164159

165160
## Desktop targets (the app on real OSes, filmed)
166161

0 commit comments

Comments
 (0)