@midscene/cli 1.9.5-beta-20260611051901.0 → 1.9.5
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 +22 -54
- package/dist/es/framework/index.mjs.map +1 -1
- package/dist/es/index.mjs +19 -37
- package/dist/es/index.mjs.map +1 -1
- package/dist/lib/framework/index.js +21 -53
- package/dist/lib/framework/index.js.map +1 -1
- package/dist/lib/index.js +16 -34
- package/dist/lib/index.js.map +1 -1
- package/dist/types/framework/index.d.ts +2 -18
- package/package.json +8 -8
package/dist/lib/index.js
CHANGED
|
@@ -3207,17 +3207,6 @@ var __webpack_modules__ = {
|
|
|
3207
3207
|
else console.log('\n⚠️ Some files failed or were not executed.');
|
|
3208
3208
|
return success;
|
|
3209
3209
|
}
|
|
3210
|
-
const external_node_module_namespaceObject = require("node:module");
|
|
3211
|
-
const requireFromCliPackage = ()=>(0, external_node_module_namespaceObject.createRequire)((0, external_node_path_.join)(__dirname, 'index.js'));
|
|
3212
|
-
const resolvePackageFromRstestCore = (packageName)=>{
|
|
3213
|
-
const require1 = requireFromCliPackage();
|
|
3214
|
-
const rstestPackageJsonPath = require1.resolve('@rstest/core/package.json');
|
|
3215
|
-
return (0, external_node_module_namespaceObject.createRequire)(rstestPackageJsonPath).resolve(packageName);
|
|
3216
|
-
};
|
|
3217
|
-
function resolveRstestCoreImportPath() {
|
|
3218
|
-
const require1 = requireFromCliPackage();
|
|
3219
|
-
return require1.resolve('@rstest/core');
|
|
3220
|
-
}
|
|
3221
3210
|
const DEFAULT_YAML_TEST_TIMEOUT = 0;
|
|
3222
3211
|
const RSTEST_YAML_BATCH_TEST_MODULE = 'virtual:midscene-yaml/batch.test.ts';
|
|
3223
3212
|
const RSTEST_YAML_BATCH_TEST_NAME = 'midscene yaml batch';
|
|
@@ -3244,16 +3233,9 @@ var __webpack_modules__ = {
|
|
|
3244
3233
|
webRuntimeOptions: options.webRuntimeOptions
|
|
3245
3234
|
} : {}
|
|
3246
3235
|
};
|
|
3247
|
-
return `import {
|
|
3248
|
-
import { defineYamlCaseTest } from ${toImportLiteral(options.frameworkImport)};
|
|
3236
|
+
return `import { defineYamlCaseTest } from ${toImportLiteral(options.frameworkImport)};
|
|
3249
3237
|
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
if (defineYamlCaseTest.length >= 2) {
|
|
3253
|
-
defineYamlCaseTest(test, testOptions);
|
|
3254
|
-
} else {
|
|
3255
|
-
await defineYamlCaseTest(testOptions);
|
|
3256
|
-
}
|
|
3238
|
+
defineYamlCaseTest(${JSON.stringify(testOptions, null, 2)});
|
|
3257
3239
|
`;
|
|
3258
3240
|
};
|
|
3259
3241
|
const createGeneratedBatchTestContent = (options)=>{
|
|
@@ -3262,16 +3244,9 @@ if (defineYamlCaseTest.length >= 2) {
|
|
|
3262
3244
|
config: options.config,
|
|
3263
3245
|
resultFiles: options.resultFiles
|
|
3264
3246
|
};
|
|
3265
|
-
return `import {
|
|
3266
|
-
import { defineYamlBatchTest } from ${toImportLiteral(options.frameworkImport)};
|
|
3247
|
+
return `import { defineYamlBatchTest } from ${toImportLiteral(options.frameworkImport)};
|
|
3267
3248
|
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
if (defineYamlBatchTest.length >= 2) {
|
|
3271
|
-
defineYamlBatchTest(test, testOptions);
|
|
3272
|
-
} else {
|
|
3273
|
-
await defineYamlBatchTest(testOptions);
|
|
3274
|
-
}
|
|
3249
|
+
defineYamlBatchTest(${JSON.stringify(testOptions, null, 2)});
|
|
3275
3250
|
`;
|
|
3276
3251
|
};
|
|
3277
3252
|
const resolveDefaultFrameworkImport = (moduleDir)=>{
|
|
@@ -3292,7 +3267,6 @@ if (defineYamlBatchTest.length >= 2) {
|
|
|
3292
3267
|
const outputDir = options.outputDir || (0, external_node_path_.join)((0, common_namespaceObject.getMidsceneRunSubDir)('tmp'), `rstest-yaml-${Date.now()}`);
|
|
3293
3268
|
const resultDir = options.resultDir || (0, external_node_path_.join)(outputDir, 'results');
|
|
3294
3269
|
const frameworkImport = options.frameworkImport || resolveDefaultFrameworkImport();
|
|
3295
|
-
const rstestCoreImport = options.rstestCoreImport || resolveRstestCoreImportPath();
|
|
3296
3270
|
const testTimeout = options.testTimeout ?? DEFAULT_YAML_TEST_TIMEOUT;
|
|
3297
3271
|
(0, external_node_fs_.rmSync)(outputDir, {
|
|
3298
3272
|
recursive: true,
|
|
@@ -3309,7 +3283,6 @@ if (defineYamlBatchTest.length >= 2) {
|
|
|
3309
3283
|
const resultFile = (0, external_node_path_.join)(resultDir, `${fileStem}.json`);
|
|
3310
3284
|
const testModule = toVirtualModuleId(fileStem);
|
|
3311
3285
|
virtualModules[testModule] = createGeneratedTestContent({
|
|
3312
|
-
rstestCoreImport,
|
|
3313
3286
|
frameworkImport,
|
|
3314
3287
|
yamlFile,
|
|
3315
3288
|
resultFile,
|
|
@@ -3342,7 +3315,6 @@ if (defineYamlBatchTest.length >= 2) {
|
|
|
3342
3315
|
],
|
|
3343
3316
|
virtualModules: {
|
|
3344
3317
|
[batchTest.testModule]: createGeneratedBatchTestContent({
|
|
3345
|
-
rstestCoreImport,
|
|
3346
3318
|
frameworkImport,
|
|
3347
3319
|
testName: batchTest.testName,
|
|
3348
3320
|
config: options.batchConfig,
|
|
@@ -3369,7 +3341,14 @@ if (defineYamlBatchTest.length >= 2) {
|
|
|
3369
3341
|
retry: options.retry
|
|
3370
3342
|
};
|
|
3371
3343
|
}
|
|
3344
|
+
const external_node_module_namespaceObject = require("node:module");
|
|
3372
3345
|
var external_node_url_ = __webpack_require__("node:url");
|
|
3346
|
+
const requireFromCliPackage = ()=>(0, external_node_module_namespaceObject.createRequire)((0, external_node_path_.join)(__dirname, 'index.js'));
|
|
3347
|
+
const resolvePackageFromRstestCore = (packageName)=>{
|
|
3348
|
+
const require1 = requireFromCliPackage();
|
|
3349
|
+
const rstestPackageJsonPath = require1.resolve('@rstest/core/package.json');
|
|
3350
|
+
return (0, external_node_module_namespaceObject.createRequire)(rstestPackageJsonPath).resolve(packageName);
|
|
3351
|
+
};
|
|
3373
3352
|
const formatRunError = (error)=>error.stack || `${error.name}: ${error.message}`;
|
|
3374
3353
|
const collectRunErrors = (result)=>{
|
|
3375
3354
|
const messages = [];
|
|
@@ -3552,6 +3531,7 @@ if (defineYamlBatchTest.length >= 2) {
|
|
|
3552
3531
|
const success = printExecutionSummary(results, summaryPath);
|
|
3553
3532
|
return success ? exitCode : 1;
|
|
3554
3533
|
}
|
|
3534
|
+
require("@rstest/core");
|
|
3555
3535
|
__webpack_require__("@midscene/core/yaml");
|
|
3556
3536
|
require("@midscene/web/puppeteer-agent-launcher");
|
|
3557
3537
|
__webpack_require__("lodash.merge");
|
|
@@ -3575,7 +3555,9 @@ if (defineYamlBatchTest.length >= 2) {
|
|
|
3575
3555
|
const cli_namespaceObject = require("@midscene/shared/cli");
|
|
3576
3556
|
var main = __webpack_require__("../../node_modules/.pnpm/dotenv@16.4.5/node_modules/dotenv/lib/main.js");
|
|
3577
3557
|
var main_default = /*#__PURE__*/ __webpack_require__.n(main);
|
|
3578
|
-
var package_namespaceObject =
|
|
3558
|
+
var package_namespaceObject = {
|
|
3559
|
+
rE: "1.9.5"
|
|
3560
|
+
};
|
|
3579
3561
|
var logger_ = __webpack_require__("@midscene/shared/logger");
|
|
3580
3562
|
var brace_expansion = __webpack_require__("../../node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js");
|
|
3581
3563
|
const MAX_PATTERN_LENGTH = 65536;
|
|
@@ -11417,7 +11399,7 @@ Usage:
|
|
|
11417
11399
|
type: 'boolean',
|
|
11418
11400
|
description: `Turn on logging to help debug why certain keys or values are not being set as you expect, default is ${config_factory_defaultConfig.dotenvDebug}`
|
|
11419
11401
|
}
|
|
11420
|
-
}).version('version', 'Show version number', "1.9.5
|
|
11402
|
+
}).version('version', 'Show version number', "1.9.5").help().epilogue(`For complete list of configuration options, please visit:
|
|
11421
11403
|
• Web options: https://midscenejs.com/automate-with-scripts-in-yaml#the-web-part
|
|
11422
11404
|
• Android options: https://midscenejs.com/automate-with-scripts-in-yaml#the-android-part
|
|
11423
11405
|
• iOS options: https://midscenejs.com/automate-with-scripts-in-yaml#the-ios-part
|