mirror of
https://github.com/J3vb/OwnCord.git
synced 2026-09-03 03:50:00 +03:00
- 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
42 lines
1.3 KiB
TypeScript
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.
|
|
});
|