Repository navigation
docs(core): drive a Mac app with @e2e-dev/core and desktop() (GTM-1179) - #2499
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Change: Other Merge Risk:
|
🟢 e2e web: 95 passedAll 95 tests in 43 files
Tested by e2e 0.25.0 · 55.7s · web · run artifacts |
🟢 e2e web agent: 34 passed35 agent steps · 26 replayed from cache · 25 model calls · 133.5k tokens (88% cached) · $0.0072 All 34 tests in 5 files
Tested by e2e 0.25.0 · 1m 28s · web · run artifacts |
🟢 e2e android agent: 1 flaky, 19 passed24 agent steps · 15 replayed from cache · 34 model calls · 254.2k tokens (80% cached) · $0.0193
|
| Test | Agent | Time | |
|---|---|---|---|
| tests-agent/scenarios.e2e.ts · 1 flaky, 19 passed | 24 steps · 34 calls | 5m 10s | |
| 🟢 | act completes Login Form | 1 step | 20.1s |
| 🟢 | act completes Infinite Scroll List | 1 step | 18.2s |
| 🟢 | act completes Modal Flow | 1 step | 9.5s |
| 🟢 | act completes Bottom Tabs | 1 step | 6.4s |
| 🟢 | act completes Text Input Variations | 1 step | 5.5s |
| 🟢 | act completes Broken Accessibility | 2 steps · 5 calls | 12.2s |
| 🟢 | act completes Vision Only | 2 steps · 1 call | 5.8s |
| act completes Gestures (1 failed attempt first) | 1 step · 7 calls | 16.1s | |
| 🟢 | act completes Async States | 1 step · 10 calls | 18.5s |
| 🟢 | act completes Debounced Search | 1 step | 6.5s |
| 🟢 | act completes Huge Virtualized List | 1 step | 1m 48s |
| 🟢 | act completes Flattened Registration Form | 2 steps · 1 call | 7.3s |
| 🟢 | act completes Flattened Login | 2 steps · 6 calls | 14.2s |
| 🟢 | act completes Sticky Chrome Target | 1 step | 8.6s |
| 🟢 | act completes WebView Accessibility | 1 step · 4 calls | 12.3s |
| 🟢 | act completes Permission Prompt | 1 step | 6.0s |
| 🟢 | act completes Product Catalog | 1 step | 7.6s |
| 🟢 | act completes Error Recovery | 1 step | 8.7s |
| 🟢 | act completes Choice Controls | 1 step | 8.3s |
| 🟢 | act completes Sequential Onboarding | 1 step | 9.4s |
Tested by e2e 0.25.0 · 5m 31s · android-emulator · run artifacts
|
Found 1 test failure on Blacksmith runners: Failure
|
🟢 e2e ios agent: 21 passed, 1 skipped25 agent steps · 12 replayed from cache · 54 model calls · 378.8k tokens (84% cached) · $0.0239 All 22 tests in 1 file
Tested by e2e 0.25.0 · 7m 52s · ios-simulator · run artifacts |
🟢 e2e android: 68 passed, 1 skippedAll 69 tests in 8 files
Tested by e2e 0.25.0 · 10m 22s · android-emulator · run artifacts |
🟢 e2e ios: 1 flaky, 66 passed, 1 skipped
|
| Test | Time | |
|---|---|---|
| tests/device-fixture.e2e.ts · 1 flaky, 14 passed | 2m 2s | |
| device fixture › setAppearance flips the color scheme the app reads (1 failed attempt first) | 9.3s | |
| 🟢 | device fixture › setOrientation rotates the window and viewport dimensions | 7.5s |
| 🟢 | device fixture › the clipboard reads back what was written | 6.4s |
| 🟢 | device fixture › home leaves the app, openApp brings it back where it was | 7.2s |
| 🟢 | device fixture › closeApp then openApp relaunches on the home list | 8.9s |
| 🟢 | device fixture › closeApp leaves the next commands on the same device | 12.5s |
| 🟢 | device fixture › foregroundApp after closeApp reports the closed session as APP_NOT_OPEN | 6.8s |
| 🟢 | device fixture › openLink opens the scenario a deep link names | 13.4s |
| 🟢 | device fixture › isAppInstalled finds the app under test and no app that is absent | 5.9s |
| 🟢 | device fixture › uninstallApp removes the app until installApp puts it back | 9.8s |
| 🟢 | device fixture › device.back pops the scenario | 6.0s |
| 🟢 | device fixture › unstable_raw reaches the test session through the raw driver | 4.3s |
| 🟢 | device fixture › setLocation and clearLocation change what the app reads | 10.2s |
| 🟢 | device fixture › enrollBiometrics and setBiometrics answer a biometric prompt | 9.9s |
| 🟢 | device fixture › pressButton is refused on an iOS simulator | 4.0s |
| ⏭️ | tests/controls.e2e.ts · 25 passed, 1 skipped | 3m 7s |
| 🟢 | control inventory › a label query resolves a labeled text field | 15.5s |
| 🟢 | control inventory › a labeled field answers name, display value, value reads, fill, and clear | 14.6s |
| 🟢 | control inventory › a placeholder query and attribute reads find the field | 4.5s |
| 🟢 | control inventory › getAttribute reads the label, resource id, and class an Appium suite asks for | 5.2s |
| 🟢 | control inventory › a secure field takes a fill and denies value reads | 7.7s |
| 🟢 | control inventory › press sends a character and Enter through the soft keyboard | 9.3s |
| 🟢 | control inventory › a field autofocuses on mount and focus() moves the focus | 10.2s |
| 🟢 | control inventory › toBeFocused follows the focus | 7.8s |
| 🟢 | control inventory › a switch checks, unchecks, and reports its state | 9.9s |
| 🟢 | control inventory › checkbox and radio roles answer getByRole, and a checkbox toggles by tap | 7.9s |
| 🟢 | control inventory › checkbox and radio roles check, uncheck, and report their state | 9.7s |
| 🟢 | control inventory › a radio group reports the checked option | 8.0s |
| 🟢 | control inventory › buttons report disabled, enabled, and a state that arrives later | 8.6s |
| 🟢 | control inventory › a display: none element is absent rather than hidden, its visible twin attached | 6.1s |
| 🟢 | control inventory › a header answers its accessible name | 4.2s |
| 🟢 | control inventory › a tab row answers count, all, texts, filters, positions, and switching | 6.2s |
| 🟢 | control inventory › a list answers counts, list-form text, reads, and boxes in order | 6.8s |
| ⏭️ | 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.3s |
| 🟢 | control inventory › tap({ count: 3 }) lands three presses | 8.4s |
| 🟢 | control inventory › pointer verbs land at the point asked for | 9.3s |
| 🟢 | control inventory › an ambiguous locator fails at once | 5.5s |
| 🟢 | control inventory › screenshot, restart, and clearState reopen the app on its home list | 11.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 | 246ms |
| 🟢 | refusals › a missing locator fails as not found once its timeout passes | 1.1s |
| 🟢 | tests/device.e2e.ts · 7 passed | 1m 18s |
| 🟢 | permissions all grants the microphone without a system dialog | 10.3s |
| 🟢 | sequential onboarding echoes the exact values | 24.9s |
| 🟢 | isKeyboardShown follows the keyboard up and through a dismissal | 7.7s |
| 🟢 | a control under the keyboard reads hidden and refuses a tap until the keyboard is dismissed | 9.7s |
| 🟢 | a shake is sent without an error and leaves the screen readable | 4.7s |
| 🟢 | onboarding rejects a malformed email before advancing | 9.3s |
| 🟢 | dismissing the keyboard over choice controls leaves them as they were | 11.0s |
| 🟢 | tests/flows-lists.e2e.ts · 7 passed | 4m 3s |
| 🟢 | infinite scroll reaches the target item | 34.3s |
| 🟢 | 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 | 12.6s |
| 🟢 | huge virtualized list reaches row 512 | 2m 31s |
| 🟢 | web view coupon form applies the code shown on the page | 13.2s |
| 🟢 | tests/flows.e2e.ts · 7 passed | 1m 8s |
| 🟢 | text inputs unlock the submit button | 12.4s |
| 🟢 | filled text inputs report their values | 10.7s |
| 🟢 | modal flow confirms through the native alert | 9.6s |
| 🟢 | bottom tabs act inside the last tab | 7.5s |
| 🟢 | error recovery retries, then confirms the delete | 9.3s |
| 🟢 | choice controls place the exact order | 7.2s |
| 🟢 | debounced search selects the target once results arrive | 11.2s |
| 🟢 | tests/login-form.e2e.ts · 3 passed | 44.2s |
| 🟢 | login form › rejects a malformed email | 12.3s |
| 🟢 | login form › rejects an unknown account | 12.5s |
| 🟢 | login form › signs in and logs out | 19.4s |
| 🟢 | tests/scroll-to.e2e.ts · 2 passed | 2m 54s |
| 🟢 | screen.scrollTo reaches the last row of the list and comes back to the first | 1m 45s |
| 🟢 | locator.scrollTo scrolls the list it names | 1m 9s |
| 🟢 | tests/smoke.e2e.ts · 1 passed | 9.0s |
| 🟢 | home lists the scenarios and opens one | 9.0s |
Tested by e2e 0.25.0 · 8m 30s · ios-simulator · run artifacts
okwasniewski
left a comment
There was a problem hiding this comment.
Automated review (AI triage pass), not yet read by a maintainer.
Reviewed 491ddb1ee. Docs-only: adds a "Drive a desktop app" section to the Core guide and desktop() rows to the Core reference; every API claim checks out against @e2e-dev/desktop on main, and the example is typechecked through check-docs-examples.
Verified:
@e2e-dev/desktop/engineexportsdesktopwithouttest(engine-entry.ts), ande2eis an optional peer (package.json), so "noe2eneeded" holds.INVALID_CONFIGrefusals (url, missing bundleId/appPath, permissions) match validateApp;launchArgumentsis honored (launchArgumentValues: true, L54).headedbrings the app forward:launchpasses it through (launch.ts:201) toforeground = physicalInput || info.headed(surface.ts:269). The no-background-window advice matches launch-wait.ts:94.desktop.windows()andwindow.title()exist (desktop.ts:20,49). The/desktop#set-up,/desktop#the-desktop-fixtureand/reference/desktoplinks resolve.- CI: Blacksmith's 2 failures are
tests/integration/test-step.test.ts("cuts the call running in a step as the timeout cuts any call"), the known runner test-step timeout flake. Attempt 2 of the same run on the same SHA passed, and a docs-only diff can't reach that test. All 42 checks are green.
Nits
- docs/reference/core.mdx:86 - the
INVALID_CONFIGrow leaves out the thirddesktop()refusal, anappPaththat isn't a.app(engine.ts:110). Theapptable mentions it, so this is optional. - docs/core.mdx Note -
/desktop#set-upopens withnpm install --save-dev e2e @e2e-dev/desktopande2e doctor. A Core reader may think the runner is required. Pointing at the permissions list is enough, or add "(thee2e doctorcheck needse2e)".
|
Thanks @okwasniewski. Both nits addressed in 93f05b3: the |
okwasniewski
left a comment
There was a problem hiding this comment.
Automated review (AI triage pass), not yet read by a maintainer.
Reviewed 93f05b307. Both nits are done: the INVALID_CONFIG row names the non-.app appPath refusal, and the Note says Core needs no e2e package. No must-fixes. The red test (22.22.3, runner) is the known runner test-step timeout flake (a docs-only diff cannot reach it); re-running failed jobs. Label goes on once green.
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 agents: coordinator: Claude Opus 5.5 (claude-opus-5-5), reviewer: GPT-6.2 Astra (gpt-6.2-astra), reviewer: GPT-6.2 Sol (gpt-6.2-sol), reviewer: Claude Opus 5.5 (claude-opus-5-5), reviewer: Claude Sonnet 5.5 (claude-sonnet-5-5)
Verdict: Approve
This review approves the pull request. The P3 items are optional and do not block the merge.
Reviewed commit: 93f05b307acbd133546e2caf6ec04688ec30925c
- P3 (non-blocking): 3 (3 inline)
| | `platform` | `string` | | ||
| | `browser` | [`Browser`](/reference/web), with `web()` | | ||
| | `device` | [`Device`](/reference/mobile), with `mobile()` | | ||
| | `desktop` | [`Desktop`](/reference/desktop), with `desktop()` | |
There was a problem hiding this comment.
P3 · Non-blocking · Other text on these pages still describes only web and mobile
Optional. This does not block the merge.
This row adds desktop() as a core target. Some text that is not in the diff still names only a browser and a device:
packages/core/README.md:98: theappoption reads "bundleIdorappPathformobile()".packages/core/README.md:100:headedreads "Show the browser window". This README goes to npm, and its first paragraph now says "or a Mac app".docs/reference/core.mdx:128: theplatformvalues areweb,ios,android, or a custom engine's label.desktop()is a first-party engine with platformmacos(packages/desktop/src/engine.ts:44).docs/reference/core.mdx:132:newSessionopens "one isolated browser context, or the app on the device".docs/core.mdx:207:saveState()is "Not supported on mobile devices." Adesktop()session also throws:UNSUPPORTED_CAPABILITY engine desktop has no state capability, so a session on it cannot be saved(run on a Mac at this head).
| | --- | --- | | ||
| | `INVALID_ARGUMENT` | The first argument is not an engine, or an option or `app` key is unknown. | | ||
| | `INVALID_CONFIG` | The engine refuses the app: `web()` without `app.url`, `mobile()` without `app.bundleId` or `app.appPath`. | | ||
| | `INVALID_CONFIG` | The engine refuses the app: `web()` without `app.url`, `mobile()` or `desktop()` without `app.bundleId` or `app.appPath`, `desktop()` with `app.url`, `app.permissions`, or an `app.appPath` that isn't a `.app` bundle. | |
There was a problem hiding this comment.
P3 · Non-blocking · INVALID_CONFIG covers only an appPath without the .app suffix
Optional. This does not block the merge.
This row says that INVALID_CONFIG is thrown for "an app.appPath that isn't a .app bundle". validateApp checks only the name suffix (packages/desktop/src/engine.ts:109). A path that ends in .app but has no Contents/Info.plist, for example an incomplete build, passes that check. Then init throws ENGINE_FAILURE (packages/desktop/src/surface.ts:300).
Run on the base and on this head: appPath: 'build/MyApp.apk' gives INVALID_CONFIG, and an empty build/Empty.app directory gives ENGINE_FAILURE. A program that handles the documented code does not catch the second case.
| The desktop engine is a prototype that runs on macOS 13 or later only. The | ||
| program that starts your script needs the Accessibility and Screen Recording | ||
| permissions: see [Desktop](/desktop#set-up). Core doesn't need the `e2e` | ||
| package; only the `e2e doctor` check on that page uses it. |
There was a problem hiding this comment.
P3 · Non-blocking · The Note asks for more than a core script needs
Optional. This does not block the merge.
- The Note says that the program needs both the Accessibility and the Screen Recording permissions.
initrefuses to start only when Accessibility is missing (packages/desktop/src/surface.ts:280). Filling fields, tapping, and reading windows work without Screen Recording, which is for screenshots.docs/desktop.mdx:40-41says "Screen Recording, for screenshots", and this Note does not keep that qualifier. - The
e2e doctorcheck on the linked page loads a runner config. In a core project withoute2e.config.*, it stops withCONFIG_NOT_FOUNDbefore it checks the desktop permissions (run on the base and on this head).
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-v2-3x.png)
What
The
@e2e-dev/coreguide has a "Drive a desktop app" section:launch(desktop(), { app: { appPath } })from@e2e-dev/desktop/engine, a session with adesktopfixture, and what to do for an app that opens no window in the background. The@e2e-dev/corereference now listsdesktop()wherever it listed onlyweb()andmobile().Why
@e2e-dev/desktop/engineexists so a@e2e-dev/coreprogram can drive a Mac app, but the Core guide only showed a browser and a device, and the reference saidbundleId,appPath, and the session fixtures were formobile()andweb()only. A reader had no way to find out it works.How it works
docs/core.mdx:170adds the section after "Drive an app on a device". Its example isdocs/examples/core/desktop.ts, registered inscripts/check-docs-examples.ts:34, so it typechecks against the built packages and the page copy can't drift. ANotelinks to/desktop#set-upfor macOS 13+ and the two permissions instead of repeating them.docs/core.mdx:195saysapp.open()launches in the background unlesslaunch({ headed: true }), and that an app with no background window needsheaded: trueordesktop({ physicalInput: true }). The engine's own error names--headed, a CLI flag a Core script doesn't have.docs/reference/core.mdx:headed(line 71) brings a desktop app to the front.INVALID_CONFIG(line 86) namesdesktop()'s refusals fromvalidateAppinpackages/desktop/src/engine.ts:98.apptable (line 91) addsdesktop()tobundleId,appPath(.apponly), andlaunchArguments.permissionsnow readsweb(),mobile(), sincedesktop()refuses it.desktoprow.packages/core/README.md, and the@e2e-dev/corerow of the rootREADME.mdsay "or a Mac app".The page title stays "Browser and device automation": renaming it moves the sidebar label and the page's search title for one engine.
Verified
Ran it locally: yes
@e2e-dev/core,@e2e-dev/desktop, its native driver, and the desktop testbed app (apps/desktop-testbed/build/SignInForm.app). Randocs/examples/core/desktop.tswith onlyappPathpointed at the testbed, from a scratch project that links@e2e-dev/coreand@e2e-dev/desktopand noe2e:launch({ secrets })password, checked the box, picked the plan, signed in. The status readSigned in as ada on Team, remembered (password: 7 characters).screen.tree()held no password, the screenshot painted the field black, a missing button threwLOCATOR_NOT_FOUND, and no app process was left afterawait usingclosed the host.headed: withheaded: falsethe frontmost app stayed Chrome, withheaded: trueit wasSignInForm.packages/desktop/src/launch-wait.ts:94anddocs/desktop.mdx), and a cleannpm installfrom the registry. The scratch project's symlinked packages could still reach the workspacee2e, though@e2e-dev/desktop/engineimports none of it.mainagainst this branch'sdocs/(E2E_DOCS_DIR=... pnpm dev). The section is new, so there is no before./docs/core, new section/docs/reference/core,apptableChecklist
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, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md).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.Summary by CodeRabbit
.apppath and interacting with windows and controls.