@midscene/cli 1.13.1-beta-20260921075813.0 → 1.13.1-beta-20260922030100.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 +5 -20
- package/dist/es/framework/index.mjs.map +1 -1
- package/dist/es/index.mjs +7 -33
- package/dist/es/index.mjs.map +1 -1
- package/dist/lib/framework/index.js +5 -20
- package/dist/lib/framework/index.js.map +1 -1
- package/dist/lib/index.js +7 -33
- package/dist/lib/index.js.map +1 -1
- package/dist/types/framework/index.d.ts +0 -2
- package/package.json +9 -9
|
@@ -2635,7 +2635,6 @@ function printExecutionPlan(config) {
|
|
|
2635
2635
|
console.log(` Continue on error: ${config.continueOnError}`);
|
|
2636
2636
|
console.log(` Retry: ${config.retry ?? 0}`);
|
|
2637
2637
|
console.log(` Share browser context: ${config.shareBrowserContext ?? false}`);
|
|
2638
|
-
console.log(` Reuse browser page: ${config.reusePage ?? false}`);
|
|
2639
2638
|
console.log(` Summary output: ${config.summary}`);
|
|
2640
2639
|
}
|
|
2641
2640
|
function printExecutionFinished() {
|
|
@@ -3330,22 +3329,11 @@ const assertBrowserContextUsage = (setupContext, allContexts, shareBrowserContex
|
|
|
3330
3329
|
}
|
|
3331
3330
|
if (setupContext && !shareBrowserContext && 'puppeteer-web' === resolveBatchRuntimeTarget(setupContext.executionConfig)) throw new Error(`Puppeteer Web setup "${setupContext.file}" requires shareBrowserContext: true so its browser state can be shared with the main files.`);
|
|
3332
3331
|
};
|
|
3333
|
-
const createSharedBrowserRuntime = async (browser, browserContextOptions
|
|
3332
|
+
const createSharedBrowserRuntime = async (browser, browserContextOptions)=>{
|
|
3334
3333
|
const browserContext = await browser.createBrowserContext(browserContextOptions);
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
browserContext,
|
|
3339
|
-
page
|
|
3340
|
-
};
|
|
3341
|
-
} catch (error) {
|
|
3342
|
-
try {
|
|
3343
|
-
await browserContext.close();
|
|
3344
|
-
} catch (cleanupError) {
|
|
3345
|
-
batchWarning('failed to close the shared browser context after page creation failed; preserving the original error', cleanupError);
|
|
3346
|
-
}
|
|
3347
|
-
throw error;
|
|
3348
|
-
}
|
|
3334
|
+
return {
|
|
3335
|
+
browserContext
|
|
3336
|
+
};
|
|
3349
3337
|
};
|
|
3350
3338
|
class YamlBatchExecutor {
|
|
3351
3339
|
async run(options = {}) {
|
|
@@ -3430,11 +3418,10 @@ class YamlBatchExecutor {
|
|
|
3430
3418
|
sharedRuntime.current = null;
|
|
3431
3419
|
await staleRuntime.browserContext.close();
|
|
3432
3420
|
}
|
|
3433
|
-
sharedRuntime.current = await createSharedBrowserRuntime(browser, browserContextOptions
|
|
3421
|
+
sharedRuntime.current = await createSharedBrowserRuntime(browser, browserContextOptions);
|
|
3434
3422
|
for (const context of allContexts){
|
|
3435
3423
|
context.options.browser = browser;
|
|
3436
3424
|
context.options.browserContext = sharedRuntime.current.browserContext;
|
|
3437
|
-
if (sharedRuntime.current.page) context.options.page = sharedRuntime.current.page;
|
|
3438
3425
|
}
|
|
3439
3426
|
};
|
|
3440
3427
|
await resetSetupRuntime();
|
|
@@ -3714,8 +3701,6 @@ class YamlBatchExecutor {
|
|
|
3714
3701
|
}, (_, index)=>`batch-occurrence-${index + 1}`);
|
|
3715
3702
|
if (this.caseIds.length !== occurrenceCount) throw new Error(`Batch occurrence identity mismatch: expected ${occurrenceCount} case ID(s), received ${this.caseIds.length}`);
|
|
3716
3703
|
if (new Set(this.caseIds).size !== this.caseIds.length) throw new Error('Batch occurrence case IDs must be unique');
|
|
3717
|
-
if (config.reusePage && !config.shareBrowserContext) throw new Error('reusePage requires shareBrowserContext: true');
|
|
3718
|
-
if (config.reusePage && 1 !== config.concurrent) throw new Error('reusePage requires concurrent: 1');
|
|
3719
3704
|
}
|
|
3720
3705
|
}
|
|
3721
3706
|
async function runYamlBatch(config, options = {}) {
|