flashwright-test 1.64.1-flashwright.1 → 1.64.1-flashwright.2

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.
Files changed (3) hide show
  1. package/README.md +2 -0
  2. package/cli.js +11 -13
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -13,4 +13,6 @@ npx playwright install chromium
13
13
 
14
14
  Without the test runner, `playwright` is `flashwright` and `playwright-core` is `flashwright-core`. See the [project page](https://github.com/xcodebeast/flashwright) for benchmarks, speed options and the differences from Playwright.
15
15
 
16
+ Re-running tests, like an agent checking its work? Outside CI, a warm session keeps the browser between runs, so one test re-runs in about 0.1 s instead of 0.7 s with Playwright ([warm session](https://github.com/xcodebeast/flashwright#warm-session); `FLASHWRIGHT_SESSION=0` turns it off).
17
+
16
18
  Flashwright is an independent fork and is not affiliated with Microsoft. Apache-2.0, like Playwright.
package/cli.js CHANGED
@@ -24,16 +24,14 @@ if (nodeModule.enableCompileCache && !process.env.NODE_DISABLE_COMPILE_CACHE) {
24
24
  process.env.NODE_COMPILE_CACHE = directory;
25
25
  }
26
26
 
27
- // Flashwright: compile Playwright's bundles with code caches that include their lazily compiled
28
- // functions (see codeCache.ts).
29
- require('playwright/lib/codeCache').installCodeCache(process.argv[2] === 'test' ? 'runner' : 'cli');
30
-
31
- // Flashwright: start the first test worker while the CLI loads.
32
- require('playwright/lib/runner/workerStandby').prespawnWorkerForTestCommand(process.argv);
33
- // Flashwright: `cli` commands only forward to a browser session; skip loading every command.
34
- if (process.argv[2] === 'cli') {
35
- require('playwright-core/lib/coreBundle').runCliClient();
36
- } else {
37
- const { program } = require('playwright/lib/program');
38
- program.parse(process.argv);
39
- }
27
+ // Flashwright: runs the command here, or in a runner process that the warm session prepared
28
+ // ahead of time (see session.ts). `cli` commands only forward to a browser session.
29
+ require('playwright/lib/runner/session').runCli(process.argv, {
30
+ // Compiles Playwright's bundles with code caches that include their lazily compiled functions.
31
+ installCodeCache: role => require('playwright/lib/codeCache').installCodeCache(role),
32
+ // Starts the first test workers while the CLI loads.
33
+ prespawnWorkers: argv => require('playwright/lib/runner/workerStandby').prespawnWorkerForTestCommand(argv),
34
+ retargetWorkers: argv => require('playwright/lib/runner/workerStandby').retargetStandbys(argv),
35
+ loadProgram: () => require('playwright/lib/program').program,
36
+ runCliClient: () => require('playwright-core/lib/coreBundle').runCliClient(),
37
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flashwright-test",
3
- "version": "1.64.1-flashwright.1",
3
+ "version": "1.64.1-flashwright.2",
4
4
  "description": "Flashwright: a faster drop-in replacement for Playwright (fork of Playwright 1.64.1)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "scripts": {},
32
32
  "dependencies": {
33
- "playwright": "npm:flashwright@1.64.1-flashwright.1"
33
+ "playwright": "npm:flashwright@1.64.1-flashwright.2"
34
34
  },
35
35
  "bugs": {
36
36
  "url": "https://github.com/xcodebeast/flashwright/issues"