@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/index.mjs CHANGED
@@ -3025,9 +3025,7 @@ var __webpack_modules__ = {
3025
3025
  module.exports = (string, columns, options)=>String(string).normalize().replace(/\r\n/g, '\n').split('\n').map((line)=>exec(line, columns, options)).join('\n');
3026
3026
  },
3027
3027
  "./src/index.ts" (__unused_rspack_module, __unused_rspack___webpack_exports__, __webpack_require__) {
3028
- var package_namespaceObject = {
3029
- rE: "1.10.12"
3030
- };
3028
+ var package_namespaceObject = JSON.parse('{"rE":"1.10.13-beta-20260813113249.0"}');
3031
3029
  var brace_expansion = __webpack_require__("../../node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.js");
3032
3030
  const MAX_PATTERN_LENGTH = 65536;
3033
3031
  const assertValidPattern = (pattern)=>{
@@ -10900,7 +10898,7 @@ Usage:
10900
10898
  type: 'boolean',
10901
10899
  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}`
10902
10900
  }
10903
- }).version('version', 'Show version number', "1.10.12").help().epilogue(`For complete list of configuration options, please visit:
10901
+ }).version('version', 'Show version number', "1.10.13-beta-20260813113249.0").help().epilogue(`For complete list of configuration options, please visit:
10904
10902
  • Web options: https://midscenejs.com/automate-with-scripts-in-yaml#the-web-part
10905
10903
  • Android options: https://midscenejs.com/automate-with-scripts-in-yaml#the-android-part
10906
10904
  • iOS options: https://midscenejs.com/automate-with-scripts-in-yaml#the-ios-part
@@ -12291,6 +12289,7 @@ Examples:
12291
12289
  const DEFAULT_YAML_TEST_TIMEOUT = 0;
12292
12290
  const RSTEST_YAML_BATCH_TEST_MODULE = 'virtual:midscene-yaml/batch.test.ts';
12293
12291
  const RSTEST_YAML_BATCH_TEST_NAME = 'midscene yaml batch';
12292
+ const RSTEST_YAML_SEQUENTIAL_TEST_MODULE = 'virtual:midscene-yaml/sequential.test.ts';
12294
12293
  const toPosixPath = (value)=>value.split(external_node_path_sep).join('/');
12295
12294
  const toImportLiteral = (value)=>JSON.stringify(toPosixPath(value));
12296
12295
  const toVirtualModuleId = (fileStem)=>`virtual:midscene-yaml/${fileStem}.test.ts`;
@@ -12336,6 +12335,15 @@ const testOptions = ${JSON.stringify(testOptions, null, 2)};
12336
12335
  defineYamlBatchTest(test, testOptions);
12337
12336
  `;
12338
12337
  };
12338
+ const createGeneratedSequentialTestContent = (options)=>`import { test } from ${toImportLiteral(options.rstestCoreImport)};
12339
+ import { defineYamlCaseTest } from ${toImportLiteral(options.frameworkImport)};
12340
+
12341
+ const testOptionsList = ${JSON.stringify(options.testOptions, null, 2)};
12342
+
12343
+ for (const testOptions of testOptionsList) {
12344
+ defineYamlCaseTest(test.sequential, testOptions);
12345
+ }
12346
+ `;
12339
12347
  const resolveDefaultFrameworkImport = (moduleDir)=>{
12340
12348
  const anchorDir = moduleDir ?? ('undefined' != typeof __dirname ? __dirname : void 0);
12341
12349
  const candidates = [
@@ -12424,6 +12432,37 @@ defineYamlBatchTest(test, testOptions);
12424
12432
  bail: options.bail
12425
12433
  };
12426
12434
  }
12435
+ if (1 === options.maxConcurrency) return {
12436
+ projectDir,
12437
+ outputDir,
12438
+ resultDir,
12439
+ include: [
12440
+ RSTEST_YAML_SEQUENTIAL_TEST_MODULE
12441
+ ],
12442
+ virtualModules: {
12443
+ [RSTEST_YAML_SEQUENTIAL_TEST_MODULE]: createGeneratedSequentialTestContent({
12444
+ rstestCoreImport,
12445
+ frameworkImport,
12446
+ testOptions: cases.map((item)=>({
12447
+ testName: item.testName,
12448
+ yamlFile: item.yamlFile,
12449
+ resultFile: item.resultFile,
12450
+ ...options.caseOptions?.[item.yamlFile] ? {
12451
+ caseOptions: options.caseOptions[item.yamlFile]
12452
+ } : {},
12453
+ ...options.webRuntimeOptions?.[item.yamlFile] ? {
12454
+ webRuntimeOptions: options.webRuntimeOptions[item.yamlFile]
12455
+ } : {}
12456
+ }))
12457
+ })
12458
+ },
12459
+ cases,
12460
+ sequentialTestModule: RSTEST_YAML_SEQUENTIAL_TEST_MODULE,
12461
+ maxConcurrency: 1,
12462
+ testTimeout,
12463
+ bail: options.bail,
12464
+ retry: options.retry
12465
+ };
12427
12466
  return {
12428
12467
  projectDir,
12429
12468
  outputDir,
@@ -12464,6 +12503,10 @@ defineYamlBatchTest(test, testOptions);
12464
12503
  const addAll = (message)=>{
12465
12504
  for (const item of project.cases)add(item, message);
12466
12505
  };
12506
+ const matchesTestModule = (file, testModule)=>!!testModule && [
12507
+ file.name,
12508
+ file.testPath
12509
+ ].some((key)=>key === testModule || key?.includes(testModule));
12467
12510
  const matchFileCase = (file)=>{
12468
12511
  for (const key of [
12469
12512
  file.name,
@@ -12474,20 +12517,14 @@ defineYamlBatchTest(test, testOptions);
12474
12517
  if (matched) return matched;
12475
12518
  }
12476
12519
  };
12477
- const isBatchFile = (file)=>{
12478
- if (!project.batchTest) return false;
12479
- for (const key of [
12480
- file.name,
12481
- file.testPath
12482
- ])if (key && (key === project.batchTest.testModule || key.includes(project.batchTest.testModule))) return true;
12483
- return false;
12484
- };
12520
+ const isBatchFile = (file)=>matchesTestModule(file, project.batchTest?.testModule);
12521
+ const isSequentialFile = (file)=>matchesTestModule(file, project.sequentialTestModule);
12485
12522
  const isBatchTest = (testName)=>testName === project.batchTest?.testName;
12486
12523
  for (const file of result.files ?? []){
12487
12524
  const fileCase = matchFileCase(file);
12488
12525
  for (const error of file.errors ?? []){
12489
12526
  const message = rstest_runner_errorMessage(error);
12490
- if (isBatchFile(file)) addAll(message);
12527
+ if (isBatchFile(file) || isSequentialFile(file)) addAll(message);
12491
12528
  else add(fileCase, message);
12492
12529
  }
12493
12530
  for (const testResult of file.results ?? []){