-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
61 lines (51 loc) · 1.28 KB
/
playwright.config.ts
File metadata and controls
61 lines (51 loc) · 1.28 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
49
50
51
52
53
54
55
56
57
58
59
60
61
import type { PlaywrightTestConfig } from "@playwright/test";
import { devices } from "@playwright/test";
import dotenv from "dotenv";
dotenv.config(); // Load variables from .env before using them
const config: PlaywrightTestConfig = {
/**
* Global setup & teardown of test data
*/
globalSetup: require.resolve("./global-setup"),
globalTeardown: require.resolve("./global-teardown"),
testDir: "./e2e/tests",
timeout: 30 * 10000,
expect: {
timeout: 5000,
},
// Fail build on test.only in CI
forbidOnly: !!process.env.CI,
// Retry on CI only
retries: process.env.CI ? 1 : 0,
// Run serially on CI
workers: process.env.CI ? 1 : undefined,
reporter: [["html", { open: "never" }]],
use: {
storageState: "storageState.json",
actionTimeout: 0,
screenshot: "only-on-failure",
video: "retain-on-failure",
viewport: { width: 1920, height: 720 },
trace: "retain-on-failure",
baseURL: process.env.ENV_URL || "http://localhost:3000",
},
projects: [
{
name: "Chromium",
use: {
browserName: "chromium",
},
},
{
name: "Safari",
use: { ...devices["Desktop Safari"] },
},
{
name: "Firefox",
use: {
browserName: "firefox",
},
},
],
};
export default config;