zig-mobile-runner 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +484 -0
- package/CONTRIBUTING.md +42 -0
- package/FEATURES.md +112 -0
- package/LICENSE +21 -0
- package/README.md +255 -0
- package/SECURITY.md +34 -0
- package/build.zig +38 -0
- package/build.zig.zon +7 -0
- package/clients/README.md +144 -0
- package/clients/go/README.md +24 -0
- package/clients/go/examples/fake-session/main.go +93 -0
- package/clients/go/go.mod +3 -0
- package/clients/go/zmr/client.go +432 -0
- package/clients/kotlin/README.md +35 -0
- package/clients/kotlin/build.gradle.kts +35 -0
- package/clients/kotlin/settings.gradle.kts +15 -0
- package/clients/kotlin/src/main/kotlin/dev/zmr/FakeSession.kt +86 -0
- package/clients/kotlin/src/main/kotlin/dev/zmr/ZmrClient.kt +67 -0
- package/clients/python/README.md +29 -0
- package/clients/python/examples/fake_session.py +48 -0
- package/clients/python/pyproject.toml +13 -0
- package/clients/python/zmr_client.py +202 -0
- package/clients/rust/Cargo.lock +107 -0
- package/clients/rust/Cargo.toml +10 -0
- package/clients/rust/README.md +19 -0
- package/clients/rust/examples/fake_session.rs +70 -0
- package/clients/rust/src/lib.rs +461 -0
- package/clients/swift/Package.swift +16 -0
- package/clients/swift/README.md +36 -0
- package/clients/swift/Sources/ZMRClient/ZMRClient.swift +114 -0
- package/clients/swift/Sources/ZMRFakeSession/main.swift +86 -0
- package/clients/typescript/README.md +34 -0
- package/clients/typescript/examples/fake-session.mjs +36 -0
- package/clients/typescript/index.d.ts +144 -0
- package/clients/typescript/index.mjs +192 -0
- package/clients/typescript/package.json +8 -0
- package/docs/adr/0001-agent-native-runner-boundary.md +31 -0
- package/docs/adr/0002-app-local-zmr-contract.md +39 -0
- package/docs/adr/0003-ios-simulator-xctest-shim.md +41 -0
- package/docs/adr/0004-benchmark-claims-and-baseline-collection.md +37 -0
- package/docs/adr/README.md +12 -0
- package/docs/ai-agents.md +156 -0
- package/docs/app-integration.md +316 -0
- package/docs/benchmarking.md +275 -0
- package/docs/client-installation.md +141 -0
- package/docs/clients.md +98 -0
- package/docs/config.md +175 -0
- package/docs/demo.md +259 -0
- package/docs/dsl.md +57 -0
- package/docs/install.md +233 -0
- package/docs/market-positioning.md +70 -0
- package/docs/npm.md +359 -0
- package/docs/protocol-fixtures/README.md +8 -0
- package/docs/protocol-fixtures/core-session.requests.jsonl +8 -0
- package/docs/protocol-fixtures/core-session.responses.jsonl +8 -0
- package/docs/protocol-versioning.md +65 -0
- package/docs/protocol.md +560 -0
- package/docs/publication.md +77 -0
- package/docs/release-audit.md +99 -0
- package/docs/release-candidate.md +111 -0
- package/docs/release-evidence.md +188 -0
- package/docs/release-notes-template.md +58 -0
- package/docs/roadmap.md +334 -0
- package/docs/scenario-authoring.md +88 -0
- package/docs/shipping.md +170 -0
- package/docs/trace-privacy.md +88 -0
- package/docs/troubleshooting.md +256 -0
- package/examples/android-app-auth-probe.json +89 -0
- package/examples/android-app-error-state.json +13 -0
- package/examples/android-app-login-smoke.json +192 -0
- package/examples/android-app-onboarding.json +12 -0
- package/examples/android-app-referral-deep-link.json +12 -0
- package/examples/android-shim-smoke.json +19 -0
- package/examples/demo-failure.json +12 -0
- package/examples/demo-fake.json +14 -0
- package/examples/ios-dev-client-open-link.json +26 -0
- package/examples/ios-dev-client-route-snapshot.json +24 -0
- package/examples/ios-shim-smoke.json +23 -0
- package/examples/ios-smoke.json +9 -0
- package/go.work +3 -0
- package/npm/agents.mjs +183 -0
- package/npm/app-config.mjs +95 -0
- package/npm/build-zmr.mjs +21 -0
- package/npm/commands.mjs +104 -0
- package/npm/generated-files.mjs +50 -0
- package/npm/index.mjs +75 -0
- package/npm/init-app.mjs +80 -0
- package/npm/package-scripts.mjs +72 -0
- package/npm/postinstall.mjs +21 -0
- package/npm/scaffold.mjs +179 -0
- package/npm/scenarios.mjs +93 -0
- package/npm/setup.mjs +69 -0
- package/npm/wizard.mjs +117 -0
- package/npm/zmr.mjs +23 -0
- package/package.json +114 -0
- package/prebuilds/darwin-arm64/zmr +0 -0
- package/prebuilds/darwin-x64/zmr +0 -0
- package/prebuilds/linux-arm64/zmr +0 -0
- package/prebuilds/linux-x64/zmr +0 -0
- package/schemas/README.md +26 -0
- package/schemas/action-result.schema.json +27 -0
- package/schemas/capabilities-output.schema.json +98 -0
- package/schemas/devices-output.schema.json +25 -0
- package/schemas/doctor-output.schema.json +51 -0
- package/schemas/explain-output.schema.json +51 -0
- package/schemas/import-output.schema.json +23 -0
- package/schemas/init-output.schema.json +71 -0
- package/schemas/json-rpc.schema.json +55 -0
- package/schemas/release-manifest.schema.json +43 -0
- package/schemas/release-readiness-output.schema.json +127 -0
- package/schemas/run-output.schema.json +43 -0
- package/schemas/scenario.schema.json +128 -0
- package/schemas/schemas-output.schema.json +26 -0
- package/schemas/semantic-snapshot.schema.json +116 -0
- package/schemas/snapshot.schema.json +60 -0
- package/schemas/trace-event.schema.json +14 -0
- package/schemas/trace-manifest.schema.json +59 -0
- package/schemas/validate-output.schema.json +42 -0
- package/schemas/version-output.schema.json +23 -0
- package/schemas/zmr-config.schema.json +75 -0
- package/scripts/android-emulator.sh +126 -0
- package/scripts/assert-ios-physical-ready.sh +213 -0
- package/scripts/benchmark-command.sh +307 -0
- package/scripts/benchmark.sh +359 -0
- package/scripts/benchmark_gate.py +117 -0
- package/scripts/benchmark_result_row.py +88 -0
- package/scripts/compare-benchmarks.py +288 -0
- package/scripts/create-android-demo-app.sh +342 -0
- package/scripts/create-ios-demo-app.sh +261 -0
- package/scripts/demo-android-real.sh +232 -0
- package/scripts/demo-ios-real.sh +270 -0
- package/scripts/demo.sh +464 -0
- package/scripts/device-matrix.sh +338 -0
- package/scripts/ensure-ios-shim-target.rb +237 -0
- package/scripts/install-android-shim.sh +281 -0
- package/scripts/install-ios-shim.sh +589 -0
- package/scripts/pilot-gate.sh +560 -0
- package/scripts/release-readiness.py +838 -0
- package/scripts/release-readiness.sh +91 -0
- package/scripts/run-android-pilot.sh +561 -0
- package/scripts/run-ios-pilot.sh +509 -0
- package/shims/android/README.md +21 -0
- package/shims/android/ZMRShimInstrumentedTest.java +152 -0
- package/shims/android/protocol.md +18 -0
- package/shims/ios/README.md +50 -0
- package/shims/ios/ZMRShim.swift +110 -0
- package/shims/ios/ZMRShimUITestCase.swift +475 -0
- package/shims/ios/protocol.md +74 -0
- package/skills/zmr-mobile-testing/SKILL.md +127 -0
- package/src/android.zig +344 -0
- package/src/android_device_info.zig +99 -0
- package/src/android_emulator.zig +154 -0
- package/src/android_screen_recording.zig +112 -0
- package/src/android_shell.zig +112 -0
- package/src/bundle.zig +124 -0
- package/src/bundle_redaction.zig +272 -0
- package/src/bundle_tar.zig +123 -0
- package/src/cli_devices.zig +97 -0
- package/src/cli_doctor.zig +114 -0
- package/src/cli_import.zig +70 -0
- package/src/cli_info.zig +39 -0
- package/src/cli_init.zig +72 -0
- package/src/cli_output.zig +467 -0
- package/src/cli_run.zig +259 -0
- package/src/cli_serve.zig +287 -0
- package/src/cli_trace.zig +111 -0
- package/src/cli_validate.zig +41 -0
- package/src/command.zig +211 -0
- package/src/config.zig +305 -0
- package/src/config_diagnostics.zig +212 -0
- package/src/config_paths.zig +49 -0
- package/src/device_registry.zig +37 -0
- package/src/doctor.zig +412 -0
- package/src/doctor_hints.zig +52 -0
- package/src/errors.zig +55 -0
- package/src/fake_device.zig +163 -0
- package/src/health.zig +28 -0
- package/src/importer.zig +343 -0
- package/src/importer_json.zig +100 -0
- package/src/importer_model.zig +103 -0
- package/src/ios.zig +399 -0
- package/src/ios_devices.zig +219 -0
- package/src/ios_lifecycle.zig +72 -0
- package/src/ios_shim.zig +242 -0
- package/src/ios_snapshot.zig +20 -0
- package/src/json_fields.zig +80 -0
- package/src/json_rpc.zig +150 -0
- package/src/json_rpc_methods.zig +318 -0
- package/src/json_rpc_observation.zig +31 -0
- package/src/json_rpc_params.zig +52 -0
- package/src/json_rpc_protocol.zig +110 -0
- package/src/json_rpc_trace.zig +73 -0
- package/src/main.zig +135 -0
- package/src/mcp.zig +234 -0
- package/src/mcp_protocol.zig +64 -0
- package/src/mcp_trace.zig +83 -0
- package/src/report.zig +346 -0
- package/src/report_html.zig +63 -0
- package/src/report_values.zig +27 -0
- package/src/run_options.zig +152 -0
- package/src/runner.zig +280 -0
- package/src/runner_actions.zig +109 -0
- package/src/runner_config.zig +6 -0
- package/src/runner_diagnostics.zig +268 -0
- package/src/runner_events.zig +170 -0
- package/src/runner_native.zig +88 -0
- package/src/runner_waits.zig +300 -0
- package/src/scaffold.zig +472 -0
- package/src/scenario.zig +346 -0
- package/src/scenario_fields.zig +50 -0
- package/src/schema_registry.zig +53 -0
- package/src/selector.zig +84 -0
- package/src/semantic.zig +171 -0
- package/src/trace.zig +315 -0
- package/src/trace_json.zig +340 -0
- package/src/trace_summary.zig +218 -0
- package/src/trace_summary_diagnostic.zig +202 -0
- package/src/types.zig +120 -0
- package/src/uiautomator.zig +164 -0
- package/src/validation.zig +187 -0
- package/src/version.zig +22 -0
- package/viewer/app.js +373 -0
- package/viewer/index.html +126 -0
- package/viewer/parser.js +233 -0
- package/viewer/styles.css +585 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://zmr.dev/schemas/scenario.schema.json",
|
|
4
|
+
"title": "ZMR Scenario",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["name", "steps"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"name": { "type": "string", "minLength": 1 },
|
|
10
|
+
"appId": { "type": "string", "minLength": 1 },
|
|
11
|
+
"steps": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"minItems": 1,
|
|
14
|
+
"items": { "$ref": "#/$defs/step" }
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"$defs": {
|
|
18
|
+
"selector": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"additionalProperties": false,
|
|
21
|
+
"minProperties": 1,
|
|
22
|
+
"properties": {
|
|
23
|
+
"id": { "type": "string" },
|
|
24
|
+
"resourceId": { "type": "string" },
|
|
25
|
+
"text": { "type": "string" },
|
|
26
|
+
"textContains": { "type": "string" },
|
|
27
|
+
"contentDesc": { "type": "string" },
|
|
28
|
+
"contentDescContains": { "type": "string" },
|
|
29
|
+
"className": { "type": "string" }
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"step": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"required": ["action"],
|
|
35
|
+
"properties": {
|
|
36
|
+
"action": {
|
|
37
|
+
"enum": [
|
|
38
|
+
"launch",
|
|
39
|
+
"stop",
|
|
40
|
+
"clearState",
|
|
41
|
+
"snapshot",
|
|
42
|
+
"openLink",
|
|
43
|
+
"tap",
|
|
44
|
+
"typeText",
|
|
45
|
+
"eraseText",
|
|
46
|
+
"pressBack",
|
|
47
|
+
"hideKeyboard",
|
|
48
|
+
"swipe",
|
|
49
|
+
"waitVisible",
|
|
50
|
+
"waitNotVisible",
|
|
51
|
+
"waitAny",
|
|
52
|
+
"assertVisible",
|
|
53
|
+
"assertNotVisible",
|
|
54
|
+
"assertNoneVisible",
|
|
55
|
+
"assertHealthy",
|
|
56
|
+
"optional",
|
|
57
|
+
"whenVisible",
|
|
58
|
+
"repeat",
|
|
59
|
+
"scrollUntilVisible",
|
|
60
|
+
"sleep"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
"optional": { "type": "boolean" },
|
|
64
|
+
"url": { "type": "string", "minLength": 1 },
|
|
65
|
+
"selector": { "$ref": "#/$defs/selector" },
|
|
66
|
+
"selectors": {
|
|
67
|
+
"type": "array",
|
|
68
|
+
"minItems": 1,
|
|
69
|
+
"items": { "$ref": "#/$defs/selector" }
|
|
70
|
+
},
|
|
71
|
+
"text": { "type": "string" },
|
|
72
|
+
"maxChars": { "type": "integer", "minimum": 0 },
|
|
73
|
+
"x1": { "type": "integer" },
|
|
74
|
+
"y1": { "type": "integer" },
|
|
75
|
+
"x2": { "type": "integer" },
|
|
76
|
+
"y2": { "type": "integer" },
|
|
77
|
+
"durationMs": { "type": "integer", "minimum": 0 },
|
|
78
|
+
"timeoutMs": { "type": "integer", "minimum": 0 },
|
|
79
|
+
"direction": { "enum": ["down", "up"] },
|
|
80
|
+
"times": { "type": "integer", "minimum": 1 },
|
|
81
|
+
"steps": {
|
|
82
|
+
"type": "array",
|
|
83
|
+
"items": { "$ref": "#/$defs/step" }
|
|
84
|
+
},
|
|
85
|
+
"step": { "$ref": "#/$defs/step" },
|
|
86
|
+
"ms": { "type": "integer", "minimum": 0 }
|
|
87
|
+
},
|
|
88
|
+
"allOf": [
|
|
89
|
+
{
|
|
90
|
+
"if": { "properties": { "action": { "const": "openLink" } } },
|
|
91
|
+
"then": { "required": ["url"] }
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"if": { "properties": { "action": { "enum": ["tap", "waitVisible", "waitNotVisible", "assertVisible", "assertNotVisible", "scrollUntilVisible"] } } },
|
|
95
|
+
"then": { "required": ["selector"] }
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"if": { "properties": { "action": { "const": "waitAny" } } },
|
|
99
|
+
"then": { "required": ["selectors"] }
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"if": { "properties": { "action": { "const": "assertNoneVisible" } } },
|
|
103
|
+
"then": { "required": ["selectors"] }
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"if": { "properties": { "action": { "const": "typeText" } } },
|
|
107
|
+
"then": { "required": ["text"] }
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"if": { "properties": { "action": { "const": "swipe" } } },
|
|
111
|
+
"then": { "required": ["x1", "y1", "x2", "y2"] }
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"if": { "properties": { "action": { "const": "optional" } } },
|
|
115
|
+
"then": { "required": ["step"] }
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"if": { "properties": { "action": { "const": "whenVisible" } } },
|
|
119
|
+
"then": { "required": ["selector", "steps"] }
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"if": { "properties": { "action": { "const": "repeat" } } },
|
|
123
|
+
"then": { "required": ["times", "steps"] }
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://zmr.dev/schemas/schemas-output.schema.json",
|
|
4
|
+
"title": "ZMR Schemas Output",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["ok", "count", "schemas"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"ok": { "const": true },
|
|
10
|
+
"count": { "type": "integer", "minimum": 0 },
|
|
11
|
+
"schemas": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"items": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"required": ["name", "path", "id", "description"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"name": { "type": "string", "minLength": 1 },
|
|
19
|
+
"path": { "type": "string", "minLength": 1 },
|
|
20
|
+
"id": { "type": "string", "minLength": 1 },
|
|
21
|
+
"description": { "type": "string", "minLength": 1 }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://zmr.dev/schemas/semantic-snapshot.schema.json",
|
|
4
|
+
"title": "ZMR Semantic Snapshot",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"id",
|
|
9
|
+
"timestampMs",
|
|
10
|
+
"viewport",
|
|
11
|
+
"activePackage",
|
|
12
|
+
"activeActivity",
|
|
13
|
+
"focusedNodeId",
|
|
14
|
+
"nodes",
|
|
15
|
+
"summary"
|
|
16
|
+
],
|
|
17
|
+
"properties": {
|
|
18
|
+
"id": { "type": "string", "minLength": 1 },
|
|
19
|
+
"timestampMs": { "type": "integer" },
|
|
20
|
+
"viewport": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"additionalProperties": false,
|
|
23
|
+
"required": ["width", "height"],
|
|
24
|
+
"properties": {
|
|
25
|
+
"width": { "type": "integer", "minimum": 0 },
|
|
26
|
+
"height": { "type": "integer", "minimum": 0 }
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"activePackage": { "type": ["string", "null"] },
|
|
30
|
+
"activeActivity": { "type": ["string", "null"] },
|
|
31
|
+
"focusedNodeId": { "type": ["string", "null"] },
|
|
32
|
+
"nodes": {
|
|
33
|
+
"type": "array",
|
|
34
|
+
"items": { "$ref": "#/$defs/semanticNode" }
|
|
35
|
+
},
|
|
36
|
+
"summary": {
|
|
37
|
+
"type": "object",
|
|
38
|
+
"additionalProperties": false,
|
|
39
|
+
"required": ["nodeCount", "interactiveCount", "visibleText"],
|
|
40
|
+
"properties": {
|
|
41
|
+
"nodeCount": { "type": "integer", "minimum": 0 },
|
|
42
|
+
"interactiveCount": { "type": "integer", "minimum": 0 },
|
|
43
|
+
"visibleText": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": { "type": "string" }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"$defs": {
|
|
51
|
+
"semanticNode": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"additionalProperties": false,
|
|
54
|
+
"required": [
|
|
55
|
+
"id",
|
|
56
|
+
"role",
|
|
57
|
+
"name",
|
|
58
|
+
"selector",
|
|
59
|
+
"source",
|
|
60
|
+
"bounds",
|
|
61
|
+
"enabled",
|
|
62
|
+
"visible",
|
|
63
|
+
"selected",
|
|
64
|
+
"interactive",
|
|
65
|
+
"recommendedAction"
|
|
66
|
+
],
|
|
67
|
+
"properties": {
|
|
68
|
+
"id": { "type": "string", "minLength": 1 },
|
|
69
|
+
"role": {
|
|
70
|
+
"enum": ["button", "textbox", "switch", "checkbox", "radio", "image", "text", "node"]
|
|
71
|
+
},
|
|
72
|
+
"name": { "type": "string" },
|
|
73
|
+
"selector": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"minProperties": 1,
|
|
76
|
+
"additionalProperties": false,
|
|
77
|
+
"properties": {
|
|
78
|
+
"resourceId": { "type": "string" },
|
|
79
|
+
"contentDesc": { "type": "string" },
|
|
80
|
+
"text": { "type": "string" },
|
|
81
|
+
"stableId": { "type": "string" }
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"source": {
|
|
85
|
+
"type": "object",
|
|
86
|
+
"additionalProperties": false,
|
|
87
|
+
"required": ["className", "resourceId", "text", "contentDesc"],
|
|
88
|
+
"properties": {
|
|
89
|
+
"className": { "type": "string" },
|
|
90
|
+
"resourceId": { "type": ["string", "null"] },
|
|
91
|
+
"text": { "type": ["string", "null"] },
|
|
92
|
+
"contentDesc": { "type": ["string", "null"] }
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"bounds": {
|
|
96
|
+
"type": "object",
|
|
97
|
+
"additionalProperties": false,
|
|
98
|
+
"required": ["x", "y", "width", "height", "centerX", "centerY"],
|
|
99
|
+
"properties": {
|
|
100
|
+
"x": { "type": "integer" },
|
|
101
|
+
"y": { "type": "integer" },
|
|
102
|
+
"width": { "type": "integer" },
|
|
103
|
+
"height": { "type": "integer" },
|
|
104
|
+
"centerX": { "type": "integer" },
|
|
105
|
+
"centerY": { "type": "integer" }
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"enabled": { "type": "boolean" },
|
|
109
|
+
"visible": { "type": "boolean" },
|
|
110
|
+
"selected": { "type": "boolean" },
|
|
111
|
+
"interactive": { "type": "boolean" },
|
|
112
|
+
"recommendedAction": { "enum": ["tap", "type", null] }
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://zmr.dev/schemas/snapshot.schema.json",
|
|
4
|
+
"title": "ZMR ObservationSnapshot",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["id", "timestampMs", "viewport", "nodes"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"id": { "type": "string" },
|
|
10
|
+
"timestampMs": { "type": "integer" },
|
|
11
|
+
"viewport": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"additionalProperties": false,
|
|
14
|
+
"required": ["width", "height"],
|
|
15
|
+
"properties": {
|
|
16
|
+
"width": { "type": "integer", "minimum": 0 },
|
|
17
|
+
"height": { "type": "integer", "minimum": 0 }
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"displayDensityDpi": { "type": ["integer", "null"], "minimum": 0 },
|
|
21
|
+
"activePackage": { "type": ["string", "null"] },
|
|
22
|
+
"activeActivity": { "type": ["string", "null"] },
|
|
23
|
+
"screenshotArtifact": { "type": ["string", "null"] },
|
|
24
|
+
"treeArtifact": { "type": ["string", "null"] },
|
|
25
|
+
"focusedNodeId": { "type": ["string", "null"] },
|
|
26
|
+
"logDelta": { "type": ["string", "null"] },
|
|
27
|
+
"nodes": {
|
|
28
|
+
"type": "array",
|
|
29
|
+
"items": { "$ref": "#/$defs/uiNode" }
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"$defs": {
|
|
33
|
+
"uiNode": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["stableId", "className", "bounds", "enabled", "visible", "selected"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"stableId": { "type": "string" },
|
|
39
|
+
"className": { "type": "string" },
|
|
40
|
+
"resourceId": { "type": ["string", "null"] },
|
|
41
|
+
"text": { "type": ["string", "null"] },
|
|
42
|
+
"contentDesc": { "type": ["string", "null"] },
|
|
43
|
+
"bounds": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"required": ["x", "y", "width", "height"],
|
|
47
|
+
"properties": {
|
|
48
|
+
"x": { "type": "integer" },
|
|
49
|
+
"y": { "type": "integer" },
|
|
50
|
+
"width": { "type": "integer", "minimum": 0 },
|
|
51
|
+
"height": { "type": "integer", "minimum": 0 }
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"enabled": { "type": "boolean" },
|
|
55
|
+
"visible": { "type": "boolean" },
|
|
56
|
+
"selected": { "type": "boolean" }
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://zmr.dev/schemas/trace-event.schema.json",
|
|
4
|
+
"title": "ZMR Trace Event",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["seq", "timestampMs", "kind", "payload"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"seq": { "type": "integer", "minimum": 1 },
|
|
10
|
+
"timestampMs": { "type": "integer" },
|
|
11
|
+
"kind": { "type": "string", "minLength": 1 },
|
|
12
|
+
"payload": {}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://zmr.dev/schemas/trace-manifest.schema.json",
|
|
4
|
+
"title": "ZMR Trace Manifest",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"schemaVersion",
|
|
9
|
+
"runnerVersion",
|
|
10
|
+
"protocolVersion",
|
|
11
|
+
"scenarioName",
|
|
12
|
+
"appId",
|
|
13
|
+
"status",
|
|
14
|
+
"startedAtMs",
|
|
15
|
+
"endedAtMs",
|
|
16
|
+
"durationMs",
|
|
17
|
+
"failedStepIndex",
|
|
18
|
+
"error",
|
|
19
|
+
"eventsPath",
|
|
20
|
+
"artifactsDir",
|
|
21
|
+
"eventCount",
|
|
22
|
+
"snapshotCount",
|
|
23
|
+
"partialFailureCount",
|
|
24
|
+
"reportPath"
|
|
25
|
+
],
|
|
26
|
+
"properties": {
|
|
27
|
+
"schemaVersion": { "const": 1 },
|
|
28
|
+
"runnerVersion": { "type": "string", "minLength": 1 },
|
|
29
|
+
"protocolVersion": { "type": "string", "minLength": 1 },
|
|
30
|
+
"scenarioName": { "type": "string", "minLength": 1 },
|
|
31
|
+
"appId": { "type": ["string", "null"] },
|
|
32
|
+
"status": { "enum": ["running", "passed", "failed", "partial"] },
|
|
33
|
+
"startedAtMs": { "type": "integer" },
|
|
34
|
+
"endedAtMs": { "type": ["integer", "null"] },
|
|
35
|
+
"durationMs": { "type": ["integer", "null"], "minimum": 0 },
|
|
36
|
+
"failedStepIndex": { "type": ["integer", "null"], "minimum": 0 },
|
|
37
|
+
"error": { "type": ["string", "null"] },
|
|
38
|
+
"eventsPath": { "const": "events.jsonl" },
|
|
39
|
+
"artifactsDir": { "const": "artifacts" },
|
|
40
|
+
"eventCount": { "type": "integer", "minimum": 0 },
|
|
41
|
+
"snapshotCount": { "type": "integer", "minimum": 0 },
|
|
42
|
+
"partialFailureCount": { "type": "integer", "minimum": 0 },
|
|
43
|
+
"reportPath": { "type": ["string", "null"] },
|
|
44
|
+
"redaction": {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"required": ["enabled", "screenshots", "screenRecordings", "textArtifacts", "screenshotsOmitted", "screenshotsRedacted", "screenRecordingsOmitted"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"enabled": { "type": "boolean" },
|
|
50
|
+
"screenshots": { "enum": ["included", "omitted", "placeholder"] },
|
|
51
|
+
"screenRecordings": { "enum": ["included", "omitted"] },
|
|
52
|
+
"textArtifacts": { "enum": ["raw", "scrubbed"] },
|
|
53
|
+
"screenshotsOmitted": { "type": "boolean" },
|
|
54
|
+
"screenshotsRedacted": { "type": "boolean" },
|
|
55
|
+
"screenRecordingsOmitted": { "type": "boolean" }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://zmr.dev/schemas/validate-output.schema.json",
|
|
4
|
+
"title": "ZMR Validate Output",
|
|
5
|
+
"oneOf": [
|
|
6
|
+
{ "$ref": "#/$defs/validScenario" },
|
|
7
|
+
{ "$ref": "#/$defs/invalidScenario" }
|
|
8
|
+
],
|
|
9
|
+
"$defs": {
|
|
10
|
+
"validScenario": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"required": ["ok", "path", "name", "stepCount", "nextCommands"],
|
|
14
|
+
"properties": {
|
|
15
|
+
"ok": { "const": true },
|
|
16
|
+
"path": { "type": "string", "minLength": 1 },
|
|
17
|
+
"name": { "type": "string", "minLength": 1 },
|
|
18
|
+
"appId": { "type": "string", "minLength": 1 },
|
|
19
|
+
"stepCount": { "type": "integer", "minimum": 0 },
|
|
20
|
+
"nextCommands": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"minItems": 1,
|
|
23
|
+
"items": { "type": "string", "minLength": 1 }
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"invalidScenario": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"additionalProperties": false,
|
|
30
|
+
"required": ["ok", "path", "errorCode", "message"],
|
|
31
|
+
"properties": {
|
|
32
|
+
"ok": { "const": false },
|
|
33
|
+
"path": { "type": "string", "minLength": 1 },
|
|
34
|
+
"errorCode": { "type": "string", "minLength": 1 },
|
|
35
|
+
"message": { "type": "string", "minLength": 1 },
|
|
36
|
+
"fieldPath": { "type": "string", "minLength": 1 },
|
|
37
|
+
"line": { "type": "integer", "minimum": 1 },
|
|
38
|
+
"column": { "type": "integer", "minimum": 0 }
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://zmr.dev/schemas/version-output.schema.json",
|
|
4
|
+
"title": "ZMR Version Output",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": [
|
|
8
|
+
"name",
|
|
9
|
+
"version",
|
|
10
|
+
"protocolVersion",
|
|
11
|
+
"minimumCompatibleProtocolVersion",
|
|
12
|
+
"stability",
|
|
13
|
+
"breakingChangePolicy"
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"name": { "const": "zmr" },
|
|
17
|
+
"version": { "type": "string", "minLength": 1 },
|
|
18
|
+
"protocolVersion": { "type": "string", "minLength": 1 },
|
|
19
|
+
"minimumCompatibleProtocolVersion": { "type": "string", "minLength": 1 },
|
|
20
|
+
"stability": { "type": "string", "minLength": 1 },
|
|
21
|
+
"breakingChangePolicy": { "type": "string", "minLength": 1 }
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://zmr.dev/schemas/zmr-config.schema.json",
|
|
4
|
+
"title": "ZMR App Config",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["schemaVersion"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"schemaVersion": { "const": 1 },
|
|
10
|
+
"appId": { "type": "string", "minLength": 1 },
|
|
11
|
+
"android": { "$ref": "#/$defs/platformConfig" },
|
|
12
|
+
"ios": { "$ref": "#/$defs/platformConfig" },
|
|
13
|
+
"artifacts": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"properties": {
|
|
17
|
+
"screenshots": { "type": "boolean", "default": true },
|
|
18
|
+
"hierarchy": { "type": "boolean", "default": true },
|
|
19
|
+
"logs": { "type": "boolean", "default": true },
|
|
20
|
+
"screenRecording": { "type": "boolean", "default": false }
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"redaction": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"properties": {
|
|
27
|
+
"denylistText": { "$ref": "#/$defs/stringList" },
|
|
28
|
+
"allowlistText": { "$ref": "#/$defs/stringList" },
|
|
29
|
+
"denylistResourceIds": { "$ref": "#/$defs/stringList" },
|
|
30
|
+
"allowlistResourceIds": { "$ref": "#/$defs/stringList" }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"tools": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"properties": {
|
|
37
|
+
"adbPath": { "type": "string", "minLength": 1 },
|
|
38
|
+
"emulatorPath": { "type": "string", "minLength": 1 },
|
|
39
|
+
"avdmanagerPath": { "type": "string", "minLength": 1 },
|
|
40
|
+
"androidShimPath": { "type": "string", "minLength": 1 },
|
|
41
|
+
"xcrunPath": { "type": "string", "minLength": 1 },
|
|
42
|
+
"iosShimPath": { "type": "string", "minLength": 1 },
|
|
43
|
+
"zigPath": { "type": "string", "minLength": 1 }
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"additionalProperties": { "type": "string", "minLength": 1 }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"$defs": {
|
|
52
|
+
"stringList": {
|
|
53
|
+
"type": "array",
|
|
54
|
+
"items": { "type": "string", "minLength": 1 },
|
|
55
|
+
"default": []
|
|
56
|
+
},
|
|
57
|
+
"platformConfig": {
|
|
58
|
+
"type": "object",
|
|
59
|
+
"additionalProperties": false,
|
|
60
|
+
"properties": {
|
|
61
|
+
"enabled": { "type": "boolean" },
|
|
62
|
+
"defaultDevice": { "type": "string", "minLength": 1 },
|
|
63
|
+
"smokeScenario": { "type": "string", "minLength": 1 },
|
|
64
|
+
"traceDir": { "type": "string", "minLength": 1 },
|
|
65
|
+
"avdName": { "type": "string", "minLength": 1 },
|
|
66
|
+
"restoreSnapshot": { "type": "string", "minLength": 1 },
|
|
67
|
+
"createAvdIfMissing": { "type": "boolean", "default": false },
|
|
68
|
+
"avdSystemImage": { "type": "string", "minLength": 1 },
|
|
69
|
+
"avdDeviceProfile": { "type": "string", "minLength": 1 },
|
|
70
|
+
"resetBeforeRun": { "type": "boolean", "default": false },
|
|
71
|
+
"waitReady": { "type": "boolean", "default": false }
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|