Files
OwnCord/Client/tauri-client/playwright.config.native.ts
T
jevb 5c616d53fe test: fix 10 test quality bugs (BUG-058–067) and resolve 115 TS type errors
BUG-058: Unblock prod-build E2E — created tsconfig.build.json excluding
tests from the production build. Added typecheck/typecheck:build scripts.

BUG-059: Harden native E2E — CDP timeout 30→60s with exponential backoff,
config timeouts doubled (test 120s, action 30s, nav 45s, expect 15s).

BUG-060: Add 25 Rust unit tests across commands.rs, ws_proxy.rs,
livekit_proxy.rs, credentials.rs (was zero behavioral tests).

BUG-061/067: Add behavioral assertions to server coverage_boost_test.go —
GracefulStop verifies client count, channel_focus verifies no error sent.

BUG-062: Upgrade low-signal test assertions in livekit-session,
device-manager, channel-controller (no-op checks → state checks).

BUG-063: Consolidate native E2E skip gates into beforeEach blocks
(voice-controls 7→1 skip, channel-navigation 4→1 skip).

BUG-064: Add 9 integration tests for channel CRUD, member lifecycle,
DM open/close, and presence events.

BUG-065: Replace 3 fixed sleeps with condition-based waits in E2E specs.

BUG-066: Verified toast/audio tests already cleaned in prior session.

TypeScript: Fix 115 type errors across 21 test files — add non-null
assertions for strict indexing, fix mock typing (vi.fn<any>()), add
missing fields (color, version, deleted) to test fixtures.
2026-03-30 16:35:02 +02:00

71 lines
2.0 KiB
TypeScript

import { defineConfig } from "@playwright/test";
/**
* Playwright config for testing against the REAL Tauri production app.
*
* Connects to the WebView2 window via Chrome DevTools Protocol (CDP).
*
* Two projects:
*
* 1. `native-no-auth` — Tests that do NOT need login (smoke tests,
* connect page UI, auth flow verification). Each test gets a fresh
* Tauri exe via the original per-test fixture.
*
* 2. `native-authenticated` — Tests that need a logged-in session
* (channel nav, chat ops, settings, voice, overlays, app layout).
* Uses the persistent fixture: one Tauri exe for the entire project,
* login happens once, all tests reuse the same page.
*
* This design eliminates server rate limiting (5 logins/min, 10-failure
* lockout) that previously caused test failures when 8+ spec files each
* launched a fresh exe and logged in.
*
* Requirements:
* - Built Tauri exe: npm run tauri build
* - Running server: Server/chatserver.exe (or set OWNCORD_SERVER_URL)
*
* Usage: npm run test:e2e:native
*/
export default defineConfig({
timeout: 120_000,
expect: {
timeout: 15_000,
},
// Native tests run sequentially — one app instance at a time
fullyParallel: false,
workers: 1,
retries: 2,
reporter: process.env.CI
? [["html", { open: "never" }], ["junit", { outputFile: "test-results/native-junit.xml" }]]
: "html",
use: {
actionTimeout: 30_000,
navigationTimeout: 45_000,
screenshot: "only-on-failure",
trace: "on-first-retry",
video: "on-first-retry",
},
projects: [
{
name: "native-no-auth",
testDir: "./tests/e2e/native",
testMatch: ["smoke.spec.ts", "auth-flow.spec.ts"],
},
{
name: "native-authenticated",
testDir: "./tests/e2e/native",
testMatch: [
"app-layout.spec.ts",
"channel-navigation.spec.ts",
"chat-operations.spec.ts",
"settings-overlay.spec.ts",
"voice-controls.spec.ts",
"overlays.spec.ts",
],
dependencies: ["native-no-auth"],
},
],
});