tauri-test-cli 0.3.1 → 0.4.1

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
@@ -8,16 +8,16 @@ CLI for testing Tauri applications with screenshot capture, DOM inspection, and
8
8
  # Install globally
9
9
  npm install -g tauri-test-cli
10
10
 
11
- # Install tauri-test (required)
12
- tauri-test setup
11
+ # Install tauri-driver (required)
12
+ tauri-test-cli setup
13
13
 
14
14
  # Check dependencies
15
- tauri-test check-deps
15
+ tauri-test-cli check-deps
16
16
 
17
17
  # Start server and test your app
18
- tauri-test server --app ./target/debug/my-app &
19
- tauri-test screenshot --output /tmp/screen.png
20
- tauri-test click "button.submit"
18
+ tauri-test-cli server --app ./target/debug/my-app &
19
+ tauri-test-cli screenshot --output /tmp/screen.png
20
+ tauri-test-cli click "button.submit"
21
21
  ```
22
22
 
23
23
  ## Installation
@@ -32,7 +32,7 @@ bun install -g tauri-test-cli
32
32
  pnpm install -g tauri-test-cli
33
33
 
34
34
  # Then install tauri-test
35
- tauri-test setup
35
+ tauri-test-cli setup
36
36
  ```
37
37
 
38
38
  ### Using Pixi (Recommended for Development)
@@ -57,7 +57,7 @@ pixi run dev server --app ./target/debug/my-app
57
57
  The CLI will check for missing dependencies and provide install instructions:
58
58
 
59
59
  ```bash
60
- tauri-test check-deps
60
+ tauri-test-cli check-deps
61
61
  ```
62
62
 
63
63
  <details>
@@ -73,23 +73,23 @@ sudo pacman -S webkit2gtk-4.1 # Arch
73
73
 
74
74
  # Rust and tauri-test
75
75
  curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
76
- tauri-test setup
76
+ tauri-test-cli setup
77
77
  ```
78
78
 
79
79
  #### macOS
80
80
 
81
- WebKit is included in macOS. Just install tauri-test:
81
+ WebKit is included in macOS. Just install tauri-driver:
82
82
 
83
83
  ```bash
84
- tauri-test setup
84
+ tauri-test-cli setup
85
85
  ```
86
86
 
87
87
  #### Windows
88
88
 
89
- WebView2 is included in Windows 10/11. Just install tauri-test:
89
+ WebView2 is included in Windows 10/11. Just install tauri-driver:
90
90
 
91
91
  ```bash
92
- tauri-test setup
92
+ tauri-test-cli setup
93
93
  ```
94
94
 
95
95
  </details>
@@ -102,7 +102,7 @@ Start a persistent HTTP server - send commands anytime via HTTP.
102
102
 
103
103
  ```bash
104
104
  # Start server
105
- tauri-test server --app ./target/debug/my-app &
105
+ tauri-test-cli server --app ./target/debug/my-app &
106
106
 
107
107
  # Send commands
108
108
  curl -s http://127.0.0.1:9222 -d '{"cmd":"click","selector":"button"}'
@@ -113,7 +113,7 @@ curl -s http://127.0.0.1:9222 -d '{"cmd":"snapshot"}'
113
113
  curl -s http://127.0.0.1:9222/status
114
114
 
115
115
  # Stop server
116
- tauri-test stop
116
+ tauri-test-cli stop
117
117
  ```
118
118
 
119
119
  #### Virtual Display Mode (Linux)
@@ -122,11 +122,11 @@ Run in a virtual display to avoid focus-related throttling:
122
122
 
123
123
  ```bash
124
124
  # Using built-in --xvfb flag (recommended)
125
- tauri-test server --app ./target/debug/my-app --xvfb &
125
+ tauri-test-cli server --app ./target/debug/my-app --xvfb &
126
126
 
127
127
  # Or manually with Xvfb
128
128
  Xvfb :99 -screen 0 1920x1080x24 &
