Files
OwnCord/Client/tauri-client/playwright.config.native.ts
T
jevb 750a7af052 feat: native file downloads, upload size fix, native E2E tests
- Add file download with native save dialog (Tauri dialog + fs plugins)
- Make attachment filename clickable as additional download trigger
- Add download button with hover styling to file attachments
- Exempt /api/v1/uploads from global 1MB body size limit (MaxBodySizeUnless)
- Add native E2E test suite (8 specs) with Playwright CDP fixture
2026-03-18 17:10:16 +01:00

42 lines
1.3 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).
* The custom fixture in tests/e2e/native-fixture.ts launches the Tauri
* exe with WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=--remote-debugging-port
* and connects Playwright to it via chromium.connectOverCDP().
*
* 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({
testDir: "./tests/e2e/native",
timeout: 60_000,
expect: {
timeout: 10_000,
},
// Native tests are slower (real app startup) — run sequentially
fullyParallel: false,
workers: 1,
retries: 2,
reporter: process.env.CI
? [["html", { open: "never" }], ["junit", { outputFile: "test-results/native-junit.xml" }]]
: "html",
use: {
actionTimeout: 15_000,
navigationTimeout: 30_000,
screenshot: "only-on-failure",
trace: "on-first-retry",
video: "on-first-retry",
},
// No webServer — we launch the Tauri app ourselves in the fixture.
// No projects — we connect directly to WebView2 via CDP, not via browser launch.
});