mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 18:48:44 +00:00
Add a Playwright UI integration test framework for the frame-accurate video player. Tests run against a backend-free harness served by Bun's native HTML bundler (matching the project's Bun-based dev/prod serving), so no database, auth or transcode pipeline is required. - Add @playwright/test with chromium/firefox/webkit projects; the browser is selectable via the Playwright --project flag (webkit = Safari engine). - Serve the harness with Bun.serve + bun-plugin-tailwind (no separate Vite toolchain); commit a deterministic 16x16/5s/30fps fixture video and matching AssetInfo. - Add a play/pause spec covering both the play control and clicking the video area, asserting the native video clock, seekbar fill and frame readout stay frame-locked after pause (settle-aware, tolerance-based assertions). - Mock all backend API calls (anchored /api/ and /files/ routes) for isolation. - Exclude e2e specs from Vitest; add a separate CI job (webkit on macOS).
20 lines
556 B
TypeScript
20 lines
556 B
TypeScript
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
import { configDefaults, defineConfig } from 'vitest/config'
|
|
|
|
export default defineConfig({
|
|
plugins: [tsconfigPaths()],
|
|
test: {
|
|
globalSetup: './packages/db/src/test-global-setup.ts',
|
|
globals: false,
|
|
pool: 'forks',
|
|
// Playwright e2e specs live under packages/webui/e2e and are run by the
|
|
// Playwright runner (bun run test:e2e), not Vitest.
|
|
exclude: [...configDefaults.exclude, 'packages/webui/e2e/**'],
|
|
server: {
|
|
deps: {
|
|
inline: ['zod'],
|
|
},
|
|
},
|
|
},
|
|
})
|