Skip to content

Latest commit

 

History

History
156 lines (104 loc) · 3.92 KB

File metadata and controls

156 lines (104 loc) · 3.92 KB

Development

Guide for developing and contributing to @wdio/tauri-service.

Prerequisites

See the Monorepo Setup Guide for Node.js, pnpm, and Git setup.

Tauri-specific requirement — Rust Toolchain:

rustc --version
cargo --version

Install via rustup if not present.

Setup

Follow the Monorepo Setup Guide to clone the repo and install dependencies, then build the Tauri service:

pnpm --filter @wdio/tauri-service build

Watch Mode

pnpm --filter @wdio/tauri-service dev

Testing

# Run all tests
pnpm --filter @wdio/tauri-service test

# Watch mode
pnpm --filter @wdio/tauri-service test:watch

# With coverage
pnpm --filter @wdio/tauri-service test:coverage

Aim for 80%+ coverage. Mock external dependencies where needed.

Code Quality

See the Monorepo Setup Guide for formatting and linting commands.

Key Features

Windows Edge WebDriver Management

Located in src/edgeDriverManager.ts:

  • Detects the WebView2 version from the Tauri binary
  • Auto-downloads a matching MSEdgeDriver from the Microsoft CDN
  • Handles version mismatches

Plugin Communication

tauri-plugin-wdio provides:

  • Script execution via window.eval()
  • Command mocking via invoke interception
  • Log forwarding via event listeners

Cross-Platform Support

Platform Driver Status
Windows MSEdgeDriver (auto-managed) Supported
Linux WebKitWebDriver (manual install) Supported
macOS Not supported (WKWebView limitation)

Common Tasks

Add a New Service Option

  1. Add to TauriServiceOptions in src/types.ts
  2. Add a default value in the service class
  3. Add validation if needed
  4. Write tests

Add a New API Function

  1. Implement in src/
  2. Export from src/index.ts
  3. Add TypeScript types
  4. Write tests

Fix a Platform-Specific Issue

  1. Identify affected platforms (windows, linux, darwin)
  2. Add platform detection if needed
  3. Implement the fix
  4. Test on affected platforms or add platform-specific unit tests

Debugging

Enable Debug Logging

DEBUG=wdio-tauri-service:* npx wdio run wdio.conf.ts

Debug Tests

# Run tests with Node inspector
node --inspect-brk node_modules/vitest/vitest.mjs run

# Then open chrome://inspect in Chrome

Debug in VS Code

Add to .vscode/launch.json:

{
  "type": "node",
  "request": "launch",
  "name": "Vitest Debug",
  "program": "${workspaceFolder}/node_modules/vitest/vitest.mjs",
  "args": ["run"],
  "console": "integratedTerminal",
  "internalConsoleOptions": "neverOpen"
}

Dependency Management

Dependencies are managed via the monorepo's catalog system. See Dependency Management for details.

Release

Releases are managed by maintainers via GitHub Actions. See CONTRIBUTING.md for the release process.

Contributing

See CONTRIBUTING.md for contribution guidelines, commit message format, and PR process.

Resources