From fef4f6e20a5b60ba2709f5c5cbd59a87f8bb1a05 Mon Sep 17 00:00:00 2001 From: cryptotavares Date: Wed, 2 Dec 2026 10:24:31 +0000 Subject: [PATCH] fix: wait up to --timeout for a missing screenshot selector --- README.md | 4 +- SKILL.md | 2 +- src/platform/playwright-driver.test.ts | 10 +- src/platform/playwright-driver.ts | 2 +- src/platform/types.ts | 5 +- src/tools/screenshot.test.ts | 124 +++++++++++++++++++++++++ 6 files changed, 137 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 363e3fb2..26b0c662 100644 --- a/README.md +++ b/README.md @@ -430,7 +430,7 @@ The daemon routes `POST /tool/:name` requests through the registry, applies Zod | `get_context` | Returns the current environment context (`e2e` or `prod`), session status, available capabilities, and whether context switching is allowed. | | `set_context` | Switches the session environment between `e2e` and `prod` modes. Blocked while a session is active. | | **Screenshots** | | -| `screenshot` | Captures a screenshot of the current page. Supports naming, full-page capture, scoping to a CSS selector, and optional base64 output. Browser: `frame` captures an iframe, or the `selector` element inside it; a selector that matches no element fails fast with `MM_TARGET_NOT_FOUND`. | +| `screenshot` | Captures a screenshot of the current page. Supports naming, full-page capture, scoping to a CSS selector, and optional base64 output. Browser: `frame` captures an iframe, or the `selector` element inside it; without `timeoutMs`, a selector that matches no element fails after 2s with `MM_TARGET_NOT_FOUND`; with it, the call waits that long for the element to appear. | | **Contracts** | | | `seed_contract` | Deploys a single smart contract to the local Anvil chain by name. Requires `ContractSeedingCapability`. | | `seed_contracts` | Deploys multiple smart contracts in sequence. Returns both successful deployments and individual failures. | @@ -656,7 +656,7 @@ mm describe-screen | `mm reset-viewport` | Browser only. Restores the size the page had before the first `mm set-viewport`. | | `mm get-text [--timeout ] [--selector ] [--testid ] [--within ] [--frame