2026-03-18 17:10:16 +01:00
|
|
|
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).
|
2026-03-28 10:39:23 +01:00
|
|
|
*
|
|
|
|
|
* 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.
|
2026-03-18 17:10:16 +01:00
|
|
|
*
|
|
|
|
|
* 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({
|
2026-03-30 16:35:02 +02:00
|
|
|
timeout: 120_000,
|
2026-03-18 17:10:16 +01:00
|
|
|
expect: {
|
2026-03-30 16:35:02 +02:00
|
|
|
timeout: 15_000,
|
2026-03-18 17:10:16 +01:00
|
|
|
},
|
2026-03-28 10:39:23 +01:00
|
|
|
// Native tests run sequentially — one app instance at a time
|
2026-03-18 17:10:16 +01:00
|
|
|
fullyParallel: false,
|
|
|
|
|
workers: 1,
|
|
|
|
|
retries: 2,
|
|
|
|
|
reporter: process.env.CI
|
2026-08-28 06:54:32 +02:00
|
|
|
? [
|
|
|
|
|
["html", { open: "never" }],
|
|
|
|
|
["junit", { outputFile: "test-results/native-junit.xml" }],
|
|
|
|
|
]
|
2026-03-18 17:10:16 +01:00
|
|
|
: "html",
|
|
|
|
|
|
|
|
|
|
use: {
|
2026-03-30 16:35:02 +02:00
|
|
|
actionTimeout: 30_000,
|
|
|
|
|
navigationTimeout: 45_000,
|
2026-03-18 17:10:16 +01:00
|
|
|
screenshot: "only-on-failure",
|
|
|
|
|
trace: "on-first-retry",
|
|
|
|
|
video: "on-first-retry",
|
|
|
|
|
},
|
|
|
|
|
|
2026-03-28 10:39:23 +01:00
|
|
|
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",
|
2026-08-07 21:20:48 +02:00
|
|
|
"dm-system.spec.ts",
|
|
|
|
|
"reconnection.spec.ts",
|
2026-03-28 10:39:23 +01:00
|
|
|
"settings-overlay.spec.ts",
|
2026-08-07 21:20:48 +02:00
|
|
|
"theme-persistence.spec.ts",
|
2026-03-28 10:39:23 +01:00
|
|
|
"voice-controls.spec.ts",
|
|
|
|
|
"overlays.spec.ts",
|
|
|
|
|
],
|
|
|
|
|
dependencies: ["native-no-auth"],
|
|
|
|
|
},
|
|
|
|
|
],
|
2026-03-18 17:10:16 +01:00
|
|
|
});
|