129
- DISPLAY=:99 tauri-test server --app ./target/debug/my-app &
129
+ DISPLAY=:99 tauri-test-cli server --app ./target/debug/my-app &
130
130
  ```
131
131
 
132
132
  ### Client Mode (CLI without --app)
@@ -135,27 +135,27 @@ Once the server is running, you can use CLI commands directly - no `--app` neede
135
135
 
136
136
  ```bash
137
137
  # Start server once
138
- tauri-test server --app ./target/debug/my-app &
138
+ tauri-test-cli server --app ./target/debug/my-app &
139
139
 
140
140
  # Run commands - they automatically connect to the server!
141
- tauri-test click "button.submit"
142
- tauri-test type "input[name=email]" "user@example.com"
143
- tauri-test screenshot --output /tmp/screen.png
144
- tauri-test snapshot --output /tmp/dom.yaml
145
- tauri-test eval "document.title"
146
- tauri-test wait ".modal" --gone --timeout 5000
141
+ tauri-test-cli click "button.submit"
142
+ tauri-test-cli type "input[name=email]" "user@example.com"
143
+ tauri-test-cli screenshot --output /tmp/screen.png
144
+ tauri-test-cli snapshot --output /tmp/dom.yaml
145
+ tauri-test-cli eval "document.title"
146
+ tauri-test-cli wait ".modal" --gone --timeout 5000
147
147
 
148
148
  # Check server status
149
- tauri-test status
149
+ tauri-test-cli status
150
150
 
151
151
  # Stop when done
152
- tauri-test stop
152
+ tauri-test-cli stop
153
153
  ```
154
154
 
155
155
  Use `--port` to connect to a different server:
156
156
 
157
157
  ```bash
158
- tauri-test click "button" --port 8080
158
+ tauri-test-cli click "button" --port 8080
159
159
  ```
160
160
 
161
161
  ### Why Server Mode?
@@ -181,11 +181,11 @@ tauri-test click "button" --port 8080
181
181
 
182
182
  | Command | Description |
183
183
  |---------|-------------|
184
- | `tauri-test setup` | Install tauri-test via cargo |
185
- | `tauri-test status [--port]` | Check if a server is running |
186
- | `tauri-test stop [--port]` | Stop a running server |
187
- | `tauri-test cleanup` | Kill stale WebDriver processes |
188
- | `tauri-test check-deps` | Check system dependencies |
184
+ | `tauri-test-cli setup` | Install tauri-driver via cargo |
185
+ | `tauri-test-cli status [--port]` | Check if a server is running |
186
+ | `tauri-test-cli stop [--port]` | Stop a running server |
187
+ | `tauri-test-cli cleanup` | Kill stale WebDriver processes |
188
+ | `tauri-test-cli check-deps` | Check system dependencies |
189
189
 
190
190
  ### Examples
191
191
 
@@ -193,22 +193,22 @@ tauri-test click "button" --port 8080
193
193
 
194
194
  ```bash
195
195
  # Click a button
196
- tauri-test click "button.submit"
196
+ tauri-test-cli click "button.submit"
197
197
 
198
198
  # Type into an input
199
- tauri-test type "input[name=email]" "user@example.com"
199
+ tauri-test-cli type "input[name=email]" "user@example.com"
200
200
 
201
201
  # Take screenshot
202
- tauri-test screenshot --output /tmp/screen.png
202
+ tauri-test-cli screenshot --output /tmp/screen.png
203
203
 
204
204
  # Get DOM snapshot (accessibility tree in YAML format)
205
- tauri-test snapshot --output /tmp/dom.yaml
205
+ tauri-test-cli snapshot --output /tmp/dom.yaml
206
206
 
207
207
  # Execute JavaScript
208
- tauri-test eval "document.title"
208
+ tauri-test-cli eval "document.title"
209
209
 
210
210
  # Wait for element to disappear
