@lvce-editor/test-with-playwright 20.0.0 → 20.2.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/README.md CHANGED
@@ -33,7 +33,7 @@ test('sample.hello-world', async () => {
33
33
  - `--server-path`: explicit server entry point
34
34
  - `--filter`: run only matching tests
35
35
  - `--headless`: run Playwright in headless mode
36
- - `--browser`: browser engine to launch, either `chromium` or `firefox`
36
+ - `--browser`: browser engine to launch: `chromium`, `firefox`, or `webkit`
37
37
  - `--trace-focus`: add `traceFocus=true` to test URLs
38
38
  - `--electron-path`: path to an existing Electron app executable
39
39
  - `--electron-version`: Lvce release version to download, required for `--runtime=electron` when `--electron-path` is not provided
package/dist/main.js CHANGED
@@ -120,7 +120,7 @@ const getHelpMessage = () => {
120
120
  return `Usage: test-with-playwright [options]
121
121
 
122
122
  Options:
123
- --browser=<browser> Browser to run tests in: chromium or firefox
123
+ --browser=<browser> Browser to run tests in: chromium, firefox, or webkit
124
124
  --runtime=<runtime> Runtime to run tests in: browser or electron
125
125
  --filter=<pattern> Only run tests matching the filter
126
126
  --headless Run the browser in headless mode
@@ -456,6 +456,7 @@ const parseEnv = env => {
456
456
  return options;
457
457
  };
458
458
 
459
+ const browsers = ['chromium', 'firefox', 'webkit'];
459
460
  const defaultOptions = {
460
461
  browser: 'chromium',
461
462
  extensionPath: '',
@@ -465,7 +466,7 @@ const defaultOptions = {
465
466
  testPath: ''
466
467
  };
467
468
  const isBrowser = value => {
468
- return value === 'chromium' || value === 'firefox';
469
+ return browsers.includes(value);
469
470
  };
470
471
  const isRuntime = value => {
471
472
  return value === 'browser' || value === 'electron';
@@ -585,16 +586,11 @@ const findElectronExecutable = async ({
585
586
  if (executable) {
586
587
  return executable;
587
588
  }
588
- } else if (platform === 'win32') {
589
- const executable = await findFile(directory, isWindowsExecutable);
590
- if (executable) {
591
- return executable;
592
- }
593
- } else {
594
- const executable = await findFile(directory, entry => entry === 'lvce');
595
- if (executable) {
596
- return executable;
597
- }
589
+ }
590
+ const predicate = platform === 'win32' ? isWindowsExecutable : entry => entry === 'lvce';
591
+ const executable = await findFile(directory, predicate);
592
+ if (executable) {
593
+ return executable;
598
594
  }
599
595
  throw new Error(`[test-with-playwright] failed to locate Electron executable in ${directory}`);
600
596
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/test-with-playwright",
3
- "version": "20.0.0",
3
+ "version": "20.2.0",
4
4
  "description": "CLI tool for running Playwright tests",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,7 @@
12
12
  "main": "dist/main.js",
13
13
  "bin": "bin/test-with-playwright.js",
14
14
  "dependencies": {
15
- "@lvce-editor/test-with-playwright-worker": "20.0.0",
15
+ "@lvce-editor/test-with-playwright-worker": "20.2.0",
16
16
  "@lvce-editor/test-worker": "^16.4.0"
17
17
  },
18
18
  "engines": {