Configuration
Complete guide to configuring @wdio/tauri-service in your WebdriverIO setup.
Service Configuration
Add the Tauri service to your wdio.conf.ts:
export const config = {
services: [
['@wdio/tauri-service', {
// Service options go here
autoInstallTauriDriver: true,
autoDownloadEdgeDriver: true,
captureBackendLogs: true,
captureFrontendLogs: true,
}]
],
// ... rest of config
};
Service Options
appBinaryPath (string, optional)
Path to the compiled Tauri application binary (executable).
Example:
appBinaryPath: './src-tauri/target/release/my-app.exe', // Windows
appBinaryPath: './src-tauri/target/release/my-app', // Linux
Default: Auto-detected from capabilities if not provided
Note: Path should be absolute or relative to the WebdriverIO config directory.
appArgs (string[], optional)
Command-line arguments to pass to the Tauri application when launching. Each array element is passed as a separate argument — no shell parsing is applied.
Example:
appArgs: ['--debug', '--log-level', 'debug']
// For key=value style arguments, use either form:
appArgs: ['--window-size', '1920,1080'] // Two separate elements
appArgs: ['--window-size=1920,1080'] // Single element with equals
Default: []
autoInstallTauriDriver (boolean, optional)
Automatically install tauri-driver if not found in PATH.
Requirements:
- Rust toolchain must be installed (
cargo) - First installation will take a few minutes
Example:
autoInstallTauriDriver: true
Default: false
Note: Disable if you have tauri-driver installed manually or globally.
autoDownloadEdgeDriver (boolean, optional)
Automatically download MSEdgeDriver on Windows if version mismatch detected.
Example:
autoDownloadEdgeDriver: true // Windows only
Default: true
Note: Windows only, ignored on Linux/macOS. See Edge WebDriver Windows.
tauriDriverPort (number, optional)
Port for tauri-driver to listen on. Each worker process gets a unique port (port + worker index).
Example:
tauriDriverPort: 4444
Default: 4444
Note: Increment for multiremote to avoid port conflicts.
tauriDriverPath (string, optional)
Path to the tauri-driver executable if not in PATH.
Example:
tauriDriverPath: '/usr/local/bin/tauri-driver' // Linux/macOS
tauriDriverPath: 'C:\\tools\\tauri-driver.exe' // Windows
Default: Use tauri-driver from PATH
logLevel ('trace' | 'debug' | 'info' | 'warn' | 'error', optional)
Log level for tauri-driver output.
Example:
logLevel: 'debug' // More verbose
Default: 'info'
windowLabel (string, optional)
The default window label to target for Tauri operations. This controls which webview window browser.tauri.execute() and other Tauri-specific operations target by default.
Example:
windowLabel: 'settings' // Target the settings window by default
Default: 'main'
Note:
- Each browser instance (including multiremote) can have its own default windowLabel
- Override at runtime with
browser.tauri.switchWindow(label) - Per-call override with
browser.tauri.execute(fn, withExecuteOptions({ windowLabel: 'x' }))is supported
commandTimeout (number, optional)
Timeout in milliseconds for individual command execution.
Example:
commandTimeout: 60000 // 60 seconds
Default: 30000 (30 seconds)
startTimeout (number, optional)
Timeout in milliseconds for the Tauri app to start and become ready.
Example:
startTimeout: 60000 // 60 seconds
Default: 30000 for the 'official' and 'crabnebula' providers, 60000 for the 'embedded' provider (the embedded WebDriver server takes longer to come up, especially on Windows CI).
captureBackendLogs (boolean, optional)
Capture logs from the Tauri backend (Rust code).
Example:
captureBackendLogs: true
Default: false
Note: When enabled, logs appear in WebdriverIO reports. See Log Forwarding.
captureFrontendLogs (boolean, optional)
Capture console logs from the frontend (JavaScript/TypeScript).
Example:
captureFrontendLogs: true
Default: false
Note: When enabled, console.log() calls appear in WebdriverIO reports. See Log Forwarding.
backendLogLevel ('trace' | 'debug' | 'info' | 'warn' | 'error', optional)
Minimum log level to capture from backend. Logs below this level are ignored.
Example:
backendLogLevel: 'debug' // Capture debug and above
Default: 'info'
Note: Only has effect if captureBackendLogs: true.
frontendLogLevel ('trace' | 'debug' | 'info' | 'warn' | 'error', optional)
Minimum log level to capture from frontend. Logs below this level are ignored.
Example:
frontendLogLevel: 'debug'
Default: 'info'
Note: Only has effect if captureFrontendLogs: true.
logDir (string, optional)
Directory to store logs from the Tauri service (for standalone mode).
Example:
logDir: './test-logs'
Default: Logs to stdout/stderr
statusPollTimeout (number, optional)
Timeout in milliseconds for the /status endpoint poll during embedded WebDriver server startup. Increase this in slow CI environments (e.g. containerised Windows runners) where a healthy-but-busy server may miss the default deadline and trigger a false-positive restart.
Example:
statusPollTimeout: 5000
Default: 2000
Note: Only applies when driverProvider: 'embedded'.
clearMocks (boolean, optional)
If true, all mock call history is cleared before each test. Equivalent to calling browser.tauri.clearAllMocks() in a beforeEach.
Example:
clearMocks: true
Default: false
clearMocksPrefix (string, optional)
If set, only mocks whose command name starts with this prefix are cleared. Only used when clearMocks: true.
Example:
clearMocks: true,
clearMocksPrefix: 'clipboard' // Only clears clipboard.* mocks
Default: undefined
resetMocks (boolean, optional)
If true, all mocks are reset (implementation + history) before each test. Equivalent to browser.tauri.resetAllMocks() in a beforeEach.
Example:
resetMocks: true
Default: false
resetMocksPrefix (string, optional)
If set, only mocks whose command name starts with this prefix are reset. Only used when resetMocks: true.
Default: undefined
restoreMocks (boolean, optional)
If true, all mocks are restored to their original implementations before each test. Equivalent to browser.tauri.restoreAllMocks() in a beforeEach.
Example:
restoreMocks: true
Default: false
restoreMocksPrefix (string, optional)
If set, only mocks whose command name starts with this prefix are restored. Only used when restoreMocks: true.
Default: undefined
driverProvider ('official' | 'crabnebula' | 'embedded', optional)
Select which driver provider to use for WebDriver communication.
'embedded': Use embedded WebDriver server via tauri-plugin-wdio-webdriver (no external driver needed, works on all platforms)'official': Use the cargo-installed tauri-driver (supports Windows/Linux)'crabnebula': Use @crabnebula/tauri-driver from npm (supports Windows/Linux/macOS; CN_API_KEY required for macOS only)
Auto-detection (no explicit config needed):
The service automatically selects 'embedded' when either of the following signals is present:
TAURI_WEBDRIVER_PORTenvironment variable is set (you've configured the plugin's port)- Running on macOS (WKWebView requires the embedded approach)
If neither signal is present on Windows or Linux, the service throws an immediate error with instructions.
Example:
// Auto-detected on macOS, or when TAURI_WEBDRIVER_PORT is set — no config needed
// driverProvider: 'embedded' (set this explicitly to be unambiguous)
// Use CrabNebula — all platforms; CN_API_KEY required for macOS
driverProvider: 'crabnebula'
// Use official tauri-driver — opt out of embedded provider
driverProvider: 'official'
Default: Auto-detected (see above). Set explicitly to override.
Note: Install tauri-plugin-wdio-webdriver in your Tauri app to use the embedded provider. See Plugin Setup for details.