fix(aws): defer Android app launch until open - #2512
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
Add a regression test verifying that an explicit appium:autoLaunch: true override wins.
Pull request overview
Updates AWS Device Farm Android sessions to defer app launch until open.
Changes:
- Sets Android
appium:autoLaunchtofalse. - Preserves explicit capability overrides.
- Adds regression coverage.
File summaries
| File | Summary |
|---|---|
packages/provider-webdriver/src/aws-device-farm.ts |
Applies the Android deferred-launch default. |
packages/provider-webdriver/src/aws-device-farm.test.ts |
Tests the default behavior; add coverage confirming explicit true overrides remain effective. |
Review details
Suppressed comments (1)
packages/provider-webdriver/src/aws-device-farm.test.ts:138
- This regression test only exercises the default path. The merge order on lines 248–250 is the part that guarantees an explicitly configured
appium:autoLaunchvalue still wins, so add a case that passeswebdriverCapabilities: { 'appium:autoLaunch': true }and assertstrue; otherwise a future change that reverses the spreads would silently break the documented override behavior.
assert.equal(prepared.webdriverCapabilities['appium:autoLaunch'], false);
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
No code findings at fdab96c. The Android default reaches WebDriver session creation, explicit overrides still win, and open retains the later app activation. Before this is ready, please provide a live AWS Android run that allocates a session with autoLaunch=false, opens the requested package successfully, and cleans up the session; the capability-construction test does not prove that provider lifecycle. There are no conflicts, and GitHub currently reports no checks for this head. |
|
Live AWS Android verification completed against commit Device/app:
Lifecycle evidence from the provider Appium log:
AWS session ARN (no credential material): The device snapshot returned to the Xiaomi launcher after activation, but the Appium/ADB trace confirms that the requested installed package and its main activity were explicitly launched; importantly, session creation no longer waits for or is destroyed by that app lifecycle. |
|
The reported AWS run at fdab96c closes the provider-lifecycle validation gap: session creation used autoLaunch=false, explicit open and relaunch activated the installed package, and both WebDriver and AWS cleanup completed. The return to the launcher does not establish that the app stayed foregrounded, but the trace supports this session-creation fix. Code review remains clean and there are no conflicts; ready for human review. GitHub still reports no checks, so merge readiness is not established. |
Summary
AWS Device Farm Android sessions now create Appium with
appium:autoLaunch=falseby default. The existingopenlifecycle still activates the requested package after allocation, but first-run system activities can no longer make WebDriver session creation fail before agent-device gains control.This changes 2 files (+15/-1). Other providers and iOS behavior are unchanged; explicit internal capability overrides still win.
Validation
Tested commit
fdab96c27afe40bcd5432ed110ffc6353aee4686:pnpm check:affected --run— all runnable checks passedautoLaunchwas undefined) and passes after itGitHub remains authoritative for the listed live/device lanes.