Repository navigation
feat(mcp): tell the agent to read the writing-tests guide before it writes a test - #1696
Conversation
…rites a test The server instructions and every open_session result now say to read e2e://guide/writing-tests (or npx e2e guide writing-tests) before writing or editing a test. ENG-1269
There was a problem hiding this comment.
All reported issues were addressed across 7 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
🟢 e2e web: 91 passedAll 91 tests in 41 files
Tested by e2e 0.23.0 · 1m 30s · web · run artifacts |
🟢 e2e web agent: 33 passed34 agent steps · 26 replayed from cache · 20 model calls · 88.5k tokens (94% cached) · $0.0036 All 33 tests in 5 files
Tested by e2e 0.23.0 · 1m 23s · web · run artifacts |
…ix its docs placement
🟢 e2e ios agent: 21 passed, 1 skipped25 agent steps · 12 replayed from cache · 57 model calls · 350.9k tokens (81% cached) · $0.0245 All 22 tests in 1 file
Tested by e2e 0.23.0 · 8m 29s · ios-simulator · run artifacts |
🟢 e2e android agent: 20 passed24 agent steps · 15 replayed from cache · 36 model calls · 190.9k tokens (88% cached) · $0.0103 All 20 tests in 1 file
Tested by e2e 0.23.0 · 5m 27s · android-emulator · run artifacts |
🟢 e2e ios: 1 flaky, 54 passed, 1 skipped
|
| Test | Time | |
|---|---|---|
| tests/device-fixture.e2e.ts · 1 flaky, 10 passed | 1m 42s | |
| 🟢 | device fixture › setAppearance flips the color scheme the app reads | 14.1s |
| 🟢 | device fixture › setOrientation rotates the window the app measures | 8.9s |
| device fixture › the clipboard reads back what was written (1 failed attempt first) | 6.2s | |
| 🟢 | device fixture › home leaves the app, openApp brings it back where it was | 8.1s |
| 🟢 | device fixture › closeApp then openApp relaunches on the home list | 7.8s |
| 🟢 | device fixture › closeApp leaves the next commands on the same device | 14.3s |
| 🟢 | device fixture › foregroundApp after closeApp reports the closed session as APP_NOT_OPEN | 7.9s |
| 🟢 | device fixture › device.back pops the scenario | 7.4s |
| 🟢 | device fixture › unstable_raw reaches the test session through agent-device | 5.5s |
| 🟢 | device fixture › setLocation and clearLocation change what the app reads | 11.2s |
| 🟢 | device fixture › enrollBiometrics and setBiometrics answer a biometric prompt | 11.0s |
| ⏭️ | tests/controls.e2e.ts · 23 passed, 1 skipped | 3m 13s |
| 🟢 | control inventory › a label query resolves a labeled text field | 10.5s |
| 🟢 | control inventory › a labeled field answers name, display value, value reads, fill, and clear | 20.6s |
| 🟢 | control inventory › a placeholder query and attribute reads find the field | 5.2s |
| 🟢 | control inventory › a secure field takes a fill and denies value reads | 8.5s |
| 🟢 | control inventory › press sends a character and Enter through the soft keyboard | 10.2s |
| 🟢 | control inventory › a field autofocuses on mount and focus() moves the focus | 18.2s |
| 🟢 | control inventory › toBeFocused follows the focus | 10.0s |
| 🟢 | control inventory › a switch checks, unchecks, and reports its state | 10.5s |
| 🟢 | control inventory › checkbox and radio roles answer getByRole, and a checkbox toggles by tap | 8.8s |
| 🟢 | control inventory › checkbox and radio roles check, uncheck, and report their state | 13.1s |
| 🟢 | control inventory › a radio group reports the checked option | 8.8s |
| 🟢 | control inventory › buttons report disabled, enabled, and a state that arrives later | 7.9s |
| 🟢 | control inventory › a display: none element is absent rather than hidden, its visible twin attached | 7.2s |
| 🟢 | control inventory › a header answers its accessible name | 4.4s |
| 🟢 | 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 | 7.2s |
| ⏭️ | 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 | 8.0s |
| 🟢 | control inventory › pointer verbs land at the point asked for | 9.8s |
| 🟢 | control inventory › an ambiguous locator fails at once | 5.9s |
| 🟢 | control inventory › screenshot, restart, and clearState reopen the app on its home list | 10.7s |
| 🟢 | refusals › verbs a device never declares are refused before the engine | 2ms |
| 🟢 | refusals › keys the soft keyboard cannot send are refused by the engine | 552ms |
| 🟢 | refusals › a missing locator fails as not found once its timeout passes | 1.1s |
| 🟢 | tests/device.e2e.ts · 3 passed | 1m 9s |
| 🟢 | sequential onboarding echoes the exact values | 43.2s |
| 🟢 | onboarding rejects a malformed email before advancing | 14.6s |
| 🟢 | dismissing the keyboard over choice controls leaves them as they were | 11.1s |
| 🟢 | tests/flows-lists.e2e.ts · 7 passed | 4m 15s |
| 🟢 | infinite scroll reaches the target item | 35.4s |
| 🟢 | product catalog adds exactly two of the right variant | 10.2s |
| 🟢 | gestures: long-press, then swipe left | 8.8s |
| 🟢 | sticky chrome: accept below the fold, then continue | 12.5s |
| 🟢 | async states: load, pull to refresh, claim through the toast | 11.6s |
| 🟢 | huge virtualized list reaches row 512 | 2m 45s |
| 🟢 | web view coupon form applies the code shown on the page | 11.7s |
| 🟢 | tests/flows.e2e.ts · 7 passed | 1m 9s |
| 🟢 | text inputs unlock the submit button | 12.9s |
| 🟢 | filled text inputs report their values | 10.1s |
| 🟢 | modal flow confirms through the native alert | 9.5s |
| 🟢 | bottom tabs act inside the last tab | 7.3s |
| 🟢 | error recovery retries, then confirms the delete | 9.3s |
| 🟢 | choice controls place the exact order | 8.3s |
| 🟢 | debounced search selects the target once results arrive | 11.5s |
| 🟢 | tests/login-form.e2e.ts · 3 passed | 48.5s |
| 🟢 | login form › rejects a malformed email | 14.1s |
| 🟢 | login form › rejects an unknown account | 14.1s |
| 🟢 | login form › signs in and logs out | 20.3s |
| 🟢 | tests/smoke.e2e.ts · 1 passed | 7.5s |
| 🟢 | home lists the scenarios and opens one | 7.5s |
Tested by e2e 0.23.0 · 7m 20s · ios-simulator · run artifacts
🟢 e2e android: 57 passed, 1 skippedAll 58 tests in 7 files
Tested by e2e 0.23.0 · 9m 5s · android-emulator · run artifacts |
An agent driving the app through
e2e mcpwould start writing a test without reading the writing guide. Before this change, the server mentioned the guide resources only at the end of its instructions, and many clients drop instructions or never read resources.One sentence,
READ_WRITING_GUIDE(packages/e2e/src/mcp/session.ts), now appears in two places: the server instructions, before "Write the test…", and at the end of everyopen_sessionsummary, above the first observation, test runs included.It names the resource and a shell fallback, for clients that can't read MCP resources:
Updated to match: workflow step 1 in
skills/e2e/references/mcp.md(plus the plugin copy) andopen_sessionindocs/reference/mcp.mdx. Includes a patch changeset fore2e.Linear: ENG-1269
Verified
Ran it locally: yes
e2e mcp(packages/e2e/dist/cli/bin.js), driven by an MCP SDK client. The testbed's port was held by another checkout's app, so I opened the session in engine mode from an empty directory against that running app.open_sessionresult both carry the line, and the resource it names resolves:tests/integration/mcp-server.test.tschecks for the line in both places; both checks fail on main.