electron-playwright-cli 0.1.2 → 0.1.3

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
@@ -26,6 +26,8 @@ Create `.playwright/cli.config.json` in your project root:
26
26
 
27
27
  The `args` array is passed to Electron. Point it at your app's main process entry point.
28
28
 
29
+ The daemon shuts down automatically when the Electron app closes (via `close` or the app exiting on its own). The next command spawns a fresh daemon that reads the current config from disk, so config changes take effect immediately — no need to manually kill the daemon.
30
+
29
31
  Optional launch options:
30
32
  - `executablePath`: path to the Electron binary (defaults to the one in node_modules)
31
33
  - `cwd`: working directory for the Electron process
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electron-playwright-cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Playwright CLI with Electron app support",
5
5
  "keywords": [
6
6
  "playwright",
package/playwright-cli.js CHANGED
@@ -128,8 +128,10 @@ async function connectToSocket(socketPath) {
128
128
  async function connectToDaemon(sessionName) {
129
129
  const socketPath = daemonSocketPath(sessionName);
130
130
 
131
- // try to connect to existing daemon
132
- if (await socketExists(socketPath)) {
131
+ // try to connect to existing daemon.
132
+ // on Windows, named pipes aren't detected by stat().isSocket(),
133
+ // so we always attempt a direct connection.
134
+ if (os.platform() === "win32" || (await socketExists(socketPath))) {
133
135
  try {
134
136
  const socket = await connectToSocket(socketPath);
135
137
  return new SocketSession(socket);
@@ -203,7 +205,7 @@ async function main() {
203
205
  const args = require("minimist")(argv);
204
206
 
205
207
  if (args.version || args.v) {
206
- const pkg = require("playwright/package.json");
208
+ const pkg = require("./package.json");
207
209
  console.log(pkg.version);
208
210
  process.exit(0);
209
211
  }
@@ -41,13 +41,14 @@ class ElectronContextFactory {
41
41
  }
42
42
 
43
43
  electronApp.process().on("exit", () => {
44
- setTimeout(() => process.exit(0), 1000);
44
+ setTimeout(() => process.exit(0), 500);
45
45
  });
46
46
 
47
47
  return {
48
48
  browserContext,
49
49
  close: async () => {
50
50
  await electronApp.close().catch(() => {});
51
+ setTimeout(() => process.exit(0), 500);
51
52
  },
52
53
  };
53
54
  } catch (e) {
@@ -33,6 +33,8 @@ Create `.playwright/cli.config.json` in your project root:
33
33
 
34
34
  The `args` array is passed to Electron. Point it at your app's main process entry point.
35
35
 
36
+ The daemon shuts down automatically when the Electron app closes (via `close` or the app exiting on its own). The next command spawns a fresh daemon that reads the current config from disk, so config changes take effect immediately — no need to manually kill the daemon.
37
+
36
38
  Optional launch options:
37
39
  - `executablePath`: path to the Electron binary (defaults to the one in node_modules)
38
40
  - `cwd`: working directory for the Electron process