|
1 | 1 | import assert from 'node:assert/strict'; |
2 | | -import fs from 'node:fs'; |
3 | | - |
4 | 2 | import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts'; |
5 | 3 | import type { RawSnapshotNode } from '@agent-device/kernel/snapshot'; |
6 | 4 | import type { SnapshotDiffLine } from '../../../src/snapshot/snapshot-diff.ts'; |
7 | | -import { isPlayableVideo } from '../../../src/utils/video.ts'; |
8 | 5 | import { |
9 | 6 | assertFilesDiffer, |
10 | 7 | assertJsonContains, |
| 8 | + assertMp4File, |
| 9 | + assertNonEmptyFile, |
11 | 10 | createLiveDeviceAssertions, |
12 | 11 | } from '../live-device-e2e/assertions.ts'; |
13 | 12 | import type { CliJsonResult } from '../cli-json.ts'; |
14 | 13 | import type { AndroidEmulatorBehaviorId } from './behavior-coverage.ts'; |
15 | 14 | import { type LiveContext, runStep, verifyCommand } from './live-harness.ts'; |
16 | 15 |
|
17 | | -export { assertFilesDiffer, assertJsonContains }; |
18 | | - |
19 | | -export function assertNonEmptyFile(filePath: string, name: string): void { |
20 | | - assert.ok(fs.statSync(filePath).size > 0, `${name} artifact is empty: ${filePath}`); |
21 | | -} |
22 | | - |
23 | | -export async function assertMp4File(filePath: string): Promise<void> { |
24 | | - assertNonEmptyFile(filePath, 'recording'); |
25 | | - assert.equal( |
26 | | - await isPlayableVideo(filePath), |
27 | | - true, |
28 | | - `recording is not a finalized playable video: ${filePath}`, |
29 | | - ); |
30 | | -} |
| 16 | +export { assertFilesDiffer, assertJsonContains, assertMp4File, assertNonEmptyFile }; |
31 | 17 |
|
32 | 18 | export const { assertElementText, assertWaitSelector, assertWaitText, capturePng } = |
33 | 19 | createLiveDeviceAssertions<AndroidEmulatorBehaviorId, LiveContext>( |
|
0 commit comments