test: adapt FixureHelper to run with appium and local runs#29796
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c658438. Configure here.
|




Description
This PR adapts the FixtureHelper (
withFixtures) to work properly with appium and playwright.Main changes:
launchApputility insidewithFixturesnow sends launchArgs so that FixtureServer and other resources can properly be usedMockServeris completely tool agnosticadbandxcrunwith an abstract CommandHandlerPIXEL_XL_API_34is not translated in the proper serial asemulator-5554withFixtureshas been added to be used as a guide for debuggingbuildPathis not provided - Framework checks for installed app, deletes app data and launches the app. Throws if the app is not installed.buildPathis provided - App is uninstalled and installed back. Throws if the artifact does not exist.Introduction of test shims:
This PR also adds a Playwright-only Node shim so
FixtureBuildercan load in Playwright without changing app runtime behavior.We need this shim mechanism because some app dependencies patch CommonJS packages to call native modules such as
@metamask/native-utils. Those calls are valid in the mobile app, but Playwright loads the same dependency graph in Node where React Native/Nitro native modules are unavailable.Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
N/A
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Touches core E2E test harness startup/cleanup (app launching, fixture boot gating, and device commands) across both Detox and Appium, so failures could block large portions of the test suite despite being test-only code.
Overview
Adds first-class Appium/Playwright support to
withFixtures. App restarts now branch by framework: Detox continues usingTestHelpers.launchApp, while Appium launches viaPlaywrightUtilities.launchAppwith resolvedlaunchArgs(fallback ports, URL blacklist, mock/command/WS ports), optionally clears local app data, and waits for the app’s first/state.jsonfetch before running the test body.Introduces local device management commands for tests. Adds
DeviceCommandHandler(Androidadb, iOSxcrun simctl) and exposes it to test callbacks viaTestSuiteParams.deviceCommands, plus updates types accordingly.Improves Playwright Node compatibility and local ergonomics. Registers a Node-only CommonJS shim for
@metamask/native-utilsin Playwright entrypoints, adds Playwright-specific dev-screen dismissal flow, lowers Appium server log level to INFO, tweaks performance specs/config to use new activation/fixture patterns, and adds unit coverage forPlaywrightUtilities.launchAppand device command handlers.Reviewed by Cursor Bugbot for commit c658438. Bugbot is set up for automated code reviews on this repo. Configure here.