From 6f0f7b9b652b60d31ee50d28c6411f8a36ddd29a Mon Sep 17 00:00:00 2001 From: cryptotavares Date: Thu, 3 Dec 2026 16:06:27 +0000 Subject: [PATCH 1/2] docs(visual-testing): update for @metamask/client-mcp-core 0.16.1 --- CHANGELOG.md | 1 + .../skills/visual-testing/references/cli-reference.md | 6 +++--- .../skills/visual-testing/references/error-recovery.md | 4 ++-- .../skills/visual-testing/repos/metamask-extension.md | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index efb6a3f2..c313dd3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Use the task-bound Harness for compact tool discovery in Recipe Cook. Verify the adapter and checkout at setup, then look up only the recipe or action needed. For a dev or fix-bug debrief requested directly in chat, identify the instruction or tool output that would have saved the most time. ([#311](https://github.com/MetaMask/skills/pull/311)) - Record Recipe Cook's final PR proof from the clean commit proposed for publication. Preserve the selected attempt's screenshot paths when Pretty PR packages evidence. ([#311](https://github.com/MetaMask/skills/pull/311)) +- Update `testing/visual-testing` for `@metamask/client-mcp-core` 0.16.1. `mm screenshot --selector` or `--frame` with `--timeout` waits that long for a missing element (without it, the command still fails after 2 s with `MM_TARGET_NOT_FOUND`), and the TradingView chart notes say that its canvas is in a nested iframe that `--frame` does not enter. ([#320](https://github.com/MetaMask/skills/pull/320)) - Update `testing/visual-testing` for `@metamask/client-mcp-core` 0.16.0. An unknown command or a bad `launch` value exits 2 with `MM_INVALID_INPUT`, a target that matches several elements fails with `MM_TARGET_NOT_FOUND`, `mm screenshot --selector` takes `--timeout` and fails after 2 s with `MM_TARGET_NOT_FOUND` when nothing matches, a `--frame` wrapper with one iframe resolves to that iframe, `mm mock-network requests` redacts URLs, and daemon log lines name the call's target. ([#316](https://github.com/MetaMask/skills/pull/316)) - Update `testing/visual-testing` for `@metamask/client-mcp-core` 0.15.0. Add `mm events mark`, `mm logs` and `mm network` with a per-flow recipe in place of `console.error` hooks and CDP network capture, `mm cdp --target sw` and `--fresh`, iframe refs and `--frame`, `mm screenshot --selector`, mock-network request bodies and service-worker, offscreen and snap matching, the hidden-checkbox `clickedLabel` click, the `ref` shorthand in `run-steps`, and the one timeout budget with `MM_QUEUE_TIMEOUT`. ([#297](https://github.com/MetaMask/skills/pull/297)) - Update `testing/mobile-visual-testing` for `@metamask/client-mcp-core` 0.15.0 and `@metamask/device-mcp` 0.9.0. Android taps on a covered target now fail with `MM_TARGET_OBSCURED`, `visible: false` now marks off-screen elements on Android too, `mm type ""` clears a field, and `mm cdp` reuses the launch Metro port over one persistent connection. The "Android `visible` is always `true`", "pass `--metro-port` on every `cdp` call" and `press-button back` keyboard workarounds are removed. The skill adds the slow-first-screen recipe (`wait-for` the new screen, do not tap again), the `run-steps` `ref` shorthand, the shared timeout budget with `MM_QUEUE_TIMEOUT`, the iOS tab bar that is not in the tree, and a warning that a mobile ref is resolved again at tap time and can tap another element with the same test ID or label ([#298](https://github.com/MetaMask/skills/pull/298)). diff --git a/domains/testing/skills/visual-testing/references/cli-reference.md b/domains/testing/skills/visual-testing/references/cli-reference.md index 03972e7f..3295ffad 100644 --- a/domains/testing/skills/visual-testing/references/cli-reference.md +++ b/domains/testing/skills/visual-testing/references/cli-reference.md @@ -166,7 +166,7 @@ All interaction commands accept `--timeout ` (default 15000). This is a **si | Target found but not clickable | `MM_CLICK_TIMEOUT`, exit 5, after the full timeout (15 s by default). The message ends with Playwright's last step | | Target matches several elements | `MM_TARGET_NOT_FOUND`, exit 4, at once: `strict mode violation … resolved to elements`. Nothing is clicked. Scope it with `--within` or use a ref | -On a target that matches nothing, only `mm click` and `mm screenshot --selector` fail fast. `wait-for`, `type`, `hover`, `inspect` and `scroll-to-element` wait the full timeout. A missing `--within` parent also waits the full timeout. A target that matches several elements fails at once with `MM_TARGET_NOT_FOUND` in every command that takes a target. +On a target that matches nothing, only `mm click` and `mm screenshot --selector` (or `--frame`) fail fast, and only without `--timeout`. `wait-for`, `type`, `hover`, `inspect` and `scroll-to-element` wait the full timeout. A missing `--within` parent also waits the full timeout. A target that matches several elements fails at once with `MM_TARGET_NOT_FOUND` in every command that takes a target. A `MM_CLICK_TIMEOUT` message ends with `(last Playwright step: …)`, which says why: @@ -205,7 +205,7 @@ mm screenshot --name chart --frame e13 mm run-steps '{"steps":[{"tool":"screenshot","args":{"name":"viewport","fullPage":false}}],"observe":"none"}' ``` -The result has the file `path`, `width` and `height`. A selector that matches no element within 2 s fails with `MM_TARGET_NOT_FOUND` (exit 4), also with a longer `--timeout`; to capture an element that appears later, `mm wait-for` it first. An element that is in the page waits up to `--timeout` (default 15000) to become visible; if it stays hidden, the command fails with `MM_SCREENSHOT_FAILED` (exit 1). +The result has the file `path`, `width` and `height`. Without `--timeout`, a selector or frame that matches no element fails after 2 s with `MM_TARGET_NOT_FOUND` (exit 4). With `--timeout`, the command waits that long for it to appear, so pass one when the screen is still loading. An element that is in the page waits up to `--timeout` (default 15000) to become visible; if it stays hidden, the command fails with `MM_SCREENSHOT_FAILED` (exit 1). ### Iframes @@ -220,7 +220,7 @@ mm wait-for --frame testid:advanced-chart-iframe --selector body # the wrapper - A `testid:` or `selector:` frame that is not an iframe but holds exactly one iframe resolves to that iframe; the command waits for it like any target. On the Extension asset page the `advanced-chart-iframe` testId is on such a wrapper `
`. A wrapper with several iframes fails at once with `MM_TARGET_NOT_FOUND`; one with no iframe fails with it after the wait. - A missing frame on `describe-screen --frame` fails after 5 s with `MM_TARGET_NOT_FOUND` (`Frame not found: no iframe matches …`); on `get-text` / `wait-for` it waits for the full `--timeout`. - `--frame` with a ref target is `MM_INVALID_INPUT` (exit 2): `f1e*` refs already point into their iframe. `scroll-to-element` and `long-press` reject `--frame`. -- A canvas-only iframe (the TradingView chart) has no accessibility nodes, so `describe-screen --frame` returns `nodes: []`. Use `mm screenshot --frame` and `get-text --frame … --selector body`. +- `--frame` enters one iframe level. The TradingView chart draws its canvas in an iframe nested inside the chart iframe, so `describe-screen --frame` returns `nodes: []` and `--selector canvas` matches nothing. Target the nested iframe element (`--selector iframe`) or `#tv_chart_container`, and use `mm screenshot --frame` and `get-text --frame … --selector body`. - `mm inspect --frame` on the chart iframe failed with `MM_INSPECT_FAILED` (`Playwright did not report the element it resolved`). Use `get-text` or a screenshot there. - `list-testids` and the `testIds` list cover the page only. Iframes inside iframes are not read. diff --git a/domains/testing/skills/visual-testing/references/error-recovery.md b/domains/testing/skills/visual-testing/references/error-recovery.md index 926968fd..06da7cce 100644 --- a/domains/testing/skills/visual-testing/references/error-recovery.md +++ b/domains/testing/skills/visual-testing/references/error-recovery.md @@ -40,7 +40,7 @@ Success has no `ok` field, and `mm stop` prints plain text. For the exact JSON s | `MM_NO_ACTIVE_SESSION` | No session — `mm launch` first | | `MM_LAUNCH_FAILED` | Browser launch failed | | `MM_INVALID_INPUT` | Invalid parameters or flag; nothing ran | -| `MM_TARGET_NOT_FOUND` | Element not found, or a selector or testId matches several elements (strict mode violation, at once); a click without `--timeout` and `screenshot --selector` fail after 2 s, a stale ref at once — `mm describe-screen` | +| `MM_TARGET_NOT_FOUND` | Element not found, or a selector or testId matches several elements (strict mode violation, at once); a click or `screenshot --selector` without `--timeout` fails after 2 s, a stale ref at once — `mm describe-screen` | | `MM_TAB_NOT_FOUND` | Tab not found | | `MM_CLICK_FAILED` | Click failed (post-find) | | `MM_CLICK_TIMEOUT` | Click timed out; state unknown; the message ends with Playwright's last step — `mm describe-screen` before retrying | @@ -92,7 +92,7 @@ Success has no `ok` field, and `mm stop` prints plain text. For the exact JSON s | A ref clicks the wrong element | After `--observe none`: a fallback `role=`/`text=` or icon-button ref | `mm describe-screen`, or target by `--testid` | | Ref click fails at once with `MM_TARGET_NOT_FOUND` | Removed, re-mounted or changed text after the snapshot | Expected; `mm describe-screen` and re-target | | `MM_TARGET_NOT_FOUND`: strict mode violation (exit 4) | A fallback ref or an explicit selector/testId matches several elements; nothing was done | Target by `--testid`/`--selector`; scope it with `--within` | -| `MM_TARGET_NOT_FOUND` after 2 s on `mm screenshot --selector` | No element matches the selector | Check `mm describe-screen`; if it appears later, `mm wait-for` it before the screenshot | +| `MM_TARGET_NOT_FOUND` after 2 s on `mm screenshot --selector` | No element matches the selector (wrong or not rendered yet) | Check `mm describe-screen`; if the screen is still loading, retry with `--timeout ` | | `MM_QUEUE_TIMEOUT`: `The daemon stopped the request after 30000ms` (exit 5) | A command with no action timeout ran past the queue limit, for example `run-steps` without `batchTimeoutMs` whose steps take longer | `mm describe-screen` before retry; add `batchTimeoutMs` or split the batch | | `MM_TARGET_NOT_FOUND`: `Frame not found: …` or `strict mode violation` on `--frame` (exit 4) | The `--frame` ref is not an iframe, or the testId/selector is not an iframe and holds zero or several iframes | Use the iframe's ref from `mm describe-screen`, or a selector that matches one iframe | | `MM_INVALID_INPUT`: `frame cannot be used with a ref` (exit 2) | `--frame` plus a ref target | Drop `--frame` (`f1e*` refs point into the iframe), or target by `--testid` / `--selector` | diff --git a/domains/testing/skills/visual-testing/repos/metamask-extension.md b/domains/testing/skills/visual-testing/repos/metamask-extension.md index e5d9ab7f..3ad593b7 100644 --- a/domains/testing/skills/visual-testing/repos/metamask-extension.md +++ b/domains/testing/skills/visual-testing/repos/metamask-extension.md @@ -192,7 +192,7 @@ Phase-specific error codes on timeout: - `MM_GETTEXT_TIMEOUT` — the element did not appear or `textContent()` hung. `retryable: true`. - `MM_PAGE_CLOSED` — page closed during action (expected for some confirmation flows); exits 3. - `MM_QUEUE_TIMEOUT` — the daemon stopped a command that has no action timeout after about 30 s, for example a `run-steps` batch without `batchTimeoutMs` whose steps take longer. State unknown. -- `MM_SCREENSHOT_FAILED` — the `mm screenshot --selector` element is in the page but stays hidden for `--timeout` (default 15000); exit 1. A selector that matches nothing fails after 2 s with `MM_TARGET_NOT_FOUND`, even with a longer `--timeout`: `mm wait-for` an element that appears late first. +- `MM_SCREENSHOT_FAILED` — the `mm screenshot --selector` element is in the page but stays hidden for `--timeout` (default 15000); exit 1. Without `--timeout`, a selector that matches nothing fails after 2 s with `MM_TARGET_NOT_FOUND`; pass `--timeout` to wait for an element that appears late. For the full error code and exit code tables, see [references/error-recovery.md](references/error-recovery.md). @@ -292,7 +292,7 @@ The review page shows `confirm-send-amount` and `recipient-address`. While it lo ## Iframes -The asset page shows the TradingView chart in a cross-origin iframe when the `tokenDetailsAdvancedCharts` remote flag is on and the candle chart is selected. Both are off in the e2e fixture. To show it there: mock the candles with `mm mock-network add` on `GET https://price.api.cx.metamask.io/v3/ohlcv-chart/**` (JSON `{"data":[{"timestamp":,"open":…,"high":…,"low":…,"close":…,"volume":…},…],"hasNext":false,"nextCursor":null}`), `mm click --testid multichain-token-list-button`, then write Redux state ([operation 3](references/state-manipulation.md#five-operations)) with `next.remoteFeatureFlags.tokenDetailsAdvancedCharts = true` and `next.preferences.tdpChartType = 1`, and `mm wait-for --testid advanced-chart-iframe`. Without the mock the chart shows no data. `mm describe-screen` lists it as `{"role":"iframe","name":"Advanced Chart"}`. The `advanced-chart-iframe` testId is on a wrapper `
` that holds the iframe, so `--frame testid:advanced-chart-iframe` resolves to that iframe. The chart draws on a canvas, so it has no accessibility nodes: use `mm screenshot --frame `. See [Iframes](references/cli-reference.md#iframes). +The asset page shows the TradingView chart in a cross-origin iframe when the `tokenDetailsAdvancedCharts` remote flag is on and the candle chart is selected. Both are off in the e2e fixture. To show it there: mock the candles with `mm mock-network add` on `GET https://price.api.cx.metamask.io/v3/ohlcv-chart/**` (JSON `{"data":[{"timestamp":,"open":…,"high":…,"low":…,"close":…,"volume":…},…],"hasNext":false,"nextCursor":null}`), `mm click --testid multichain-token-list-button`, then write Redux state ([operation 3](references/state-manipulation.md#five-operations)) with `next.remoteFeatureFlags.tokenDetailsAdvancedCharts = true` and `next.preferences.tdpChartType = 1`, and `mm wait-for --testid advanced-chart-iframe`. Without the mock the chart shows no data. `mm describe-screen` lists it as `{"role":"iframe","name":"Advanced Chart"}`. The `advanced-chart-iframe` testId is on a wrapper `
` that holds the iframe, so `--frame testid:advanced-chart-iframe` resolves to that iframe. The chart draws on a canvas in a nested iframe, which `--frame` does not enter, so it has no accessibility nodes: use `mm screenshot --frame `, and target the nested iframe with `--selector iframe`. See [Iframes](references/cli-reference.md#iframes). ## Batching with mm run-steps From 316ca1af76b561c9e2892d8aabcc55ddb3a8a08f Mon Sep 17 00:00:00 2001 From: cryptotavares Date: Thu, 3 Dec 2026 16:07:45 +0000 Subject: [PATCH 2/2] docs(visual-testing): link the 0.16.1 changelog entry to #328 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c313dd3e..4bab31e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Use the task-bound Harness for compact tool discovery in Recipe Cook. Verify the adapter and checkout at setup, then look up only the recipe or action needed. For a dev or fix-bug debrief requested directly in chat, identify the instruction or tool output that would have saved the most time. ([#311](https://github.com/MetaMask/skills/pull/311)) - Record Recipe Cook's final PR proof from the clean commit proposed for publication. Preserve the selected attempt's screenshot paths when Pretty PR packages evidence. ([#311](https://github.com/MetaMask/skills/pull/311)) -- Update `testing/visual-testing` for `@metamask/client-mcp-core` 0.16.1. `mm screenshot --selector` or `--frame` with `--timeout` waits that long for a missing element (without it, the command still fails after 2 s with `MM_TARGET_NOT_FOUND`), and the TradingView chart notes say that its canvas is in a nested iframe that `--frame` does not enter. ([#320](https://github.com/MetaMask/skills/pull/320)) +- Update `testing/visual-testing` for `@metamask/client-mcp-core` 0.16.1. `mm screenshot --selector` or `--frame` with `--timeout` waits that long for a missing element (without it, the command still fails after 2 s with `MM_TARGET_NOT_FOUND`), and the TradingView chart notes say that its canvas is in a nested iframe that `--frame` does not enter. ([#328](https://github.com/MetaMask/skills/pull/328)) - Update `testing/visual-testing` for `@metamask/client-mcp-core` 0.16.0. An unknown command or a bad `launch` value exits 2 with `MM_INVALID_INPUT`, a target that matches several elements fails with `MM_TARGET_NOT_FOUND`, `mm screenshot --selector` takes `--timeout` and fails after 2 s with `MM_TARGET_NOT_FOUND` when nothing matches, a `--frame` wrapper with one iframe resolves to that iframe, `mm mock-network requests` redacts URLs, and daemon log lines name the call's target. ([#316](https://github.com/MetaMask/skills/pull/316)) - Update `testing/visual-testing` for `@metamask/client-mcp-core` 0.15.0. Add `mm events mark`, `mm logs` and `mm network` with a per-flow recipe in place of `console.error` hooks and CDP network capture, `mm cdp --target sw` and `--fresh`, iframe refs and `--frame`, `mm screenshot --selector`, mock-network request bodies and service-worker, offscreen and snap matching, the hidden-checkbox `clickedLabel` click, the `ref` shorthand in `run-steps`, and the one timeout budget with `MM_QUEUE_TIMEOUT`. ([#297](https://github.com/MetaMask/skills/pull/297)) - Update `testing/mobile-visual-testing` for `@metamask/client-mcp-core` 0.15.0 and `@metamask/device-mcp` 0.9.0. Android taps on a covered target now fail with `MM_TARGET_OBSCURED`, `visible: false` now marks off-screen elements on Android too, `mm type ""` clears a field, and `mm cdp` reuses the launch Metro port over one persistent connection. The "Android `visible` is always `true`", "pass `--metro-port` on every `cdp` call" and `press-button back` keyboard workarounds are removed. The skill adds the slow-first-screen recipe (`wait-for` the new screen, do not tap again), the `run-steps` `ref` shorthand, the shared timeout budget with `MM_QUEUE_TIMEOUT`, the iOS tab bar that is not in the tree, and a warning that a mobile ref is resolved again at tap time and can tap another element with the same test ID or label ([#298](https://github.com/MetaMask/skills/pull/298)).