Expand description
smix-adapter-maestro — Maestro YAML adapter for smix.
Parses Maestro test flow YAML and translates each Step into a
smix-sdk action call. See README.md for the design rationale.
parse_flow_yaml does single-file parsing; parse_flow_file
adds recursive runFlow expansion with cycle detection.
Structs§
- Adapter
- Stateful step dispatcher. Holds a borrow of the
AppLikesurface plus the current base directory for resolving relativerunFlowpaths.last_bundleis updated byStep::LaunchAppand consumed byStep::StopApp. - Android
App - Android-specific app coords.
- AppEntry
- Per-app platform stanzas.
- Apps
Config - Top-level config shape —
apps:map of logical-key → platform table. - Flow
- A parsed maestro YAML flow — a sequence of
Steps plus anappIdheader. - Flow
Args - All inputs to a single flow run.
- IosApp
- iOS-specific app coords.
- Mask
Region - v5.5 c5 — normalized bbox for
assertScreenshot.maskregions. Coordinates are 0..1 fractions of the captured screenshot; the same convention maestro’s mapping form uses. Surface-only in v5.5: the adapter parses + carries the regions but the runtime currently emits a warning and skips region exclusion (R2-tier algorithm change deferred to v6+ when SSIM/pHash replaces the dhash backbone). - RunReport
- Aggregate report for one
Adapter::runinvocation. - Signal
Match - v0.3.0 Phase A — sub-field of
Step::ExpectSignals. - Step
Debug Record - v1.0.4 — per-step trace record populated when
--debug-outputis set. Feeds an enrichedrun-summary.jsonand separately-writtenstep-<N>-<verb>.tree.jsonon failure. See RFC 1.0.4 §D11.
Enums§
- Annotation
Pos - v1.0 Phase C2 — position spec for an annotation. Three shapes:
- Annotation
Spec - v1.0 Phase C2 — one annotation composed onto a screenshot output.
Position resolves against pixel/normalized coords or a smix
Selector(adapter runtime resolves selector → pixel at screenshot time via a11y tree). - Expr
Value - v5.2 c4 — yaml expression engine 的
Value类型. 用于Adapter::with_outputseeding 调用方构造 output store. 表面 stable subset (Null / Bool / Number / String). Runtime value within the expr engine. Minimal subset (Null / Bool / Number / String) — the fullserde_jsonvalue is not pulled in; aFrom<&serde_json::Value>blanket conversion is sufficient since the output store isBTreeMap<String, Value>. - Flow
Platform - Target platform for a flow run.
- Maestro
Permission Action - v5.2 c2 — maestro yaml
permissions:action 字面值.Allow→ simctlgrant,Deny→ simctlrevoke,Unset→ simctlreset. - Output
Format - Output format for
smix run. - Parse
Error - Adapter parse / dispatch errors.
- Repeat
Mode - v5.2 c4 —
Step::Repeatmode. Parser 编译期 dispatch (yamlrepeat.timesxorrepeat.while), runtime 无运行时分叉. - Reset
AppData Wait For - v0.3.0 Phase A — window shape for signal await. Mirrors
smix_metro_log::Windowat the yaml level. Runtime translatesSinceSteptoWindow::SinceMsusing the tail’s ms cursor captured at each step-end. v1.0.14 Cluster A — completion-signal wait strategy for theresetAppDataverb (URL-scheme JS-wipe). See.claude/rfcs/1.0.14-*.md§Cluster A. The runtime executor (smix-adapter-maestro) is responsible for interpreting these variants; smix-sdk owns the type so the adapter’sStepand the runtime’s dispatch stay in agreement. - Resolve
Error - Resolver errors.
- Resolved
App - Resolved platform-specific app identifier returned by
AppsConfig::resolve. - RunError
- Runtime dispatch errors.
- RunStep
Report - Outcome of a single
Stepdispatch. - Signal
Order Kind - v0.3.0 Phase A — ordering semantics for
Step::ExpectSignals. - Signal
Window - Sliding-window spec for
expect.signal/expect.signalsverbs. Selects the segment of the metro log tail that a signal search scans against. Restored abovepub enum SignalWindowin v1.0.14 after the earlier ResetAppData placement shuffled its docstring. - Step
- One parsed yaml step. See the maestro-compat command table in the module docs above for the yaml shapes each variant corresponds to.
- TapDispatch
- A maestro YAML command. Each variant corresponds to one or more
smix-sdkaction calls (the mapping is the c3 job — for now the enum is a structural representation of the parsed yaml node).
Traits§
- AppLike
- Subset of
smix_sdk::Appneeded byAdapter::run. The blanket impl below forwards 1:1 to the realApp; mock impls in tests substitute capturing recorders for unit isolation.
Functions§
- parse_
flow_ file - Parse a maestro YAML file and recursively expand unconditional
runFlowreferences inline. - parse_
flow_ yaml - Parse a maestro YAML string into a
Flow. - resolve_
app_ into_ flow - Resolve
flow.app(logical key) intoflow.app_idliteral in place. No-op when the flow already hasapp_idset or noapplogical key. Recursively patches embeddedStep::LaunchApp { app_id }inheritors that were left blank by the parser. - run_
flow - Run a flow file end-to-end. Async because runner / sdk calls are
async. Returns an
ExitCodesuitable for direct return frommain. Exit codes: - text_
to_ pattern - Infer a
Patternfrom a text body. Maestro treats|as regex alternation (mirrors maestro KotlinTestRunner.kt/XPathSelector.ktRegex(text)semantics); plain bodies stay as case-insensitive literals. Empty bodies stay as emptyPattern::Textfor explicit downstream rejection. - visible_
to_ selector - Convert a
visible:value (scalar string or map with a selector sub-key) into aSelector.