-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
48 lines (46 loc) · 1.34 KB
/
Copy pathplaywright.config.ts
File metadata and controls
48 lines (46 loc) · 1.34 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
42
43
44
45
46
47
48
import { defineConfig, devices } from "playwright/test";
const appPort = Number(process.env.PLAYWRIGHT_APP_PORT ?? 3001);
const cdnPort = Number(process.env.PLAYWRIGHT_CDN_PORT ?? 3010);
const host = process.env.PLAYWRIGHT_HOST ?? "127.0.0.1";
const isCI = !!process.env.CI;
const headless = true;
const appCommand = isCI
? `pnpm exec next start --port ${appPort} --hostname ${host}`
: `pnpm exec next dev --turbopack --port ${appPort} --hostname ${host}`;
export default defineConfig({
testDir: "./tests/e2e/specs",
timeout: 60_000,
expect: {
timeout: 10_000,
},
fullyParallel: false,
workers: 1,
reporter: [["list"], ["html", { open: "never" }]],
use: {
baseURL: `http://${host}:${appPort}`,
trace: "retain-on-failure",
screenshot: "only-on-failure",
video: "retain-on-failure",
headless,
},
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
webServer: [
{
command: appCommand,
url: `http://${host}:${appPort}`,
reuseExistingServer: !isCI,
timeout: 120_000,
},
{
command: `node scripts/static-server.mjs public/packages --port ${cdnPort} --host ${host}`,
url: `http://${host}:${cdnPort}/onlyoffice/9.4.0-develop/web-apps/apps/api/documents/api.js`,
reuseExistingServer: !isCI,
timeout: 120_000,
},
],
});