@midscene/cli 1.8.11 → 1.9.1-beta-20260605030300.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/framework/index.mjs +25 -5
- package/dist/es/framework/index.mjs.map +1 -1
- package/dist/es/index.mjs +5 -6
- package/dist/es/index.mjs.map +1 -1
- package/dist/lib/framework/index.js +24 -8
- package/dist/lib/framework/index.js.map +1 -1
- package/dist/lib/index.js +4 -9
- package/dist/lib/index.js.map +1 -1
- package/package.json +8 -7
|
@@ -3056,17 +3056,14 @@ defineYamlBatchTest(${JSON.stringify(testOptions, null, 2)});
|
|
|
3056
3056
|
}
|
|
3057
3057
|
const external_node_module_namespaceObject = require("node:module");
|
|
3058
3058
|
var external_node_url_ = __webpack_require__("node:url");
|
|
3059
|
-
const
|
|
3060
|
-
const entry = process.argv[1] ? (0, external_node_path_.resolve)(process.argv[1]) : (0, external_node_path_.join)(process.cwd(), 'midscene-cli.js');
|
|
3061
|
-
return (0, external_node_module_namespaceObject.createRequire)(entry);
|
|
3062
|
-
};
|
|
3059
|
+
const requireFromCliPackage = ()=>(0, external_node_module_namespaceObject.createRequire)((0, external_node_path_.join)(__dirname, 'index.js'));
|
|
3063
3060
|
const resolvePackageFromRstestCore = (packageName)=>{
|
|
3064
|
-
const require1 =
|
|
3061
|
+
const require1 = requireFromCliPackage();
|
|
3065
3062
|
const rstestPackageJsonPath = require1.resolve('@rstest/core/package.json');
|
|
3066
3063
|
return (0, external_node_module_namespaceObject.createRequire)(rstestPackageJsonPath).resolve(packageName);
|
|
3067
3064
|
};
|
|
3068
3065
|
function resolveRstestCoreImportPath() {
|
|
3069
|
-
const require1 =
|
|
3066
|
+
const require1 = requireFromCliPackage();
|
|
3070
3067
|
const packageJsonPath = require1.resolve('@rstest/core/package.json');
|
|
3071
3068
|
return (0, external_node_path_.join)((0, external_node_path_.dirname)(packageJsonPath), 'dist', 'index.js');
|
|
3072
3069
|
}
|
|
@@ -3205,6 +3202,7 @@ defineYamlBatchTest(${JSON.stringify(testOptions, null, 2)});
|
|
|
3205
3202
|
void 0 !== webTarget,
|
|
3206
3203
|
void 0 !== clonedYamlScript.android,
|
|
3207
3204
|
void 0 !== clonedYamlScript.ios,
|
|
3205
|
+
void 0 !== clonedYamlScript.harmony,
|
|
3208
3206
|
void 0 !== clonedYamlScript.computer,
|
|
3209
3207
|
void 0 !== clonedYamlScript.interface
|
|
3210
3208
|
].filter(Boolean).length;
|
|
@@ -3213,10 +3211,11 @@ defineYamlBatchTest(${JSON.stringify(testOptions, null, 2)});
|
|
|
3213
3211
|
void 0 !== webTarget ? 'web' : null,
|
|
3214
3212
|
void 0 !== clonedYamlScript.android ? 'android' : null,
|
|
3215
3213
|
void 0 !== clonedYamlScript.ios ? 'ios' : null,
|
|
3214
|
+
void 0 !== clonedYamlScript.harmony ? 'harmony' : null,
|
|
3216
3215
|
void 0 !== clonedYamlScript.computer ? 'computer' : null,
|
|
3217
3216
|
void 0 !== clonedYamlScript.interface ? 'interface' : null
|
|
3218
3217
|
].filter(Boolean);
|
|
3219
|
-
throw new Error(`Only one target type can be specified, but found multiple: ${specifiedTargets.join(', ')}. Please specify only one of: web, android, ios, computer, or interface.`);
|
|
3218
|
+
throw new Error(`Only one target type can be specified, but found multiple: ${specifiedTargets.join(', ')}. Please specify only one of: web, android, ios, harmony, computer, or interface.`);
|
|
3220
3219
|
}
|
|
3221
3220
|
if (void 0 !== webTarget) {
|
|
3222
3221
|
if (void 0 !== clonedYamlScript.target) console.warn("target is deprecated, please use web instead. See https://midscenejs.com/automate-with-scripts-in-yaml for more information. Sorry for the inconvenience.");
|
|
@@ -3321,6 +3320,23 @@ defineYamlBatchTest(${JSON.stringify(testOptions, null, 2)});
|
|
|
3321
3320
|
freeFn
|
|
3322
3321
|
};
|
|
3323
3322
|
}
|
|
3323
|
+
if (void 0 !== clonedYamlScript.harmony) {
|
|
3324
|
+
const harmonyTarget = clonedYamlScript.harmony;
|
|
3325
|
+
const { agentFromHdcDevice } = await import("@midscene/harmony");
|
|
3326
|
+
const agent = await agentFromHdcDevice(harmonyTarget?.deviceId, {
|
|
3327
|
+
...harmonyTarget,
|
|
3328
|
+
...buildAgentOptions(clonedYamlScript.agent, preference.reportFileName, fileName)
|
|
3329
|
+
});
|
|
3330
|
+
if (harmonyTarget?.launch) await agent.launch(harmonyTarget.launch);
|
|
3331
|
+
freeFn.push({
|
|
3332
|
+
name: 'destroy_harmony_agent',
|
|
3333
|
+
fn: ()=>agent.destroy()
|
|
3334
|
+
});
|
|
3335
|
+
return {
|
|
3336
|
+
agent,
|
|
3337
|
+
freeFn
|
|
3338
|
+
};
|
|
3339
|
+
}
|
|
3324
3340
|
if (void 0 !== clonedYamlScript.computer) {
|
|
3325
3341
|
const computerTarget = clonedYamlScript.computer;
|
|
3326
3342
|
const { agentForComputer } = await import("@midscene/computer");
|
|
@@ -3363,7 +3379,7 @@ defineYamlBatchTest(${JSON.stringify(testOptions, null, 2)});
|
|
|
3363
3379
|
freeFn
|
|
3364
3380
|
};
|
|
3365
3381
|
}
|
|
3366
|
-
throw new Error('No valid interface configuration found in the yaml script, should be either "web", "android", "ios", "computer", or "interface"');
|
|
3382
|
+
throw new Error('No valid interface configuration found in the yaml script, should be either "web", "android", "ios", "harmony", "computer", or "interface"');
|
|
3367
3383
|
}, void 0, file);
|
|
3368
3384
|
return player;
|
|
3369
3385
|
}
|