Skip to content

Commit e567c5b

Browse files
committed
fix(help): declare native prerequisite for Maestro suites
1 parent 651a68b commit e567c5b

5 files changed

Lines changed: 40 additions & 4 deletions

File tree

‎packages/maestro/test/packed-runtime.mjs‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,21 @@ async function embedded(label) {
9999
entry,
100100
'appId: com.example.app\n---\n- evalScript: ${output.value = "ok"}\n',
101101
);
102+
assert.deepEqual(await runtime.client.sessions.list(), []);
103+
await assert.rejects(
104+
runtime.client.replay.test({ paths: [entry], backend: 'maestro', platform: 'ios' }),
105+
(error) => {
106+
assert.equal(error.code, 'INVALID_ARGS');
107+
assert.equal(error.details.reason, 'plugin-not-installed');
108+
assert.equal(error.details.package, '@agent-device/replay');
109+
assert.equal(
110+
error.details.installCommand,
111+
'agent-device plugins add @agent-device/replay',
112+
);
113+
return true;
114+
},
115+
);
116+
assert.deepEqual(await runtime.client.sessions.list(), []);
102117
const response = await runtime.client.replay.run({
103118
path: entry,
104119
backend: 'maestro',

‎packages/replay-port/src/daemon-port/__tests__/replay-backend-registry.test.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ import { getReplayBackend, openReplayBackend } from '../replay-backend-registry.
66
import { mkdtempForTestSync } from '@agent-device/test-kit';
77

88
test('help declares the exact optional package without requiring a working plugin', () => {
9-
expect(getReplayBackendDeclaration(getReplayPluginInstallation('maestro'))).toMatchObject({
9+
expect(
10+
getReplayBackendDeclaration(
11+
getReplayPluginInstallation('maestro'),
12+
getReplayPluginInstallation('ad'),
13+
),
14+
).toMatchObject({
1015
id: 'maestro',
1116
package: '@agent-device/maestro',
1217
});

‎packages/replay-port/src/daemon-port/replay-backend-declarations.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,18 @@ function formatMaestroCompatibilityReference(): string {
3737
/** Full compatibility help is composed only by help consumers, from the vetted installation. */
3838
export function getReplayBackendDeclaration(
3939
installation: ReturnType<typeof getReplayPluginInstallation>,
40+
suiteInstallation: ReturnType<typeof getReplayPluginInstallation>,
4041
): ReplayBackendDeclaration<ReplayFormat> {
4142
const body =
4243
installation.id === 'ad'
4344
? `Run agent-device plugins add ${installation.package} on the daemon host for native .ad replay and all test suites. Existing scripts and arguments stay the same. Ordinary open/close --save-script recording stays in core. Restart the daemon after changing plugins, then retry the original invocation with all its arguments.`
4445
: `agent-device help maestro
4546
46-
Install with agent-device plugins add ${installation.package} on the client and daemon host. Restart the daemon after installation.
47+
Install with agent-device plugins add ${installation.package}. ${installation.installationHint}
48+
49+
For test suites, also run agent-device plugins add ${suiteInstallation.package}. ${suiteInstallation.installationHint}
50+
51+
Restart the daemon after installing the required plugins.
4752
4853
Run Maestro compatibility flows with replay <flow.yaml> --maestro or test <path> --maestro. Bind an iOS or Android target with --platform or an existing session.
4954

‎src/cli/parser/__tests__/args-maestro-support-matrix.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ test('Maestro flag routes to the versioned compatibility help topic', () => {
2020
test('Maestro help covers the supported subset and operational boundaries', async () => {
2121
const help = await usageForCommand('maestro');
2222
expect(help).not.toBeNull();
23+
expect(help).toContain('agent-device plugins add @agent-device/maestro');
24+
expect(help).toContain('agent-device plugins add @agent-device/replay');
25+
expect(help).toContain('on the daemon host for native .ad replay and all test suites');
2326
for (const statement of [
2427
...MAESTRO_COMPAT_SUPPORTED_CAPABILITIES,
2528
...MAESTRO_COMPAT_LIMITATIONS,

‎src/commands/schema/cli-help.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ const HELP_TOPICS = {
7474
body: 'agent-device help commands',
7575
},
7676
...manualQaHelpTopics,
77-
maestro: getReplayBackendDeclaration(getReplayPluginInstallation('maestro')).help,
77+
maestro: getReplayBackendDeclaration(
78+
getReplayPluginInstallation('maestro'),
79+
getReplayPluginInstallation('ad'),
80+
).help,
7881
workflow: {
7982
summary: 'Normal agent-device bootstrap, exploration, and validation loop',
8083
body: `agent-device help workflow
@@ -881,7 +884,12 @@ export function buildCommandUsageText(commandName: string): string | null {
881884
const sections: string[] = [];
882885
if (commandName === 'replay' || commandName === 'test') {
883886
sections.push(replayPluginInstallHelp(getReplayPluginInstallation('ad')));
884-
sections.push(getReplayBackendDeclaration(getReplayPluginInstallation('ad')).help.body);
887+
sections.push(
888+
getReplayBackendDeclaration(
889+
getReplayPluginInstallation('ad'),
890+
getReplayPluginInstallation('ad'),
891+
).help.body,
892+
);
885893
sections.push(replayPluginInstallHelp(getReplayPluginInstallation('maestro')));
886894
}
887895
if (commandName === 'connect') {

0 commit comments

Comments
 (0)