@midscene/cli 1.10.12 → 1.10.13-beta-20260813113249.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 +48 -9
- package/dist/es/framework/index.mjs.map +1 -1
- package/dist/es/index.mjs +50 -13
- package/dist/es/index.mjs.map +1 -1
- package/dist/lib/framework/index.js +48 -9
- package/dist/lib/framework/index.js.map +1 -1
- package/dist/lib/index.js +50 -13
- package/dist/lib/index.js.map +1 -1
- package/dist/types/framework/index.d.ts +1 -0
- package/package.json +8 -8
package/dist/lib/index.js
CHANGED
|
@@ -4360,6 +4360,7 @@ var __webpack_modules__ = {
|
|
|
4360
4360
|
const DEFAULT_YAML_TEST_TIMEOUT = 0;
|
|
4361
4361
|
const RSTEST_YAML_BATCH_TEST_MODULE = 'virtual:midscene-yaml/batch.test.ts';
|
|
4362
4362
|
const RSTEST_YAML_BATCH_TEST_NAME = 'midscene yaml batch';
|
|
4363
|
+
const RSTEST_YAML_SEQUENTIAL_TEST_MODULE = 'virtual:midscene-yaml/sequential.test.ts';
|
|
4363
4364
|
const toPosixPath = (value)=>value.split(external_node_path_.sep).join('/');
|
|
4364
4365
|
const toImportLiteral = (value)=>JSON.stringify(toPosixPath(value));
|
|
4365
4366
|
const toVirtualModuleId = (fileStem)=>`virtual:midscene-yaml/${fileStem}.test.ts`;
|
|
@@ -4405,6 +4406,15 @@ const testOptions = ${JSON.stringify(testOptions, null, 2)};
|
|
|
4405
4406
|
defineYamlBatchTest(test, testOptions);
|
|
4406
4407
|
`;
|
|
4407
4408
|
};
|
|
4409
|
+
const createGeneratedSequentialTestContent = (options)=>`import { test } from ${toImportLiteral(options.rstestCoreImport)};
|
|
4410
|
+
import { defineYamlCaseTest } from ${toImportLiteral(options.frameworkImport)};
|
|
4411
|
+
|
|
4412
|
+
const testOptionsList = ${JSON.stringify(options.testOptions, null, 2)};
|
|
4413
|
+
|
|
4414
|
+
for (const testOptions of testOptionsList) {
|
|
4415
|
+
defineYamlCaseTest(test.sequential, testOptions);
|
|
4416
|
+
}
|
|
4417
|
+
`;
|
|
4408
4418
|
const resolveDefaultFrameworkImport = (moduleDir)=>{
|
|
4409
4419
|
const anchorDir = moduleDir ?? __dirname;
|
|
4410
4420
|
const candidates = [
|
|
@@ -4493,6 +4503,37 @@ defineYamlBatchTest(test, testOptions);
|
|
|
4493
4503
|
bail: options.bail
|
|
4494
4504
|
};
|
|
4495
4505
|
}
|
|
4506
|
+
if (1 === options.maxConcurrency) return {
|
|
4507
|
+
projectDir,
|
|
4508
|
+
outputDir,
|
|
4509
|
+
resultDir,
|
|
4510
|
+
include: [
|
|
4511
|
+
RSTEST_YAML_SEQUENTIAL_TEST_MODULE
|
|
4512
|
+
],
|
|
4513
|
+
virtualModules: {
|
|
4514
|
+
[RSTEST_YAML_SEQUENTIAL_TEST_MODULE]: createGeneratedSequentialTestContent({
|
|
4515
|
+
rstestCoreImport,
|
|
4516
|
+
frameworkImport,
|
|
4517
|
+
testOptions: cases.map((item)=>({
|
|
4518
|
+
testName: item.testName,
|
|
4519
|
+
yamlFile: item.yamlFile,
|
|
4520
|
+
resultFile: item.resultFile,
|
|
4521
|
+
...options.caseOptions?.[item.yamlFile] ? {
|
|
4522
|
+
caseOptions: options.caseOptions[item.yamlFile]
|
|
4523
|
+
} : {},
|
|
4524
|
+
...options.webRuntimeOptions?.[item.yamlFile] ? {
|
|
4525
|
+
webRuntimeOptions: options.webRuntimeOptions[item.yamlFile]
|
|
4526
|
+
} : {}
|
|
4527
|
+
}))
|
|
4528
|
+
})
|
|
4529
|
+
},
|
|
4530
|
+
cases,
|
|
4531
|
+
sequentialTestModule: RSTEST_YAML_SEQUENTIAL_TEST_MODULE,
|
|
4532
|
+
maxConcurrency: 1,
|
|
4533
|
+
testTimeout,
|
|
4534
|
+
bail: options.bail,
|
|
4535
|
+
retry: options.retry
|
|
4536
|
+
};
|
|
4496
4537
|
return {
|
|
4497
4538
|
projectDir,
|
|
4498
4539
|
outputDir,
|
|
@@ -4534,6 +4575,10 @@ defineYamlBatchTest(test, testOptions);
|
|
|
4534
4575
|
const addAll = (message)=>{
|
|
4535
4576
|
for (const item of project.cases)add(item, message);
|
|
4536
4577
|
};
|
|
4578
|
+
const matchesTestModule = (file, testModule)=>!!testModule && [
|
|
4579
|
+
file.name,
|
|
4580
|
+
file.testPath
|
|
4581
|
+
].some((key)=>key === testModule || key?.includes(testModule));
|
|
4537
4582
|
const matchFileCase = (file)=>{
|
|
4538
4583
|
for (const key of [
|
|
4539
4584
|
file.name,
|
|
@@ -4544,20 +4589,14 @@ defineYamlBatchTest(test, testOptions);
|
|
|
4544
4589
|
if (matched) return matched;
|
|
4545
4590
|
}
|
|
4546
4591
|
};
|
|
4547
|
-
const isBatchFile = (file)=>
|
|
4548
|
-
|
|
4549
|
-
for (const key of [
|
|
4550
|
-
file.name,
|
|
4551
|
-
file.testPath
|
|
4552
|
-
])if (key && (key === project.batchTest.testModule || key.includes(project.batchTest.testModule))) return true;
|
|
4553
|
-
return false;
|
|
4554
|
-
};
|
|
4592
|
+
const isBatchFile = (file)=>matchesTestModule(file, project.batchTest?.testModule);
|
|
4593
|
+
const isSequentialFile = (file)=>matchesTestModule(file, project.sequentialTestModule);
|
|
4555
4594
|
const isBatchTest = (testName)=>testName === project.batchTest?.testName;
|
|
4556
4595
|
for (const file of result.files ?? []){
|
|
4557
4596
|
const fileCase = matchFileCase(file);
|
|
4558
4597
|
for (const error of file.errors ?? []){
|
|
4559
4598
|
const message = rstest_runner_errorMessage(error);
|
|
4560
|
-
if (isBatchFile(file)) addAll(message);
|
|
4599
|
+
if (isBatchFile(file) || isSequentialFile(file)) addAll(message);
|
|
4561
4600
|
else add(fileCase, message);
|
|
4562
4601
|
}
|
|
4563
4602
|
for (const testResult of file.results ?? []){
|
|
@@ -4701,9 +4740,7 @@ defineYamlBatchTest(test, testOptions);
|
|
|
4701
4740
|
"use strict";
|
|
4702
4741
|
var core_ = __webpack_require__("@midscene/core");
|
|
4703
4742
|
const cli_namespaceObject = require("@midscene/shared/cli");
|
|
4704
|
-
var package_namespaceObject = {
|
|
4705
|
-
rE: "1.10.12"
|
|
4706
|
-
};
|
|
4743
|
+
var package_namespaceObject = JSON.parse('{"rE":"1.10.13-beta-20260813113249.0"}');
|
|
4707
4744
|
var external_node_fs_ = __webpack_require__("node:fs");
|
|
4708
4745
|
var external_node_fs_namespaceObject = /*#__PURE__*/ __webpack_require__.t(external_node_fs_, 2);
|
|
4709
4746
|
var external_node_path_ = __webpack_require__("node:path");
|
|
@@ -12590,7 +12627,7 @@ Usage:
|
|
|
12590
12627
|
type: 'boolean',
|
|
12591
12628
|
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}`
|
|
12592
12629
|
}
|
|
12593
|
-
}).version('version', 'Show version number', "1.10.
|
|
12630
|
+
}).version('version', 'Show version number', "1.10.13-beta-20260813113249.0").help().epilogue(`For complete list of configuration options, please visit:
|
|
12594
12631
|
• Web options: https://midscenejs.com/automate-with-scripts-in-yaml#the-web-part
|
|
12595
12632
|
• Android options: https://midscenejs.com/automate-with-scripts-in-yaml#the-android-part
|
|
12596
12633
|
• iOS options: https://midscenejs.com/automate-with-scripts-in-yaml#the-ios-part
|