forked from akai/readest
13588b4a65
Set up WebDriver-based testing for the Tauri app with two tiers: - Vitest browser-mode tests (*.tauri.test.ts) running inside the Tauri WebView for plugin IPC testing (libsql, smoke tests) - WDIO E2E tests (*.e2e.ts) for UI-level interaction testing Key changes: - Add webdriver Cargo feature gating tauri-plugin-webdriver - Add runtime capability for remote URLs (webdriver builds only) - Add vitest.tauri.config.mts and wdio.conf.ts connecting to embedded WebDriver server on port 4445 - Add shared tauri-invoke helper for IPC from Vitest iframe context - Add testing documentation in docs/testing.md
26 lines
622 B
TypeScript
26 lines
622 B
TypeScript
import { defineConfig } from 'vitest/config';
|
|
import { webdriverio } from '@vitest/browser-webdriverio';
|
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
|
|
|
export default defineConfig({
|
|
plugins: [tsconfigPaths()],
|
|
resolve: {
|
|
conditions: ['development'],
|
|
},
|
|
test: {
|
|
include: ['src/**/*.tauri.test.ts'],
|
|
testTimeout: 30000,
|
|
browser: {
|
|
enabled: true,
|
|
provider: webdriverio({
|
|
hostname: '127.0.0.1',
|
|
port: 4445,
|
|
capabilities: {
|
|
browserName: 'chrome',
|
|
} as WebdriverIO.Capabilities,
|
|
}),
|
|
instances: [{ browser: 'chrome' }],
|
|
},
|
|
},
|
|
});
|