- Home
- Skills
- Dchuk
- Claude Code Tauri Skills
- Tauri Testing
tauri-testing_skill
12
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill dchuk/claude-code-tauri-skills --skill tauri-testing- SKILL.md10.9 KB
Overview
This skill guides developers through testing Tauri v2 applications with practical patterns for unit, integration, and end-to-end testing. It covers using the Tauri mock runtime for frontend tests, WebDriver automation via tauri-driver with WebdriverIO or Selenium, and CI integration recipes for GitHub Actions. The goal is repeatable, fast tests that run locally and in CI.
How this skill works
The skill shows how to mock Tauri APIs using @tauri-apps/api/mocks and configure Vitest for frontend unit and integration tests without launching a native webview. For E2E, it explains installing tauri-driver, launching the WebDriver server, and driving the app with WebdriverIO or selenium-webdriver. It also provides CI workflows that build the app, start tauri-driver, and run tests on Ubuntu and Windows.
When to use it
- Write unit and integration tests for UI logic that calls Tauri IPC without launching native components
- Verify IPC commands, events, sidecar output, and multi-window behavior with mocked interfaces
- Run full end-to-end scenarios that interact with rendered DOM using tauri-driver + WebDriver
- Integrate E2E tests into GitHub Actions to catch regressions on push and PRs
- Troubleshoot platform-specific WebDriver issues during cross-platform QA
Best practices
- Import and configure @tauri-apps/api/mocks before code under test and call clearMocks() afterEach
- Use spies to assert invoke calls and mock events with shouldMockEvents for event-driven logic
- Mock windows for multi-window flows and simulate sidecar/shell callbacks explicitly
- Use debug builds for faster iteration and set explicit timeouts/waits for app initialization
- Build the app in CI before starting tauri-driver and use xvfb-run on Linux for headless WebDriver
Example use cases
- Unit test a command handler that invokes 'add' using mockIPC and Vitest spies
- Simulate a sidecar process producing stdout and termination events in a frontend test
- Run WebdriverIO specs that build the Rust side, start tauri-driver, and assert UI text and button flows
- Use a Selenium Mocha test to launch the app via tauri-driver, click a button, and verify output
- Create a GitHub Actions job that installs platform drivers, builds the app, and runs E2E tests on ubuntu-latest and windows-latest
FAQ
Mocks run in jsdom and are much faster, isolate frontend logic, and avoid native dependencies while testing IPC and events.
What causes WebDriver connection timeouts?
Common causes are missing platform drivers (Edge on Windows, WebKit on Linux), tauri-driver not running, or port 4444 blocked; verify drivers and tauri-driver logs.