forked from ethereum/ethereum-org-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
61 lines (54 loc) · 1.42 KB
/
playwright.config.ts
File metadata and controls
61 lines (54 loc) · 1.42 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 path from "path"
import dotenv from "dotenv"
import type { ChromaticConfig } from "@chromatic-com/playwright"
import { defineConfig, devices } from "@playwright/test"
dotenv.config({ path: path.resolve(__dirname, ".env.local") })
export default defineConfig<ChromaticConfig>({
testDir: "./tests/e2e",
outputDir: "./tests/e2e/__results__",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : 3,
reporter: [
["html", { outputFolder: "./tests/e2e/__report__", open: "never" }],
["line"],
process.env.CI ? ["github"] : ["list"],
],
use: {
baseURL: process.env.PLAYWRIGHT_TEST_BASE_URL || "http://localhost:3000",
trace: "on-first-retry",
screenshot: "only-on-failure",
// Global test timeout
actionTimeout: 10000,
navigationTimeout: 30000,
// Chromatic settings
disableAutoSnapshot: true,
},
// Global test timeout
timeout: 30000,
// Expect timeout
expect: {
timeout: 10000,
},
projects: [
/* Test against desktop browsers */
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
{
name: "webkit",
use: { ...devices["Desktop Safari"] },
},
/* Test against mobile viewports. */
{
name: "Mobile Chrome",
use: { ...devices["Pixel 5"] },
},
{
name: "Mobile Safari",
use: { ...devices["iPhone 12"] },
},
],
})