CrabNebula Setup
This guide walks you through setting up CrabNebula's tauri-driver for cross-platform Tauri testing.
Overview
CrabNebula's @crabnebula/tauri-driver is a fork of the official tauri-driver that works on Windows, Linux, and macOS. It provides a cross-platform alternative to the official driver, with the added benefit of macOS support.
Platform Support
| Platform | Supported | Requirements |
|---|---|---|
| Windows | ✅ Yes | @crabnebula/tauri-driver |
| Linux | ✅ Yes | @crabnebula/tauri-driver + webkit2gtk-driver |
| macOS | ✅ Yes | @crabnebula/tauri-driver + CN_API_KEY |
Key Points
- CN_API_KEY is only required for macOS — Windows and Linux work without an API key
- tauri-plugin-automation is only needed for macOS — not required on Windows or Linux
- webkit2gtk-driver is required for Linux — same as the official driver
When to Use CrabNebula
Choose CrabNebula when:
- You want a single driver configuration across all platforms (Windows, Linux, macOS)
- You already have a CrabNebula subscription
- You need macOS testing but cannot use the embedded provider (
tauri-plugin-wdio-webdriver)
For most users, the embedded provider (via tauri-plugin-wdio-webdriver) is the recommended choice for macOS testing — it's free, native, and requires no external services.
Prerequisites
All Platforms
- Node.js 18+ and Rust toolchain installed
- A Tauri v2 application
Linux Only
- webkit2gtk-driver installed (see Linux Installation)
macOS Only
- CrabNebula account with API key (contact CrabNebula for access)
- tauri-plugin-automation installed in your Tauri app
Installation
Step 1: Install CrabNebula Packages
Install the npm packages as dev dependencies:
# All platforms
npm install -D @crabnebula/tauri-driver
# macOS only (for local testing)
npm install -D @crabnebula/test-runner-backend
Or with pnpm:
pnpm add -D @crabnebula/tauri-driver
# macOS only:
pnpm add -D @crabnebula/test-runner-backend
Step 2: Linux Installation
On Linux, you need WebKitWebDriver (same as the official driver):
# Debian/Ubuntu
sudo apt-get update
sudo apt-get install -y webkit2gtk-driver
# Fedora
sudo dnf install -y webkit2gtk-driver
# Arch Linux
sudo pacman -S webkit2gtk-4.1
Verify installation:
which WebKitWebDriver
# Should output: /usr/bin/WebKitWebDriver
Step 3: macOS Setup (Optional)
For macOS testing, you need the automation plugin and API key:
Add Automation Plugin
-
Navigate to your Tauri source directory:
cd src-tauri -
Add the plugin:
cargo add tauri-plugin-automation -
Register the plugin in your Rust code. Important: Only include this in debug builds:
// src-tauri/src/lib.rs or main.rs
let mut builder = tauri::Builder::default();
// Only enable automation in debug builds
#[cfg(debug_assertions)]
{
builder = builder.plugin(tauri_plugin_automation::init());
}
builder
.run(tauri::generate_context!())
.expect("error while running tauri application");⚠️ Warning: Never include the automation plugin in release builds, as it could allow external control of your application.
Set API Key
Set your CrabNebula API key as an environment variable:
export CN_API_KEY="your-api-key-here"
For CI/CD, add this as a secret:
GitHub Actions:
env:
CN_API_KEY: ${{ secrets.CN_API_KEY }}
Step 4: Configure WebdriverIO
Update your wdio.conf.ts to use CrabNebula:
export const config = {
services: [
['@wdio/tauri-service', {
driverProvider: 'crabnebula',
// macOS only - auto-manage the test-runner-backend (default: true)
crabnebulaManageBackend: true,
// macOS only - backend port (default: 3000)
crabnebulaBackendPort: 3000,
}]
],
capabilities: [{
browserName: 'tauri',
'tauri:options': {
// Path to your binary
application: './src-tauri/target/release/your-app-name',
}
}],
// ... rest of your config
};
Step 5: Build and Run
Build your Tauri app:
# Debug build (required for macOS automation plugin)
npm run tauri build -- --debug
# Or with cargo directly
cd src-tauri && cargo build
Run your tests:
npm run wdio
Platform-Specific Notes
Windows
- No additional setup required beyond installing
@crabnebula/tauri-driver - Edge WebDriver is auto-managed by the service
Linux
- Requires
webkit2gtk-driver(see installation above) - For headless CI, use Xvfb:
xvfb-run -a npm run wdio
macOS
- Requires
CN_API_KEYenvironment variable - Requires
tauri-plugin-automationin debug builds - Requires
@crabnebula/test-runner-backendfor local testing - The service auto-starts/stops the test-runner-backend