211
- tauri-test wait ".modal" --gone --timeout 5000
211
+ tauri-test-cli wait ".modal" --gone --timeout 5000
212
212
  ```
213
213
 
214
214
  **Using curl:**
@@ -241,7 +241,7 @@ For single-invocation workflows with multiple commands:
241
241
  echo '[
242
242
  {"cmd":"click","selector":"button"},
243
243
  {"cmd":"screenshot","output":"/tmp/result.png"}
244
- ]' | tauri-test batch --app ./target/debug/my-app --json
244
+ ]' | tauri-test-cli batch --app ./target/debug/my-app --json
245
245
  ```
246
246
 
247
247
  ## Single Commands
@@ -249,9 +249,9 @@ echo '[
249
249
  Each command starts a fresh session (slower but simpler):
250
250
 
251
251
  ```bash
252
- tauri-test screenshot --app ./target/debug/my-app --output /tmp/screen.png
253
- tauri-test click "button#submit" --app ./target/debug/my-app
254
- tauri-test snapshot --app ./target/debug/my-app
252
+ tauri-test-cli screenshot --app ./target/debug/my-app --output /tmp/screen.png
253
+ tauri-test-cli click "button#submit" --app ./target/debug/my-app
254
+ tauri-test-cli snapshot --app ./target/debug/my-app
255
255
  ```
256
256
 
257
257
  ## Using with Claude Code
@@ -261,24 +261,24 @@ This CLI is designed for AI agents. Add this to your project's CLAUDE.md:
261
261
  ```markdown
262
262
  ## Testing Tauri Apps
263
263
 
264
- Use `tauri-test` CLI for testing the Tauri application.
264
+ Use `tauri-test-cli` for testing the Tauri application.
265
265
 
266
266
  ### Start test server
267
- tauri-test server --app ./target/debug/my-app --xvfb &
267
+ tauri-test-cli server --app ./target/debug/my-app --xvfb &
268
268
 
269
269
  ### Available commands (once server is running, no --app needed)
270
- - Click: `tauri-test click "button"`
271
- - Type: `tauri-test type "input" "hello"`
272
- - Screenshot: `tauri-test screenshot --output /tmp/screen.png`
273
- - Snapshot: `tauri-test snapshot --output /tmp/dom.yaml`
274
- - Eval: `tauri-test eval "document.title"`
275
- - Wait: `tauri-test wait ".element" --timeout 5000`
270
+ - Click: `tauri-test-cli click "button"`
271
+ - Type: `tauri-test-cli type "input" "hello"`
272
+ - Screenshot: `tauri-test-cli screenshot --output /tmp/screen.png`
273
+ - Snapshot: `tauri-test-cli snapshot --output /tmp/dom.yaml`
274
+ - Eval: `tauri-test-cli eval "document.title"`
275
+ - Wait: `tauri-test-cli wait ".element" --timeout 5000`
276
276
 
277
277
  ### Check server status
278
- tauri-test status
278
+ tauri-test-cli status
279
279
 
280
280
  ### Stop server
281
- tauri-test stop
281
+ tauri-test-cli stop
282
282
  ```
283
283
 
284
284
  ## Development
@@ -334,7 +334,7 @@ pixi run test-app-build
334
334
  # Run the test app manually
335
335
  pixi run test-app-run
336
336
 
337
- # Start tauri-test server with test app
337
+ # Start tauri-test-cli server with test app
338
338
  pixi run test-server
339
339
  ```
340
340
 
@@ -414,21 +414,21 @@ Example output:
414
414
  ### "Maximum number of active sessions" Error
415
415
 
416
416
  ```bash
417
- tauri-test cleanup
417
+ tauri-test-cli cleanup
418
418
  ```
419
419
 
420
420
  ### Server won't start
421
421
 
422
422
  ```bash
423
- tauri-test stop
424
- tauri-test cleanup
423
+ tauri-test-cli stop
424
+ tauri-test-cli cleanup
425
425
  ```
426
426
 
427
427
  ### Missing dependencies
428
428
 
429
429
  ```bash
