@lvce-editor/test-with-playwright 22.12.0 → 22.13.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/main.js +15 -3
- package/package.json +3 -3
package/dist/main.js
CHANGED
|
@@ -135,6 +135,7 @@ Options:
|
|
|
135
135
|
--test-path=<path> Path to the test files
|
|
136
136
|
--timeout=<ms> Test timeout in milliseconds
|
|
137
137
|
--trace-focus Log focus changes while tests run
|
|
138
|
+
--trace-renderer-worker Write renderer/worker command traces to renderer-worker-traces/
|
|
138
139
|
--update-svg-screenshots Create or update expected SVG screenshots
|
|
139
140
|
--electron-path=<path> Path to an existing Electron app executable
|
|
140
141
|
--electron-version=<ver> Override the inferred Lvce release version
|
|
@@ -489,6 +490,7 @@ const parseCliArgs = argv => {
|
|
|
489
490
|
if (parsed['trace-focus']) {
|
|
490
491
|
result.traceFocus = true;
|
|
491
492
|
}
|
|
493
|
+
setFlag(result, 'traceRendererWorker', parsed['trace-renderer-worker']);
|
|
492
494
|
setFlag(result, 'updateSvgScreenshots', parsed['update-svg-screenshots']);
|
|
493
495
|
return result;
|
|
494
496
|
};
|
|
@@ -517,6 +519,7 @@ const defaultOptions = {
|
|
|
517
519
|
runtime: 'browser',
|
|
518
520
|
testPath: '',
|
|
519
521
|
timeout: defaultTimeout,
|
|
522
|
+
traceRendererWorker: false,
|
|
520
523
|
updateSvgScreenshots: false
|
|
521
524
|
};
|
|
522
525
|
const isBrowser = value => {
|
|
@@ -525,6 +528,11 @@ const isBrowser = value => {
|
|
|
525
528
|
const isRuntime = value => {
|
|
526
529
|
return value === 'browser' || value === 'electron';
|
|
527
530
|
};
|
|
531
|
+
const validateRendererWorkerTrace = (traceRendererWorker, runtime) => {
|
|
532
|
+
if (traceRendererWorker && runtime === 'electron') {
|
|
533
|
+
throw new Error('[test-with-playwright] --trace-renderer-worker is only supported with --runtime=browser');
|
|
534
|
+
}
|
|
535
|
+
};
|
|
528
536
|
const getOptions = ({
|
|
529
537
|
argv,
|
|
530
538
|
env
|
|
@@ -545,6 +553,7 @@ const getOptions = ({
|
|
|
545
553
|
if (parsedArgs.reusePage && runtime === 'electron') {
|
|
546
554
|
throw new Error('[test-with-playwright] --reuse-page is only supported with --runtime=browser');
|
|
547
555
|
}
|
|
556
|
+
validateRendererWorkerTrace(parsedArgs.traceRendererWorker, runtime);
|
|
548
557
|
if (parsedArgs.reusePage && parsedArgs.svgScreenshotDir) {
|
|
549
558
|
throw new Error('[test-with-playwright] --svg-screenshot-dir is not supported with --reuse-page');
|
|
550
559
|
}
|
|
@@ -1963,7 +1972,8 @@ const runAllTests = async ({
|
|
|
1963
1972
|
testPath,
|
|
1964
1973
|
testWorkerUri,
|
|
1965
1974
|
timeout,
|
|
1966
|
-
traceFocus
|
|
1975
|
+
traceFocus,
|
|
1976
|
+
traceRendererWorker
|
|
1967
1977
|
}) => {
|
|
1968
1978
|
// TODO use `using` once supported
|
|
1969
1979
|
const path = fileURLToPath(testWorkerUri);
|
|
@@ -1973,7 +1983,7 @@ const runAllTests = async ({
|
|
|
1973
1983
|
path,
|
|
1974
1984
|
stdio: 'inherit'
|
|
1975
1985
|
});
|
|
1976
|
-
await rpc.invoke(RunAllTests, onlyExtension, testPath, cwd, browser, headless, timeout, runtimeOptions, traceFocus, filter, reusePage, svgScreenshotOptions, coverage);
|
|
1986
|
+
await rpc.invoke(RunAllTests, onlyExtension, testPath, cwd, browser, headless, timeout, runtimeOptions, traceFocus, filter, reusePage, svgScreenshotOptions, coverage, traceRendererWorker);
|
|
1977
1987
|
await rpc.dispose();
|
|
1978
1988
|
};
|
|
1979
1989
|
|
|
@@ -2007,6 +2017,7 @@ const handleCliArgs = async ({
|
|
|
2007
2017
|
testPath,
|
|
2008
2018
|
timeout,
|
|
2009
2019
|
traceFocus,
|
|
2020
|
+
traceRendererWorker,
|
|
2010
2021
|
updateSvgScreenshots
|
|
2011
2022
|
} = options;
|
|
2012
2023
|
if (help) {
|
|
@@ -2060,7 +2071,8 @@ const handleCliArgs = async ({
|
|
|
2060
2071
|
testPath,
|
|
2061
2072
|
testWorkerUri,
|
|
2062
2073
|
timeout,
|
|
2063
|
-
traceFocus
|
|
2074
|
+
traceFocus,
|
|
2075
|
+
traceRendererWorker
|
|
2064
2076
|
});
|
|
2065
2077
|
};
|
|
2066
2078
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvce-editor/test-with-playwright",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.13.0",
|
|
4
4
|
"description": "CLI tool for running Playwright tests",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"main": "dist/main.js",
|
|
13
13
|
"bin": "bin/test-with-playwright.js",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@lvce-editor/test-with-playwright-worker": "22.
|
|
16
|
-
"@lvce-editor/test-worker": "^17.
|
|
15
|
+
"@lvce-editor/test-with-playwright-worker": "22.13.0",
|
|
16
|
+
"@lvce-editor/test-worker": "^17.8.0"
|
|
17
17
|
},
|
|
18
18
|
"engines": {
|
|
19
19
|
"node": ">=24"
|