Skip to content

Commit 03fd91b

Browse files
committed
test: identify cold-touch outcomes by committed source
1 parent efa86b4 commit 03fd91b

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

‎scripts/repro-cold-simulator-touch.mjs‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Each iteration erases and cold-boots the target simulator, prepares the
44
// agent-device XCUITest runner, opens the Scenario Lab free-form scenario and
55
// issues the same `gesture drag` the device-contract job uses. It then records
6-
// whether the app observed the drop (`Callback count` increments) and runs a
6+
// whether the app committed a drop from that gesture's source and runs a
77
// small set of follow-up probes that tell the failure modes apart:
88
//
99
// second-gesture same app instance, same private event synthesis path
@@ -51,8 +51,16 @@ const initialOrder =
5151
// The contract drag (card-0 before card-3). The follow-up drag on the same app
5252
// instance moves the last card to the top so it always changes the order
5353
// whatever the first drag did.
54-
const contractDrag = { source: 'id="card-card-0"', destination: 'id="card-card-3"' };
55-
const followUpDrag = { source: 'id="card-card-5"', destination: 'id="card-card-1"' };
54+
const contractDrag = {
55+
source: 'id="card-card-0"',
56+
destination: 'id="card-card-3"',
57+
expected: 'Last committed event: {"sourceIds":["card-0"]',
58+
};
59+
const followUpDrag = {
60+
source: 'id="card-card-5"',
61+
destination: 'id="card-card-1"',
62+
expected: 'Last committed event: {"sourceIds":["card-5"]',
63+
};
5664
const timing = { sourceHoldMs: 650, moveMs: 1200, destinationHoldMs: 8000 };
5765
const agentDevice =
5866
process.env.AGENT_DEVICE_BIN ?? resolve('node_modules/.bin/agent-device');
@@ -253,9 +261,8 @@ async function iteration(index, udid) {
253261
recorder = startRecording(udid, resolve(iterationRoot, 'screen.mp4'));
254262
record.steps.recordingStarted = await recorder.waitStarted();
255263

256-
let deliveredCount = 0;
257264
const gestureAttempt = (name, drag) => {
258-
const expected = `Callback count: ${deliveredCount + 1}`;
265+
const expected = drag.expected;
259266
const startedAt = iso();
260267
const gesture = session(
261268
[
@@ -280,7 +287,6 @@ async function iteration(index, udid) {
280287
waitJson = JSON.parse(wait.stdout);
281288
} catch {}
282289
const delivered = wait.status === 0;
283-
if (delivered) deliveredCount += 1;
284290
// These are observation classes, not touch-transport measurements:
285291
// lost no expected effect observed before the wait failed
286292
// late effect observed after the post-command wait threshold
@@ -332,7 +338,6 @@ async function iteration(index, udid) {
332338
session(['wait', initialOrder, '30000', '--depth', '100']),
333339
];
334340
if (relaunch.every((result) => result.status === 0)) {
335-
deliveredCount = 0;
336341
record.probes.relaunchGesture = gestureAttempt('gesture-after-app-relaunch', contractDrag);
337342
} else {
338343
record.probes.relaunchGesture = { skipped: 'relaunch failed' };

0 commit comments

Comments
 (0)