-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
41 lines (39 loc) · 1.21 KB
/
playwright.config.ts
File metadata and controls
41 lines (39 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { defineConfig, devices } from "@playwright/test";
const isCI = !!process.env.CI;
export default defineConfig({
testDir: "./tests",
timeout: 30_000,
retries: isCI ? 2 : 0,
use: {
baseURL: isCI ? "http://localhost:3000" : "http://localhost:3000",
},
webServer: {
// In CI: serve the pre-built dist/ folder. Locally: use the dev server.
command: isCI
? "bun -e \"Bun.serve({ port: 3000, static: { '/': new Response(Bun.file('dist/index.html'), { headers: { 'content-type': 'text/html' } }) }, fetch(req) { const path = new URL(req.url).pathname; const file = Bun.file('dist' + path); return new Response(file); } })\""
: "bun run dev",
port: 3000,
reuseExistingServer: !isCI,
timeout: 15_000,
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
{
name: "firefox",
use: {
...devices["Desktop Firefox"],
launchOptions: {
firefoxUserPrefs: {
// Force-enable WebGL even in headless mode (software fallback)
"webgl.force-enabled": true,
"webgl.disabled": false,
"layers.acceleration.force-enabled": true,
},
},
},
},
],
});