Skip to content

Commit a768c03

Browse files
committed
Add CrabNebula E2E tests
1 parent c85c8c2 commit a768c03

12 files changed

Lines changed: 678 additions & 21 deletions

File tree

Cargo.lock

Lines changed: 27 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/desktop/.env.example

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# CrabNebula API key for macOS E2E testing via their WebDriver bridge.
2+
# Get your key from CrabNebula (https://crabnebula.dev/).
3+
# Copy this file to .env and fill in your key, or export it in your shell.
4+
CN_API_KEY=

apps/desktop/eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default tseslint.config(
3333
'_ignored',
3434
// E2E tests use different frameworks (WebDriverIO, Playwright) with their own typing
3535
'test/e2e-linux',
36+
'test/e2e-macos',
3637
'test/e2e-smoke',
3738
],
3839
},

apps/desktop/knip.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
"@wdio/mocha-framework",
1818
"@wdio/spec-reporter",
1919
"@wdio/types",
20-
"webdriverio"
20+
"webdriverio",
21+
"@crabnebula/tauri-driver",
22+
"@crabnebula/test-runner-backend"
2123
],
2224
"ignoreExportsUsedInFile": true,
2325
"project": ["src/**/*.{ts,svelte}"],

apps/desktop/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
"test:e2e:linux:build": "docker build -t cmdr-e2e -f test/e2e-linux/docker/Dockerfile test/e2e-linux/docker",
2727
"test:e2e:linux:shell": "./scripts/e2e-linux.sh --shell",
2828
"test:e2e:linux:vnc": "./scripts/e2e-linux.sh --vnc",
29+
"test:e2e:macos": "wdio run test/e2e-macos/wdio.conf.ts",
30+
"test:e2e:macos:build": "node scripts/tauri-wrapper.js build --debug --no-bundle --target $(rustc -vV | grep host | cut -d' ' -f2) -- --features automation",
2931
"knip": "knip",
3032
"check:type-drift": "tsx scripts/check-type-drift.ts"
3133
},
@@ -46,6 +48,8 @@
4648
"@tauri-apps/plugin-window-state": "~2.4.1"
4749
},
4850
"devDependencies": {
51+
"@crabnebula/tauri-driver": "^2.0.9",
52+
"@crabnebula/test-runner-backend": "^0.2.5",
4953
"@eslint/js": "^9.39.2",
5054
"@playwright/test": "^1.57.0",
5155
"@sveltejs/adapter-static": "^3.0.10",

apps/desktop/src-tauri/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ license = "LicenseRef-BSL-1.1"
88
default-run = "Cmdr"
99
publish = false # Private application, not for crates.io
1010

11+
[features]
12+
# CrabNebula automation plugin for macOS E2E testing. Never enable in production builds.
13+
automation = ["dep:tauri-plugin-automation"]
14+
1115
[[bin]]
1216
name = "Cmdr"
1317
path = "src/main.rs"
@@ -106,6 +110,9 @@ bytes = "1"
106110
# Drive indexing: macOS FSEvents watcher with event IDs and sinceWhen replay
107111
cmdr-fsevent-stream = { git = "https://github.com/vdavid/cmdr-fsevent-stream", rev = "3a02f0d" }
108112

113+
# CrabNebula automation plugin for macOS E2E testing (optional, feature-gated)
114+
tauri-plugin-automation = { version = "0.1", optional = true }
115+
109116
[dev-dependencies]
110117
criterion = { version = "0.8.1", features = ["html_reports"] }
111118
# For test-only cryptographic key generation (compatible with ed25519-dalek's rand_core 0.6)

apps/desktop/src-tauri/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ pub fn run() {
107107
#[cfg(debug_assertions)]
108108
let builder = builder.plugin(tauri_plugin_mcp_bridge::init());
109109

110+
// CrabNebula automation plugin for macOS E2E testing (feature-gated, never in release builds)
111+
#[cfg(feature = "automation")]
112+
let builder = builder.plugin(tauri_plugin_automation::init());
113+
110114
// Skip updater plugin in CI to avoid network dependency and latency during E2E tests
111115
let builder = if std::env::var("CI").is_ok() {
112116
builder

0 commit comments

Comments
 (0)