Skip to content

docs(mobile-visual-testing): update for @metamask/client-mcp-core 0.16.1 and @metamask/device-mcp 0.10.0 - #329

Merged
cryptotavares merged 3 commits into
mainfrom
cryptotavares/mobile-visual-testing-client-mcp-core-0.16.1
Dec 4, 2026
Merged

cryptotavares merged 3 commits into
mainfrom
cryptotavares/mobile-visual-testing-client-mcp-core-0.16.1

Conversation

@cryptotavares

@cryptotavares cryptotavares commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Summary: Updates testing/mobile-visual-testing for @metamask/client-mcp-core 0.16.1 and @metamask/device-mcp 0.10.0. Five claims in the skill are now wrong, the most important being that an ambiguous ref can tap another element. Each fix was checked against the v0.16.1 code and a live run.

Companion Mobile PR: MetaMask/metamask-mobile#41237. Previous update: #298 (Mobile #40496).

Problem

An agent that follows the current skill expects the wrong outcome in five places:

  • An ambiguous or label-only ref "can tap another element" (core #127). A click now taps the listed node at its bounds. The other target commands refuse such a ref.
  • An unknown command with no daemon "exits 3" (#126). It exits 2 before any daemon starts.
  • --timeout abc "is dropped without an error" (feat: init swaps render and network audit skill #126). It exits 2 once a daemon runs, and 3 without one.
  • iOS mm type <field> "" "exits 4 with MM_TYPE_FAILED" (#134, device-mcp 0.10.0). It exits 0.
  • The daemon log line "ends with the outcome" (#133). It now also names the target.

The cdp port order also gains the port that the consumer's launch resolved (#128).

flowchart TD
    S["describe-screen: node ref"] --> Q{"unique testId,<br/>label or text?"}
    Q -->|yes| ANY["every target command"]
    Q -->|"no: unnamed or ambiguous: true"| T{"command?"}
    T -->|click| B["tap at bounds, target ends in (bounds)"]
    B -->|element moved| NF["MM_TARGET_NOT_FOUND, nothing tapped"]
    T -->|"type, wait-for, get-text,<br/>scroll-to-element, long-press"| R["MM_TARGET_NOT_FOUND, exit 4, hint"]

    classDef new fill:#fff3cd,stroke:#d39e00
    classDef stop fill:#f8d7da,stroke:#c82333
    class B new
    class NF,R stop
Loading

Yellow boxes are new. Red boxes stop the command.

What changes

Area Before After
Refs (repos/metamask-mobile.md, cli-reference.md, error-recovery.md) Resolved again at tap time; ambiguous or label-only refs can tap another element; unnamed refs are Unknown a11yRef Unnamed and ambiguous refs work only with click (bounds tap, (bounds) target, MM_TARGET_NOT_FOUND when moved); other commands refuse them with a hint
"The tap opened another screen" row Cause: an ambiguous ref Cause: a substring --testid match or a stale ref
Expo dev menu close tap-coordinates only; the button "has no usable ref" mm click <ref> of the unnamed button, or tap-coordinates
Bad input Unknown command exits 3 without a daemon; non-numeric flag dropped Unknown command or bad launch value: exit 2, no daemon; --timeout abc: exit 2, or 3 without a daemon
iOS type "" Exit 4 MM_TYPE_FAILED, field cleared Exit 0, textLength: 0
cdp port Launch --metro-port or MM_METRO_PORT Launch --metro-port, else the port the launch resolved from MM_METRO_PORT, then HERMES_METRO_PORT, then 8081
Daemon log Outcome only Outcome and target (testid=, ref=, method=, …)

#137 (mm <command> --help) needs no change: the skill never told agents to avoid --help. The browser-only changes (#125, #129, #130, #131, #138, #139) do not apply.

Review: start with "Which refs work where" in repos/metamask-mobile.md.

Type of Change

  • New skill
  • Skill improvement/update
  • Bug fix
  • Documentation update
  • Other (please describe):

Checklist

  • I have read the CONTRIBUTING.md guidelines
  • My skill follows the SKILL_TEMPLATE.md format
  • I have tested this skill with an AI agent
  • My skill does not contain any secrets, private keys, or sensitive data
  • I have added appropriate documentation
  • My changes don't break existing skills

Testing

Sources and live run
  • Code: core tag v0.16.1 (src/platform/mobile-platform-driver.ts bounds refs and boundsRefError, src/cli/mm.ts parseIntFlag and the help check, src/tools/launch.ts applyHermesDefaults, src/server/request-log.ts), core SKILL.md at the tag, and the device-mcp 0.10.0 CHANGELOG.
  • Live, read only, real-funds wallet, Metro 8085, npm core 0.16.1 and device-mcp 0.10.0 with chore: upgrade to @metamask/client-mcp-core 0.16.1 and @metamask/device-mcp 0.10.0 metamask-mobile#41237, following only this skill. iPhone 17 Pro simulator: launch with MM_METRO_PORT=8085 and no --metro-port, then hermes-targets and cdp (sessionMetroPort: 8085, connected: true); unlock; hamburger menu, About, back; Explore search, type and type "" (exit 0, textLength: 0), back. Ambiguous and unnamed refs refused by get-text, wait-for, type, scroll-to-element, long-press and run-steps (exit 4 with a hint); click on an unnamed ref returned target: "a11yRef:e17 (bounds)"; error paths (exit 2, 3 and 0 for --help); daemon log targets. Android emulator Medium_Phone_API_36.1, login screen: the same cdp port, bounds click, refusals, type "" and --timeout abc.
  • Not run live: a bounds click after the element moved (code and core tests only).
  • yarn lint pass, yarn test 106/106 pass, yarn audit:skills 0 errors and 134 warnings (same as main).
Known gaps (not in this PR)

Additional Context

Merge this after MetaMask/metamask-mobile#41237.

seaona
seaona previously approved these changes Dec 4, 2026

@seaona seaona left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cryptotavares
cryptotavares merged commit 2120f1e into main Dec 4, 2026
29 checks passed
@cryptotavares
cryptotavares deleted the cryptotavares/mobile-visual-testing-client-mcp-core-0.16.1 branch December 4, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants