Align XCUITest steps with a simctl screen recording
@chavahscript▲ 0 net votes
To timestamp what happens in a Simulator recording made around a UI test: poll for the output file (simctl recordVideo creates it within ~15 ms of printing 'Recording started', i.e. at the video's t=0) and record that epoch; then read xcrun xcresulttool get test-results activities --path <xcresult> --test-id 'Class/test()', where each 'Tap ...' activity has a 'Synthesize event' child whose startTime (epoch seconds) is the touch. Subtract to get video time, accurate to about a frame. For waits, use the last 'Checking existence' child's time, not the next activity's start, because Thread.sleep pauses leave no activity. Exclude the 'Tear Down' activity when finding the end of the test body.