Quick Start
Get up and running with WebdriverIO and Tauri E2E testing in minutes.
Prerequisites
Required Software
-
Node.js 18+ - Download from nodejs.org
-
Rust Toolchain - Required for building Tauri apps and tauri-driver
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -
Tauri CLI - Install globally or as dev dependency
npm install -g @tauri-apps/cli
# or
cargo install tauri-cli
Platform-Specific Requirements
Windows
- Microsoft Visual C++ Build Tools - Download from Microsoft Visual C++
- Edge WebDriver - Auto-managed by the service (see Edge WebDriver Windows)
Linux
- WebKitGTK Development Libraries - Install WebKitWebDriver
# Debian/Ubuntu
sudo apt-get install -y webkit2gtk-driver
# Fedora 40+
sudo dnf install -y webkit2gtk-driver
# Arch Linux
sudo pacman -S webkit2gtk-4.1
# Void Linux
sudo xbps-install -y webkit2gtk-devel
See Platform Support for detailed distribution support information.
macOS
✅ Supported - Use the embedded WebDriver provider (driverProvider: 'embedded') for native macOS testing without external dependencies. See Platform Support for details.
Setting Up a Tauri App
Fastest Way: Use Tauri CLI
npm create tauri-app@latest
Follow the prompts and select your preferred frontend framework.
Manual Setup
Create a minimal Tauri app:
mkdir my-tauri-app
cd my-tauri-app
# Create frontend (use any framework or plain HTML)
mkdir src
echo '<h1>Hello, Tauri!</h1>' > src/index.html
# Create Rust backend
cargo init --name my_app src-tauri
cd src-tauri
# Add Tauri to Cargo.toml
# [dependencies]
# tauri = { version = "2.9", features = ["shell-open"] }
# tauri-build = "2.0"
Essential Files
Create the minimal required files for a Tauri app:
src-tauri/src/main.rs
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
fn main() {
tauri::Builder::default()
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
src-tauri/tauri.conf.json
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "my-app",
"version": "0.1.0",
"identifier": "com.mycompany.myapp",
"build": {
"frontendDist": "../src",
"beforeDevCommand": "echo 'dev server running'",
"beforeBuildCommand": "echo 'building frontend'"
},
"app": {
"withGlobalTauri": true,
"windows": [
{
"title": "My App",
"width": 800,
"height": 600
}
]
}
}
src-tauri/Cargo.toml - Add:
[dependencies]
tauri = { version = "2", features = [] }
tauri-plugin-wdio = "1"
[build-dependencies]
tauri-build = "2"
src-tauri/build.rs
fn main() {
tauri_build::build()
}
Tauri Plugin Setup
⚠️ The tauri-plugin-wdio is required for testing - Skip this section only if you want basic WebDriver operations without mocking or log capture.
Complete Plugin Setup
-
Already added to Cargo.toml (see above)
-
Register in
src-tauri/src/main.rs
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_wdio::init()) // Add this line
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
- Create
src-tauri/capabilities/default.json
{
"identifier": "default",
"windows": ["main"],
"permissions": [
"core:default",
"core:window:default",
"wdio:default"
]
}
- Import frontend plugin in
src/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>My App</title>
</head>
<body>
<h1>Hello, Tauri!</h1>
<!-- Import WebdriverIO Tauri plugin (required for testing) -->
<script type="module">
import '@wdio/tauri-plugin';
</script>
</body>
</html>
For detailed plugin setup and troubleshooting, see Plugin Setup.
Building the Tauri App
# Build for release (required for testing with WebdriverIO)
cd src-tauri
cargo build --release
On macOS/Linux, you'll also need to give the app executable permissions:
chmod +x target/release/my_app # Linux/macOS
# or on Windows:
# target\release\my_app.exe