430
- tauri-test check-deps
431
- tauri-test setup # Install tauri-test
430
+ tauri-test-cli check-deps
431
+ tauri-test-cli setup # Install tauri-test
432
432
  ```
433
433
 
434
434
  ### Window focus issues (slow commands)
@@ -436,16 +436,16 @@ tauri-test setup # Install tauri-test
436
436
  Use the `--xvfb` flag to run in a virtual display:
437
437
 
438
438
  ```bash
439
- tauri-test server --app ./target/debug/my-app --xvfb &
439
+ tauri-test-cli server --app ./target/debug/my-app --xvfb &
440
440
  ```
441
441
 
442
442
  ## CLI Reference
443
443
 
444
444
  ```
445
- tauri-test - CLI for testing Tauri applications
445
+ tauri-test-cli - CLI for testing Tauri applications
446
446
 
447
447
  USAGE:
448
- tauri-test <command> [options]
448
+ tauri-test-cli <command> [options]
449
449
 
450
450
  When --app is omitted, commands connect to a running server (client mode).
451
451
 
@@ -461,7 +461,7 @@ COMMANDS:
461
461
  status [--port <port>] Check if a server is running
462
462
  stop [--port <port>] Stop a running server
463
463
  cleanup Kill stale WebDriver processes
464
- setup Install tauri-test via cargo
464
+ setup Install tauri-driver via cargo
465
465
  check-deps Check system dependencies
466
466
 
467
467
  OPTIONS:
package/dist/cli.js CHANGED
@@ -120740,7 +120740,7 @@ async function disconnect2() {
120740
120740
  }
120741
120741
  function requireBrowser() {
120742
120742
  if (!browser2) {
120743
- throw new Error("Not connected. Run 'tauri-test connect' first.");
120743
+ throw new Error("Not connected. Run 'tauri-test-cli connect' first.");
120744
120744
  }
120745
120745
  return browser2;
120746
120746
  }
@@ -122048,7 +122048,7 @@ async function sendToServer(port, cmd) {
122048
122048
  return await response.json();
122049
122049
  } catch (err) {
122050
122050
  if (err instanceof TypeError && (err.message.includes("fetch") || err.message.includes("ECONNREFUSED"))) {
122051
- throw new Error(`No server running on port ${port}. Start one with: tauri-test server --app <path> --port ${port}`);
122051
+ throw new Error(`No server running on port ${port}. Start one with: tauri-test-cli server --app <path> --port ${port}`);
122052
122052
  }
122053
122053
  throw err;
122054
122054
  }
@@ -122065,10 +122065,10 @@ async function isServerRunning(port) {
122065
122065
  }
122066
122066
  }
