mirror of
https://github.com/callstack/agent-device.git
synced 2026-09-14 20:06:34 +08:00
cd9a7ce41b
* test(android): add catalog emulator smoke coverage * test(android): use stable snapshot diff mutation * test(android): assert actual back destination * test(android): separate keyboard and fill IMEs * fix(ci): keep Android timing report in one shell * refactor(test): simplify simulator e2e coverage * test(android): assert stable diff landmarks * fix(android): release snapshot helper gracefully * fix(android): fully release snapshot helper runtime * test(android): report coverage classifications * fix(android): stabilize accessibility root capture * fix(android): bound UiAutomation connection * ci: upload worktree daemon diagnostics * fix(android): cancel stalled wait captures * fix(android): bound helper fallback lifecycle * fix(android): harden emulator e2e lifecycle * fix: align e2e changes with kernel package * test(android): prove alert helper reuse directly * fix(android): cancel stalled settle captures * fix(android): separate helper retirement budgets
37 lines
1.4 KiB
TypeScript
37 lines
1.4 KiB
TypeScript
import assert from 'node:assert/strict';
|
|
import path from 'node:path';
|
|
|
|
import { PUBLIC_COMMANDS } from '../../../src/command-catalog.ts';
|
|
import { assertPngFile } from '../provider-scenarios/assertions.ts';
|
|
import { type LiveContext, runStep, verifyCommand } from './live-harness.ts';
|
|
|
|
const C = PUBLIC_COMMANDS;
|
|
|
|
export async function assertCaptureAndClose(context: LiveContext): Promise<void> {
|
|
const screenshotPath = path.join(context.artifactDir, 'fixture-smoke.png');
|
|
const screenshot = await runStep(context, 'capture fixture screenshot', [
|
|
'screenshot',
|
|
screenshotPath,
|
|
'--max-size',
|
|
'900',
|
|
]);
|
|
assert.ok(
|
|
JSON.stringify(screenshot.json?.data).includes(screenshotPath),
|
|
JSON.stringify(screenshot.json),
|
|
);
|
|
assertPngFile(screenshotPath);
|
|
verifyCommand(context, C.screenshot, 'captured Android fixture file has a valid PNG signature');
|
|
|
|
await runStep(context, 'close fixture session', ['close']);
|
|
const sessions = await runStep(context, 'verify fixture session released', ['session', 'list'], {
|
|
commonFlags: false,
|
|
});
|
|
const inventory = Array.isArray(sessions.json?.data?.sessions) ? sessions.json.data.sessions : [];
|
|
assert.equal(
|
|
inventory.some((session: { name?: unknown }) => session.name === context.session),
|
|
false,
|
|
JSON.stringify(sessions.json),
|
|
);
|
|
verifyCommand(context, C.close, 'session inventory proves Android fixture lease was removed');
|
|
}
|