@deeeed/metamask-harness 0.33.2 → 0.34.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 +31 -0
- package/adapters/mobile/bridge-runtime/cdp-bridge.cjs +18 -2
- package/adapters/mobile/bridge-runtime/lib/target-discovery.cjs +83 -23
- package/dist/adapters/mobile/prepare.js +14 -0
- package/dist/adapters/mobile/video-recorder.js +282 -0
- package/dist/adapters.js +225 -35
- package/dist/command-contract.js +1 -0
- package/dist/commands/device-target.js +17 -6
- package/dist/commands/launch/index.js +27 -5
- package/dist/commands/launch/mobile.js +9 -2
- package/dist/commands/run-engine.js +34 -2
- package/dist/devices.js +9 -2
- package/dist/heal-bounds.js +10 -0
- package/dist/mm-harness-cli.js +4 -2
- package/dist/recipe-security.js +1 -0
- package/dist/recording-target.js +23 -5
- package/dist/runner.js +107 -6
- package/dist/runtime-context.js +33 -1
- package/docs/RECIPES.md +41 -0
- package/library/actions/mobile/app/network-control.mjs +135 -0
- package/library/actions/mobile/app/network.mjs +4 -0
- package/library/actions/mobile/perps/capture_performance.mjs +4 -0
- package/library/actions/mobile/perps/performance-capture.mjs +383 -0
- package/library/actions/mobile/perps/perps.mjs +16 -0
- package/library/actions/mobile/platform/bridge.mjs +229 -13
- package/library/actions/mobile/wallet/ensure_unlocked.mjs +27 -6
- package/library/actions/mobile/wallet/select_account.mjs +21 -17
- package/library/manifests/mobile.action-manifest.json +130 -1
- package/library/recipes/mobile/perps/performance.homepage.android-background-reconnect.recipe.json +159 -0
- package/library/recipes/mobile/perps/performance.homepage.android-background-short.recipe.json +157 -0
- package/library/recipes/mobile/perps/performance.homepage.android-cold-disk-cache.recipe.json +147 -0
- package/library/recipes/mobile/perps/performance.homepage.android-cold-no-cache.recipe.json +137 -0
- package/library/recipes/mobile/perps/performance.homepage.android-network-recovery.recipe.json +149 -0
- package/library/recipes/mobile/perps/performance.homepage.ios-background-reconnect.recipe.json +110 -0
- package/library/recipes/mobile/perps/performance.homepage.ios-background-short.recipe.json +108 -0
- package/library/recipes/mobile/perps/performance.homepage.ios-cold-disk-cache.recipe.json +122 -0
- package/library/recipes/mobile/perps/performance.homepage.ios-cold-no-cache.recipe.json +95 -0
- package/package.json +1 -1
- package/scripts/site-contrast.mjs +34 -1
- package/site/architecture.html +12 -2
- package/site/assets/style.css +20 -1
- package/site/cheatsheet.html +7 -6
- package/site/index.html +119 -77
- package/site/perps.html +195 -0
- package/site/recipes.html +23 -1
- package/site/reviewers.html +2 -1
- package/site/tutorials/index.html +2 -1
- package/site/tutorials/v1.html +3 -2
- package/site/tutorials/v2.html +6 -5
- package/site/tutorials/v3.html +43 -2
- package/site/tutorials/v4.html +2 -1
- package/site/tutorials/v5.html +2 -1
- package/site/tutorials/v6.html +2 -1
- package/site/tutorials/v7.html +2 -1
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
|
|
3
|
+
"title": "Android Homepage Perps cold disk-cache visible performance proof",
|
|
4
|
+
"description": "Creates a deterministic visible order, restarts the Android process without clearing app data, and validates disk-cache-to-fresh visible content after cold launch.",
|
|
5
|
+
"workflow": {
|
|
6
|
+
"entry": "prepare-open-order",
|
|
7
|
+
"nodes": {
|
|
8
|
+
"prepare-open-order": {
|
|
9
|
+
"action": "metamask.perps.start_state",
|
|
10
|
+
"profile": "open_order_testnet",
|
|
11
|
+
"provider": "hyperliquid",
|
|
12
|
+
"network": "testnet",
|
|
13
|
+
"market": "ETH",
|
|
14
|
+
"page": "perps_home",
|
|
15
|
+
"side": "short",
|
|
16
|
+
"orders": {
|
|
17
|
+
"state": "open",
|
|
18
|
+
"mode": "matching",
|
|
19
|
+
"market": "ETH",
|
|
20
|
+
"side": "short",
|
|
21
|
+
"notional": 10,
|
|
22
|
+
"leverage": 2,
|
|
23
|
+
"timeout_ms": 90000
|
|
24
|
+
},
|
|
25
|
+
"positions": false,
|
|
26
|
+
"intent": "Prepare a persisted live order before cold process launch",
|
|
27
|
+
"timeout_ms": 120000,
|
|
28
|
+
"next": "open-wallet-home"
|
|
29
|
+
},
|
|
30
|
+
"open-wallet-home": {
|
|
31
|
+
"action": "ui.navigate",
|
|
32
|
+
"page": "home",
|
|
33
|
+
"intent": "Open Wallet Home so the Perps disk cache is current",
|
|
34
|
+
"timeout_ms": 30000,
|
|
35
|
+
"next": "wait-order-before"
|
|
36
|
+
},
|
|
37
|
+
"wait-order-before": {
|
|
38
|
+
"action": "ui.wait_for",
|
|
39
|
+
"text": "Limit short",
|
|
40
|
+
"expected": "present",
|
|
41
|
+
"intent": "Prove the persisted order exists before restart",
|
|
42
|
+
"timeout_ms": 30000,
|
|
43
|
+
"next": "start-performance-capture"
|
|
44
|
+
},
|
|
45
|
+
"start-performance-capture": {
|
|
46
|
+
"action": "metamask.perps.capture_performance",
|
|
47
|
+
"phase": "start",
|
|
48
|
+
"intent": "Start the evidence window before the process restart",
|
|
49
|
+
"next": "restart-app"
|
|
50
|
+
},
|
|
51
|
+
"restart-app": {
|
|
52
|
+
"action": "app.lifecycle",
|
|
53
|
+
"command": "restart",
|
|
54
|
+
"settle_ms": 15000,
|
|
55
|
+
"intent": "Cold-restart the app while preserving persisted app data",
|
|
56
|
+
"next": "unlock-after-restart"
|
|
57
|
+
},
|
|
58
|
+
"unlock-after-restart": {
|
|
59
|
+
"action": "metamask.wallet.ensure_unlocked",
|
|
60
|
+
"intent": "Restore the fixture wallet after the cold process launch",
|
|
61
|
+
"next": "open-wallet-home-after"
|
|
62
|
+
},
|
|
63
|
+
"open-wallet-home-after": {
|
|
64
|
+
"action": "ui.navigate",
|
|
65
|
+
"page": "home",
|
|
66
|
+
"intent": "Return to Wallet Home after unlocking the cold-started process",
|
|
67
|
+
"timeout_ms": 30000,
|
|
68
|
+
"next": "wait-content-after"
|
|
69
|
+
},
|
|
70
|
+
"wait-content-after": {
|
|
71
|
+
"action": "ui.wait_for",
|
|
72
|
+
"test_id": "homepage-perps-positions",
|
|
73
|
+
"expected": "present",
|
|
74
|
+
"intent": "Confirm Wallet Home restores data-backed Perps content after cold launch",
|
|
75
|
+
"timeout_ms": 30000,
|
|
76
|
+
"next": "show-content-after"
|
|
77
|
+
},
|
|
78
|
+
"show-content-after": {
|
|
79
|
+
"action": "ui.scroll",
|
|
80
|
+
"test_id": "homepage-perps-positions",
|
|
81
|
+
"scroll_into_view": true,
|
|
82
|
+
"animated": true,
|
|
83
|
+
"settle": true,
|
|
84
|
+
"intent": "Bring the cold-start Perps content into the viewport",
|
|
85
|
+
"timeout_ms": 30000,
|
|
86
|
+
"next": "wait-order-after"
|
|
87
|
+
},
|
|
88
|
+
"wait-order-after": {
|
|
89
|
+
"action": "ui.wait_for",
|
|
90
|
+
"text": "Limit short",
|
|
91
|
+
"expected": "visible",
|
|
92
|
+
"intent": "Prove the same live order is visible after cold launch",
|
|
93
|
+
"timeout_ms": 30000,
|
|
94
|
+
"next": "capture-after"
|
|
95
|
+
},
|
|
96
|
+
"capture-after": {
|
|
97
|
+
"action": "ui.screenshot",
|
|
98
|
+
"path": "screenshots/homepage-order-after-cold-start.png",
|
|
99
|
+
"intent": "Preserve reviewer-visible cold-start proof",
|
|
100
|
+
"next": "settle-frame"
|
|
101
|
+
},
|
|
102
|
+
"settle-frame": {
|
|
103
|
+
"action": "wait",
|
|
104
|
+
"duration_ms": 2500,
|
|
105
|
+
"intent": "Allow the fresh visible frame checkpoint to finish",
|
|
106
|
+
"next": "finish-performance-capture"
|
|
107
|
+
},
|
|
108
|
+
"finish-performance-capture": {
|
|
109
|
+
"action": "metamask.perps.capture_performance",
|
|
110
|
+
"phase": "end",
|
|
111
|
+
"required_stages": [
|
|
112
|
+
"disk_cache_hydrated",
|
|
113
|
+
"viewport_demand",
|
|
114
|
+
"socket_received",
|
|
115
|
+
"react_commit",
|
|
116
|
+
"next_frame_checkpoint"
|
|
117
|
+
],
|
|
118
|
+
"required_lifecycles": ["cold_disk_cache"],
|
|
119
|
+
"required_sources": ["disk_cache", "fresh_socket"],
|
|
120
|
+
"required_fresh_content_variants": ["orders"],
|
|
121
|
+
"intent": "Preserve and validate the cold disk-cache measurement cohort",
|
|
122
|
+
"next": "cleanup-order"
|
|
123
|
+
},
|
|
124
|
+
"cleanup-order": {
|
|
125
|
+
"action": "metamask.perps.teardown_state",
|
|
126
|
+
"provider": "hyperliquid",
|
|
127
|
+
"network": "testnet",
|
|
128
|
+
"market": "ETH",
|
|
129
|
+
"page": "home",
|
|
130
|
+
"positions": false,
|
|
131
|
+
"orders": {
|
|
132
|
+
"state": "none",
|
|
133
|
+
"mode": "matching",
|
|
134
|
+
"market": "ETH",
|
|
135
|
+
"timeout_ms": 60000
|
|
136
|
+
},
|
|
137
|
+
"intent": "Cancel the deterministic testnet order after evidence capture",
|
|
138
|
+
"timeout_ms": 90000,
|
|
139
|
+
"next": "done"
|
|
140
|
+
},
|
|
141
|
+
"done": {
|
|
142
|
+
"action": "end",
|
|
143
|
+
"status": "pass"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
|
|
3
|
+
"title": "Android Homepage Perps cold start without cache proof",
|
|
4
|
+
"description": "Prepares a deterministic live order, clears only Perps persistent caches, cold-restarts the app, and validates first visible plus lifecycle-fresh content on the physical Android device.",
|
|
5
|
+
"workflow": {
|
|
6
|
+
"entry": "prepare-open-order",
|
|
7
|
+
"nodes": {
|
|
8
|
+
"prepare-open-order": {
|
|
9
|
+
"action": "metamask.perps.start_state",
|
|
10
|
+
"profile": "open_order_testnet",
|
|
11
|
+
"provider": "hyperliquid",
|
|
12
|
+
"network": "testnet",
|
|
13
|
+
"market": "ETH",
|
|
14
|
+
"page": "perps_home",
|
|
15
|
+
"side": "short",
|
|
16
|
+
"orders": {
|
|
17
|
+
"state": "open",
|
|
18
|
+
"mode": "matching",
|
|
19
|
+
"market": "ETH",
|
|
20
|
+
"side": "short",
|
|
21
|
+
"notional": 10,
|
|
22
|
+
"leverage": 2,
|
|
23
|
+
"timeout_ms": 90000
|
|
24
|
+
},
|
|
25
|
+
"positions": false,
|
|
26
|
+
"intent": "Prepare the deterministic exchange state before removing local caches",
|
|
27
|
+
"timeout_ms": 120000,
|
|
28
|
+
"next": "start-performance-capture"
|
|
29
|
+
},
|
|
30
|
+
"start-performance-capture": {
|
|
31
|
+
"action": "metamask.perps.capture_performance",
|
|
32
|
+
"phase": "start",
|
|
33
|
+
"intent": "Start the evidence window before cache removal and process restart",
|
|
34
|
+
"next": "clear-perps-caches"
|
|
35
|
+
},
|
|
36
|
+
"clear-perps-caches": {
|
|
37
|
+
"action": "metamask.perps.clear_performance_caches",
|
|
38
|
+
"intent": "Remove only Perps persisted market and user snapshots",
|
|
39
|
+
"next": "restart-app"
|
|
40
|
+
},
|
|
41
|
+
"restart-app": {
|
|
42
|
+
"action": "app.lifecycle",
|
|
43
|
+
"command": "restart",
|
|
44
|
+
"settle_ms": 15000,
|
|
45
|
+
"runtime_ready_timeout_ms": 60000,
|
|
46
|
+
"intent": "Cold-restart the selected Android app without deleting wallet state",
|
|
47
|
+
"next": "unlock-wallet"
|
|
48
|
+
},
|
|
49
|
+
"unlock-wallet": {
|
|
50
|
+
"action": "metamask.wallet.ensure_unlocked",
|
|
51
|
+
"intent": "Unlock the fixture wallet after the cold process launch",
|
|
52
|
+
"next": "open-wallet-home"
|
|
53
|
+
},
|
|
54
|
+
"open-wallet-home": {
|
|
55
|
+
"action": "ui.navigate",
|
|
56
|
+
"page": "home",
|
|
57
|
+
"intent": "Open Wallet Home after the no-cache cold launch",
|
|
58
|
+
"timeout_ms": 30000,
|
|
59
|
+
"next": "wait-section"
|
|
60
|
+
},
|
|
61
|
+
"wait-section": {
|
|
62
|
+
"action": "ui.wait_for",
|
|
63
|
+
"test_id": "homepage-perps-positions",
|
|
64
|
+
"expected": "present",
|
|
65
|
+
"intent": "Confirm the Perps Homepage section mounted after cold launch",
|
|
66
|
+
"timeout_ms": 30000,
|
|
67
|
+
"next": "show-content"
|
|
68
|
+
},
|
|
69
|
+
"show-content": {
|
|
70
|
+
"action": "ui.scroll",
|
|
71
|
+
"test_id": "homepage-perps-positions",
|
|
72
|
+
"scroll_into_view": true,
|
|
73
|
+
"animated": true,
|
|
74
|
+
"settle": true,
|
|
75
|
+
"intent": "Bring the Perps section and order into the physical viewport",
|
|
76
|
+
"timeout_ms": 30000,
|
|
77
|
+
"next": "wait-order"
|
|
78
|
+
},
|
|
79
|
+
"wait-order": {
|
|
80
|
+
"action": "ui.wait_for",
|
|
81
|
+
"text": "Limit short",
|
|
82
|
+
"expected": "visible",
|
|
83
|
+
"intent": "Require the fresh exchange order to be visible after cold launch",
|
|
84
|
+
"timeout_ms": 30000,
|
|
85
|
+
"next": "capture-after"
|
|
86
|
+
},
|
|
87
|
+
"capture-after": {
|
|
88
|
+
"action": "ui.screenshot",
|
|
89
|
+
"path": "screenshots/homepage-order-cold-no-cache.png",
|
|
90
|
+
"intent": "Preserve reviewer-visible cold-no-cache proof",
|
|
91
|
+
"next": "settle-frame"
|
|
92
|
+
},
|
|
93
|
+
"settle-frame": {
|
|
94
|
+
"action": "wait",
|
|
95
|
+
"duration_ms": 2500,
|
|
96
|
+
"intent": "Allow the fresh visible frame checkpoint to finish",
|
|
97
|
+
"next": "finish-performance-capture"
|
|
98
|
+
},
|
|
99
|
+
"finish-performance-capture": {
|
|
100
|
+
"action": "metamask.perps.capture_performance",
|
|
101
|
+
"phase": "end",
|
|
102
|
+
"required_stages": [
|
|
103
|
+
"viewport_demand",
|
|
104
|
+
"socket_received",
|
|
105
|
+
"react_commit",
|
|
106
|
+
"next_frame_checkpoint"
|
|
107
|
+
],
|
|
108
|
+
"required_lifecycles": ["cold_no_cache"],
|
|
109
|
+
"required_sources": ["fresh_socket"],
|
|
110
|
+
"required_fresh_content_variants": ["orders"],
|
|
111
|
+
"intent": "Validate the cold-no-cache lifecycle and fresh visible order cohort",
|
|
112
|
+
"next": "cleanup-order"
|
|
113
|
+
},
|
|
114
|
+
"cleanup-order": {
|
|
115
|
+
"action": "metamask.perps.teardown_state",
|
|
116
|
+
"provider": "hyperliquid",
|
|
117
|
+
"network": "testnet",
|
|
118
|
+
"market": "ETH",
|
|
119
|
+
"page": "home",
|
|
120
|
+
"positions": false,
|
|
121
|
+
"orders": {
|
|
122
|
+
"state": "none",
|
|
123
|
+
"mode": "matching",
|
|
124
|
+
"market": "ETH",
|
|
125
|
+
"timeout_ms": 60000
|
|
126
|
+
},
|
|
127
|
+
"intent": "Cancel the deterministic testnet order after evidence capture",
|
|
128
|
+
"timeout_ms": 90000,
|
|
129
|
+
"next": "done"
|
|
130
|
+
},
|
|
131
|
+
"done": {
|
|
132
|
+
"action": "end",
|
|
133
|
+
"status": "pass"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
package/library/recipes/mobile/perps/performance.homepage.android-network-recovery.recipe.json
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
|
|
3
|
+
"title": "Android Homepage Perps network recovery visible performance proof",
|
|
4
|
+
"description": "Keeps a deterministic order visible on Wallet Home while the selected Android device goes offline and online, then validates resident-to-fresh recovery at the visible frame.",
|
|
5
|
+
"workflow": {
|
|
6
|
+
"entry": "prepare-open-order",
|
|
7
|
+
"nodes": {
|
|
8
|
+
"prepare-open-order": {
|
|
9
|
+
"action": "metamask.perps.start_state",
|
|
10
|
+
"profile": "open_order_testnet",
|
|
11
|
+
"provider": "hyperliquid",
|
|
12
|
+
"network": "testnet",
|
|
13
|
+
"market": "ETH",
|
|
14
|
+
"page": "perps_home",
|
|
15
|
+
"side": "short",
|
|
16
|
+
"orders": {
|
|
17
|
+
"state": "open",
|
|
18
|
+
"mode": "matching",
|
|
19
|
+
"market": "ETH",
|
|
20
|
+
"side": "short",
|
|
21
|
+
"notional": 10,
|
|
22
|
+
"leverage": 2,
|
|
23
|
+
"timeout_ms": 90000
|
|
24
|
+
},
|
|
25
|
+
"positions": false,
|
|
26
|
+
"intent": "Prepare a deterministic live order before network interruption",
|
|
27
|
+
"timeout_ms": 120000,
|
|
28
|
+
"next": "open-wallet-home"
|
|
29
|
+
},
|
|
30
|
+
"open-wallet-home": {
|
|
31
|
+
"action": "ui.navigate",
|
|
32
|
+
"page": "home",
|
|
33
|
+
"intent": "Open Wallet Home before interrupting network access",
|
|
34
|
+
"timeout_ms": 30000,
|
|
35
|
+
"next": "show-content"
|
|
36
|
+
},
|
|
37
|
+
"show-content": {
|
|
38
|
+
"action": "ui.scroll",
|
|
39
|
+
"test_id": "homepage-perps-positions",
|
|
40
|
+
"scroll_into_view": true,
|
|
41
|
+
"animated": true,
|
|
42
|
+
"settle": true,
|
|
43
|
+
"intent": "Make the live order directly visible during network recovery",
|
|
44
|
+
"timeout_ms": 30000,
|
|
45
|
+
"next": "wait-order-before"
|
|
46
|
+
},
|
|
47
|
+
"wait-order-before": {
|
|
48
|
+
"action": "ui.wait_for",
|
|
49
|
+
"text": "Limit short",
|
|
50
|
+
"expected": "visible",
|
|
51
|
+
"intent": "Prove the live order is visible before network interruption",
|
|
52
|
+
"timeout_ms": 30000,
|
|
53
|
+
"next": "start-performance-capture"
|
|
54
|
+
},
|
|
55
|
+
"start-performance-capture": {
|
|
56
|
+
"action": "metamask.perps.capture_performance",
|
|
57
|
+
"phase": "start",
|
|
58
|
+
"intent": "Start the evidence window before connectivity changes",
|
|
59
|
+
"next": "go-offline"
|
|
60
|
+
},
|
|
61
|
+
"go-offline": {
|
|
62
|
+
"action": "app.network",
|
|
63
|
+
"state": "offline",
|
|
64
|
+
"settle_ms": 5000,
|
|
65
|
+
"intent": "Disconnect the selected Android device while the order remains on screen",
|
|
66
|
+
"next": "hold-offline"
|
|
67
|
+
},
|
|
68
|
+
"hold-offline": {
|
|
69
|
+
"action": "wait",
|
|
70
|
+
"duration_ms": 5000,
|
|
71
|
+
"intent": "Keep the device offline long enough for stream connectivity loss",
|
|
72
|
+
"next": "restore-network"
|
|
73
|
+
},
|
|
74
|
+
"restore-network": {
|
|
75
|
+
"action": "app.network",
|
|
76
|
+
"state": "online",
|
|
77
|
+
"settle_ms": 15000,
|
|
78
|
+
"intent": "Restore the selected Android device and allow Perps streams to recover",
|
|
79
|
+
"next": "show-content-after"
|
|
80
|
+
},
|
|
81
|
+
"show-content-after": {
|
|
82
|
+
"action": "ui.scroll",
|
|
83
|
+
"test_id": "homepage-perps-positions",
|
|
84
|
+
"scroll_into_view": true,
|
|
85
|
+
"animated": true,
|
|
86
|
+
"settle": true,
|
|
87
|
+
"intent": "Keep the recovered order directly reviewable",
|
|
88
|
+
"timeout_ms": 30000,
|
|
89
|
+
"next": "wait-order-after"
|
|
90
|
+
},
|
|
91
|
+
"wait-order-after": {
|
|
92
|
+
"action": "ui.wait_for",
|
|
93
|
+
"text": "Limit short",
|
|
94
|
+
"expected": "visible",
|
|
95
|
+
"intent": "Prove the live order remains visible after network recovery",
|
|
96
|
+
"timeout_ms": 30000,
|
|
97
|
+
"next": "capture-after"
|
|
98
|
+
},
|
|
99
|
+
"capture-after": {
|
|
100
|
+
"action": "ui.screenshot",
|
|
101
|
+
"path": "screenshots/homepage-order-after-network-recovery.png",
|
|
102
|
+
"intent": "Preserve reviewer-visible network recovery proof",
|
|
103
|
+
"next": "settle-frame"
|
|
104
|
+
},
|
|
105
|
+
"settle-frame": {
|
|
106
|
+
"action": "wait",
|
|
107
|
+
"duration_ms": 2500,
|
|
108
|
+
"intent": "Allow the fresh visible frame checkpoint to finish",
|
|
109
|
+
"next": "finish-performance-capture"
|
|
110
|
+
},
|
|
111
|
+
"finish-performance-capture": {
|
|
112
|
+
"action": "metamask.perps.capture_performance",
|
|
113
|
+
"phase": "end",
|
|
114
|
+
"required_stages": [
|
|
115
|
+
"viewport_demand",
|
|
116
|
+
"socket_received",
|
|
117
|
+
"react_commit",
|
|
118
|
+
"next_frame_checkpoint"
|
|
119
|
+
],
|
|
120
|
+
"required_lifecycles": ["network_recovery"],
|
|
121
|
+
"required_sources": ["resident_state", "fresh_socket"],
|
|
122
|
+
"required_fresh_content_variants": ["orders"],
|
|
123
|
+
"intent": "Preserve and validate the network-recovery measurement cohort",
|
|
124
|
+
"next": "cleanup-order"
|
|
125
|
+
},
|
|
126
|
+
"cleanup-order": {
|
|
127
|
+
"action": "metamask.perps.teardown_state",
|
|
128
|
+
"provider": "hyperliquid",
|
|
129
|
+
"network": "testnet",
|
|
130
|
+
"market": "ETH",
|
|
131
|
+
"page": "home",
|
|
132
|
+
"positions": false,
|
|
133
|
+
"orders": {
|
|
134
|
+
"state": "none",
|
|
135
|
+
"mode": "matching",
|
|
136
|
+
"market": "ETH",
|
|
137
|
+
"timeout_ms": 60000
|
|
138
|
+
},
|
|
139
|
+
"intent": "Cancel the deterministic testnet order after evidence capture",
|
|
140
|
+
"timeout_ms": 90000,
|
|
141
|
+
"next": "done"
|
|
142
|
+
},
|
|
143
|
+
"done": {
|
|
144
|
+
"action": "end",
|
|
145
|
+
"status": "pass"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
package/library/recipes/mobile/perps/performance.homepage.ios-background-reconnect.recipe.json
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
|
|
3
|
+
"title": "iOS Homepage Perps long-background reconnect proof",
|
|
4
|
+
"description": "Keeps the existing no-order simulator fixture, backgrounds longer than the connection grace period, then validates resident-to-fresh trending content at the visible Homepage endpoint.",
|
|
5
|
+
"workflow": {
|
|
6
|
+
"entry": "ensure-wallet",
|
|
7
|
+
"nodes": {
|
|
8
|
+
"ensure-wallet": {
|
|
9
|
+
"action": "metamask.wallet.ensure_unlocked",
|
|
10
|
+
"intent": "Use the existing fixture without fabricating Perps state",
|
|
11
|
+
"next": "open-wallet-home"
|
|
12
|
+
},
|
|
13
|
+
"open-wallet-home": {
|
|
14
|
+
"action": "ui.navigate",
|
|
15
|
+
"page": "home",
|
|
16
|
+
"intent": "Open Wallet Home before the reconnect lifecycle",
|
|
17
|
+
"timeout_ms": 30000,
|
|
18
|
+
"next": "wait-perps-before"
|
|
19
|
+
},
|
|
20
|
+
"wait-perps-before": {
|
|
21
|
+
"action": "ui.wait_for",
|
|
22
|
+
"test_id": "homepage-section-title-perps",
|
|
23
|
+
"expected": "present",
|
|
24
|
+
"intent": "Require the Perps section before backgrounding",
|
|
25
|
+
"timeout_ms": 30000,
|
|
26
|
+
"next": "show-perps-before"
|
|
27
|
+
},
|
|
28
|
+
"show-perps-before": {
|
|
29
|
+
"action": "ui.scroll",
|
|
30
|
+
"test_id": "homepage-section-title-perps",
|
|
31
|
+
"scroll_into_view": true,
|
|
32
|
+
"animated": true,
|
|
33
|
+
"settle": true,
|
|
34
|
+
"intent": "Make the data-backed section resident before reconnect",
|
|
35
|
+
"timeout_ms": 30000,
|
|
36
|
+
"next": "start-performance-capture"
|
|
37
|
+
},
|
|
38
|
+
"start-performance-capture": {
|
|
39
|
+
"action": "metamask.perps.capture_performance",
|
|
40
|
+
"phase": "start",
|
|
41
|
+
"intent": "Start evidence immediately before the long background interval",
|
|
42
|
+
"next": "background-app"
|
|
43
|
+
},
|
|
44
|
+
"background-app": {
|
|
45
|
+
"action": "app.lifecycle",
|
|
46
|
+
"command": "background",
|
|
47
|
+
"settle_ms": 25000,
|
|
48
|
+
"intent": "Exceed the 20-second Perps connection grace period",
|
|
49
|
+
"next": "foreground-app"
|
|
50
|
+
},
|
|
51
|
+
"foreground-app": {
|
|
52
|
+
"action": "app.lifecycle",
|
|
53
|
+
"command": "foreground",
|
|
54
|
+
"settle_ms": 10000,
|
|
55
|
+
"runtime_ready_timeout_ms": 60000,
|
|
56
|
+
"intent": "Restore the same process and require a reconnect",
|
|
57
|
+
"next": "wait-perps-after"
|
|
58
|
+
},
|
|
59
|
+
"wait-perps-after": {
|
|
60
|
+
"action": "ui.wait_for",
|
|
61
|
+
"test_id": "homepage-section-title-perps",
|
|
62
|
+
"expected": "present",
|
|
63
|
+
"intent": "Confirm the Perps section remains available after reconnect",
|
|
64
|
+
"timeout_ms": 30000,
|
|
65
|
+
"next": "show-perps-after"
|
|
66
|
+
},
|
|
67
|
+
"show-perps-after": {
|
|
68
|
+
"action": "ui.scroll",
|
|
69
|
+
"test_id": "homepage-section-title-perps",
|
|
70
|
+
"scroll_into_view": true,
|
|
71
|
+
"animated": true,
|
|
72
|
+
"settle": true,
|
|
73
|
+
"intent": "Bring reconnected content into the viewport",
|
|
74
|
+
"timeout_ms": 30000,
|
|
75
|
+
"next": "capture-after"
|
|
76
|
+
},
|
|
77
|
+
"capture-after": {
|
|
78
|
+
"action": "ui.screenshot",
|
|
79
|
+
"path": "screenshots/ios-homepage-perps-after-reconnect.png",
|
|
80
|
+
"intent": "Preserve visible reconnect content",
|
|
81
|
+
"next": "settle-frame"
|
|
82
|
+
},
|
|
83
|
+
"settle-frame": {
|
|
84
|
+
"action": "wait",
|
|
85
|
+
"duration_ms": 2500,
|
|
86
|
+
"intent": "Allow the fresh visible frame checkpoint to finish",
|
|
87
|
+
"next": "finish-performance-capture"
|
|
88
|
+
},
|
|
89
|
+
"finish-performance-capture": {
|
|
90
|
+
"action": "metamask.perps.capture_performance",
|
|
91
|
+
"phase": "end",
|
|
92
|
+
"required_stages": [
|
|
93
|
+
"viewport_demand",
|
|
94
|
+
"socket_received",
|
|
95
|
+
"react_commit",
|
|
96
|
+
"next_frame_checkpoint"
|
|
97
|
+
],
|
|
98
|
+
"required_lifecycles": ["background_reconnect"],
|
|
99
|
+
"required_sources": ["resident_state", "fresh_socket"],
|
|
100
|
+
"required_fresh_content_variants": ["trending"],
|
|
101
|
+
"intent": "Require the long-background visible reconnect cohort",
|
|
102
|
+
"next": "done"
|
|
103
|
+
},
|
|
104
|
+
"done": {
|
|
105
|
+
"action": "end",
|
|
106
|
+
"status": "pass"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://farmslot.io/schemas/recipe-v1.schema.json",
|
|
3
|
+
"title": "iOS Homepage Perps short-background visible performance proof",
|
|
4
|
+
"description": "Uses the existing fixture wallet without requiring a funded Perps account, restores the assigned iOS simulator from a short background interval, and proves that visible Perps content emits lifecycle-aware performance evidence.",
|
|
5
|
+
"workflow": {
|
|
6
|
+
"entry": "ensure-wallet",
|
|
7
|
+
"nodes": {
|
|
8
|
+
"ensure-wallet": {
|
|
9
|
+
"action": "metamask.wallet.ensure_unlocked",
|
|
10
|
+
"intent": "Use the existing fixture wallet without replacing its account state",
|
|
11
|
+
"next": "open-wallet-home"
|
|
12
|
+
},
|
|
13
|
+
"open-wallet-home": {
|
|
14
|
+
"action": "ui.navigate",
|
|
15
|
+
"page": "home",
|
|
16
|
+
"intent": "Open Wallet Home before the lifecycle transition",
|
|
17
|
+
"timeout_ms": 30000,
|
|
18
|
+
"next": "wait-perps-section"
|
|
19
|
+
},
|
|
20
|
+
"wait-perps-section": {
|
|
21
|
+
"action": "ui.wait_for",
|
|
22
|
+
"test_id": "homepage-section-title-perps",
|
|
23
|
+
"expected": "present",
|
|
24
|
+
"intent": "Require the Perps Homepage section to exist before measuring it",
|
|
25
|
+
"timeout_ms": 30000,
|
|
26
|
+
"next": "show-perps-section"
|
|
27
|
+
},
|
|
28
|
+
"show-perps-section": {
|
|
29
|
+
"action": "ui.scroll",
|
|
30
|
+
"test_id": "homepage-section-title-perps",
|
|
31
|
+
"scroll_into_view": true,
|
|
32
|
+
"animated": true,
|
|
33
|
+
"settle": true,
|
|
34
|
+
"intent": "Bring actual Perps content into the viewport before backgrounding",
|
|
35
|
+
"timeout_ms": 30000,
|
|
36
|
+
"next": "start-performance-capture"
|
|
37
|
+
},
|
|
38
|
+
"start-performance-capture": {
|
|
39
|
+
"action": "metamask.perps.capture_performance",
|
|
40
|
+
"phase": "start",
|
|
41
|
+
"intent": "Start the device-log evidence window immediately before backgrounding",
|
|
42
|
+
"next": "background-app"
|
|
43
|
+
},
|
|
44
|
+
"background-app": {
|
|
45
|
+
"action": "app.lifecycle",
|
|
46
|
+
"command": "background",
|
|
47
|
+
"settle_ms": 3000,
|
|
48
|
+
"intent": "Leave the app inactive for less than the reconnect grace period",
|
|
49
|
+
"next": "foreground-app"
|
|
50
|
+
},
|
|
51
|
+
"foreground-app": {
|
|
52
|
+
"action": "app.lifecycle",
|
|
53
|
+
"command": "foreground",
|
|
54
|
+
"settle_ms": 10000,
|
|
55
|
+
"runtime_ready_timeout_ms": 60000,
|
|
56
|
+
"intent": "Restore the same iOS process and wallet session",
|
|
57
|
+
"next": "wait-perps-after"
|
|
58
|
+
},
|
|
59
|
+
"wait-perps-after": {
|
|
60
|
+
"action": "ui.wait_for",
|
|
61
|
+
"test_id": "homepage-section-title-perps",
|
|
62
|
+
"expected": "present",
|
|
63
|
+
"intent": "Confirm the Homepage Perps section survived the short background interval",
|
|
64
|
+
"timeout_ms": 30000,
|
|
65
|
+
"next": "show-perps-after"
|
|
66
|
+
},
|
|
67
|
+
"show-perps-after": {
|
|
68
|
+
"action": "ui.scroll",
|
|
69
|
+
"test_id": "homepage-section-title-perps",
|
|
70
|
+
"scroll_into_view": true,
|
|
71
|
+
"animated": true,
|
|
72
|
+
"settle": true,
|
|
73
|
+
"intent": "Bring the restored Perps content back into the viewport",
|
|
74
|
+
"timeout_ms": 30000,
|
|
75
|
+
"next": "capture-after"
|
|
76
|
+
},
|
|
77
|
+
"capture-after": {
|
|
78
|
+
"action": "ui.screenshot",
|
|
79
|
+
"path": "screenshots/ios-homepage-perps-after-short-background.png",
|
|
80
|
+
"intent": "Preserve reviewer-visible iOS short-resume proof",
|
|
81
|
+
"next": "settle-frame"
|
|
82
|
+
},
|
|
83
|
+
"settle-frame": {
|
|
84
|
+
"action": "wait",
|
|
85
|
+
"duration_ms": 2500,
|
|
86
|
+
"intent": "Allow the visible next-frame checkpoint and Sentry span to finish",
|
|
87
|
+
"next": "finish-performance-capture"
|
|
88
|
+
},
|
|
89
|
+
"finish-performance-capture": {
|
|
90
|
+
"action": "metamask.perps.capture_performance",
|
|
91
|
+
"phase": "end",
|
|
92
|
+
"required_stages": [
|
|
93
|
+
"viewport_demand",
|
|
94
|
+
"react_commit",
|
|
95
|
+
"next_frame_checkpoint"
|
|
96
|
+
],
|
|
97
|
+
"required_lifecycles": ["background_short"],
|
|
98
|
+
"required_sources": ["resident_state", "fresh_socket"],
|
|
99
|
+
"intent": "Require a lifecycle-specific visible-content measurement cohort",
|
|
100
|
+
"next": "done"
|
|
101
|
+
},
|
|
102
|
+
"done": {
|
|
103
|
+
"action": "end",
|
|
104
|
+
"status": "pass"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|