122067
122067
  var HELP = `
122068
- tauri-test - CLI for testing Tauri applications
122068
+ tauri-test-cli - CLI for testing Tauri applications
122069
122069
 
122070
122070
  USAGE:
122071
- tauri-test <command> --app <path-to-tauri-binary> [options]
122071
+ tauri-test-cli <command> --app <path-to-tauri-binary> [options]
122072
122072
 
122073
122073
  COMMANDS:
122074
122074
  server [--port <port>] [--xvfb]
@@ -122098,16 +122098,16 @@ COMMANDS:
122098
122098
  Execute multiple commands in a single session (reads JSON from stdin)
122099
122099
 
122100
122100
  stop [--port <port>]
122101
- Stop a running tauri-test server
122101
+ Stop a running tauri-test-cli server
122102
122102
 
122103
122103
  status [--port <port>]
122104
122104
  Check if a server is running
122105
122105
 
122106
122106
  cleanup
122107
- Kill stale WebDriver processes (tauri-test, WebKitWebDriver, Xvfb)
122107
+ Kill stale WebDriver processes (tauri-driver, WebKitWebDriver, Xvfb)
122108
122108
 
122109
122109
  setup
122110
- Install tauri-test via cargo
122110
+ Install tauri-driver via cargo
122111
122111
 
122112
122112
  check-deps
122113
122113
  Check if all required system dependencies are installed
@@ -122129,25 +122129,25 @@ CLIENT MODE (talk to running server):
122129
122129
  This is the simplest way to interact with your app!
122130
122130
 
122131
122131
  # 1. Start server once (in background)
122132
- tauri-test server --app /path/to/your/tauri-app &
122132
+ tauri-test-cli server --app /path/to/your/tauri-app &
122133
122133
 
122134
122134
  # 2. Run CLI commands - no --app needed!
122135
- tauri-test click "button.submit"
122136
- tauri-test type "input[name=email]" "user@example.com"
122137
- tauri-test screenshot --output /tmp/screen.png
122138
- tauri-test snapshot --output /tmp/dom.yaml
122139
- tauri-test eval "document.title"
122140
- tauri-test wait ".modal" --gone --timeout 5000
122135
+ tauri-test-cli click "button.submit"
122136
+ tauri-test-cli type "input[name=email]" "user@example.com"
122137
+ tauri-test-cli screenshot --output /tmp/screen.png
122138
+ tauri-test-cli snapshot --output /tmp/dom.yaml
122139
+ tauri-test-cli eval "document.title"
122140
+ tauri-test-cli wait ".modal" --gone --timeout 5000
122141
122141
 
122142
122142
  # Use --port to connect to a different server
122143
- tauri-test click "button" --port 8080
122143
+ tauri-test-cli click "button" --port 8080
122144
122144
 
122145
122145
  SERVER MODE (Recommended for Agents):
122146
122146
  Start a persistent HTTP server - no batching needed!
122147
122147
  Commands execute instantly (no auto-wait by default for speed).
122148
122148
 
122149
122149
  # 1. Start server (runs in foreground, use & for background)
122150
- tauri-test server --app /path/to/your/tauri-app --port 9222 &
122150
+ tauri-test-cli server --app /path/to/your/tauri-app --port 9222 &
122151
122151
 
122152
122152
  # 2. Send commands anytime via curl - executes instantly!
122153
122153
  curl -s http://127.0.0.1:9222 -d '{"cmd":"click","selector":"button"}'
@@ -122171,28 +122171,28 @@ AUTO-WAIT BEHAVIOR (batch mode only by default):
122171
122171
 
122172
122172
  EXAMPLES:
122173
122173
  # First-time setup
122174
- tauri-test setup # Install tauri-test via cargo
122175
- tauri-test check-deps # Verify all dependencies
122174
+ tauri-test-cli setup # Install tauri-driver via cargo
122175
+ tauri-test-cli check-deps # Verify all dependencies
122176
122176
 
122177
122177
  # Server mode (best for agents)
122178
- tauri-test server --app ./target/debug/my-tauri-app &
122178
+ tauri-test-cli server --app ./target/debug/my-tauri-app &
122179
122179
  curl -s http://127.0.0.1:9222 -d '{"cmd":"click","selector":"button"}'
122180
122180
  curl -s http://127.0.0.1:9222 -d '{"cmd":"screenshot","output":"/tmp/result.png"}'
122181
122181
 
122182
122182
  # Server in virtual display (Linux - avoids focus/throttling issues)
122183
- tauri-test server --app ./target/debug/my-tauri-app --xvfb &
122183
+ tauri-test-cli server --app ./target/debug/my-tauri-app --xvfb &
122184
122184
 
122185
122185
  # Stop server and cleanup
122186
- tauri-test stop # Stop server on default port
122187
- tauri-test stop --port 8080 # Stop server on custom port
122188
- tauri-test cleanup # Kill stale WebDriver processes
122186
+ tauri-test-cli stop # Stop server on default port
122187
+ tauri-test-cli stop --port 8080 # Stop server on custom port
122188
+ tauri-test-cli cleanup # Kill stale WebDriver processes
122189
122189
 
122190
122190
  # Batch mode (single invocation)
122191
- echo '[{"cmd":"click","selector":"button"},{"cmd":"screenshot","output":"/tmp/result.png"}]' | tauri-test batch --app ./target/debug/my-tauri-app --json
122191
+ echo '[{"cmd":"click","selector":"button"},{"cmd":"screenshot","output":"/tmp/result.png"}]' | tauri-test-cli batch --app ./target/debug/my-tauri-app --json
122192
122192
 
122193
122193
  # Single commands
122194
- tauri-test screenshot --app ./target/debug/my-tauri-app --output /tmp/screen.png
122195
- tauri-test click "button#submit" --app ./target/debug/my-tauri-app
122194
+ tauri-test-cli screenshot --app ./target/debug/my-tauri-app --output /tmp/screen.png
122195
+ tauri-test-cli click "button#submit" --app ./target/debug/my-tauri-app
122196
122196
  `;
