-
Notifications
You must be signed in to change notification settings - Fork 120
Expand file tree
/
Copy pathandroid.test.ts
More file actions
41 lines (34 loc) · 1.43 KB
/
android.test.ts
File metadata and controls
41 lines (34 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import test from 'node:test';
import { createIntegrationTestContext, runCliJson } from './test-helpers.ts';
const session = ['--session', 'android-test'];
test.after(() => {
runCliJson(['close', '--platform', 'android', ...session]);
});
test('android settings commands', () => {
const integration = createIntegrationTestContext({
platform: 'android',
testName: 'android settings commands',
});
const openArgs = ['open', 'Settings', '--platform', 'android', '--json', ...session];
integration.runStep('open settings', openArgs);
const snapshotArgs = ['snapshot', '-i', '--json', ...session];
const snapshot = integration.runStep('snapshot', snapshotArgs);
integration.assertResult(Array.isArray(snapshot.json?.data?.nodes), 'snapshot nodes', snapshotArgs, snapshot, {
detail: 'expected snapshot to include a nodes array',
});
const clickAppsArgs = ['click', '@e13', '--json', ...session];
integration.runStep('click apps', clickAppsArgs);
const snapshotAppsArgs = ['snapshot', '-i', '--json', ...session];
const snapshotApps = integration.runStep('snapshot apps', snapshotAppsArgs);
integration.assertResult(
Array.isArray(snapshotApps.json?.data?.nodes),
'snapshot apps nodes',
snapshotAppsArgs,
snapshotApps,
{
detail: 'expected snapshot after click to include a nodes array',
},
);
const backArgs = ['back', '--json', ...session];
integration.runStep('back', backArgs);
});