122197
122197
  function parseArgs(argv) {
122198
122198
  const args = [];
@@ -122351,10 +122351,10 @@ async function main() {
122351
122351
  console.error(`Error: No server running on port ${port}.`);
122352
122352
  console.error("");
122353
122353
  console.error("Either start a server first:");
122354
- console.error(` tauri-test server --app ./target/debug/my-app --port ${port} &`);
122354
+ console.error(` tauri-test-cli server --app ./target/debug/my-app --port ${port} &`);
122355
122355
  console.error("");
122356
122356
  console.error("Or specify --app to run standalone:");
122357
- console.error(` tauri-test ${command} --app ./target/debug/my-app`);
122357
+ console.error(` tauri-test-cli ${command} --app ./target/debug/my-app`);
122358
122358
  process.exit(1);
122359
122359
  }
122360
122360
  let cmd;
@@ -122446,8 +122446,8 @@ async function main() {
122446
122446
  console.error("Error: --app <path> is required. Specify the path to your Tauri app binary.");
122447
122447
  console.error("");
122448
122448
  console.error("Example:");
122449
- console.error(" tauri-test server --app ./target/debug/my-app");
122450
- console.error(" tauri-test screenshot --app ./target/debug/my-app --output /tmp/screen.png");
122449
+ console.error(" tauri-test-cli server --app ./target/debug/my-app");
122450
+ console.error(" tauri-test-cli screenshot --app ./target/debug/my-app --output /tmp/screen.png");
122451
122451
  process.exit(1);
122452
122452
  }
122453
122453
  const waitTimeout = options.wait ? parseInt(options.wait) : 15000;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "tauri-test-cli",
3
- "version": "0.3.1",
3
+ "version": "0.4.1",
4
4
  "description": "CLI for testing Tauri applications with screenshot capture, DOM inspection, and user interaction simulation",
5
5
  "type": "module",
6
6
  "bin": {
7
- "tauri-test": "./dist/cli.js"
7
+ "tauri-test-cli": "./dist/cli.js"
8
8
  },
9
9
  "files": [
10
10
  "dist",
@@ -61,10 +61,10 @@ if (warnings.length > 0) {
61
61
  console.log();
62
62
  }
63
63
 
64
- console.log(`${dim}Run 'tauri-test --help' for usage information.${reset}`);
64
+ console.log(`${dim}Run 'tauri-test-cli --help' for usage information.${reset}`);
65
65
  } else {
66
66
  console.log(`${green}All dependencies found!${reset}`);
67
- console.log(`${dim}Run 'tauri-test --help' to get started.${reset}`);
67
+ console.log(`${dim}Run 'tauri-test-cli --help' to get started.${reset}`);
68
68
  }
69
69
 
70
70
  console.log();
@@ -49,7 +49,7 @@ describe("postinstall script", () => {
49
49
  });
50
50
 
51
51
  const output = result.stdout.toString();
52
- expect(output).toContain("tauri-test");
52
+ expect(output).toContain("tauri-test-cli");
53
53
  });
54
54
  });
55
55