-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathplaywright.common.config.ts
44 lines (42 loc) · 1.34 KB
/
playwright.common.config.ts
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
import { defineConfig, devices, type PlaywrightTestConfig } from "@playwright/test";
/**
* See https://playwright.dev/docs/test-configuration.
*/
const commonConfig: PlaywrightTestConfig = defineConfig({
// Fail the build on CI if you accidentally left test.only in the source code
forbidOnly: !!process.env.CI,
// Retry on CI only
retries: process.env.CI ? 2 : 0,
// Use all available cores on GitHub Actions. Default is 50%, use that locally.
workers: process.env.CI ? "100%" : undefined,
// Increase the test timeout on CI, which is usually slower
timeout: process.env.CI ? 30_000 : 10_000,
fullyParallel: true,
globalSetup: "./e2e-tests/setup.ts",
use: {
// Local runs don't have retries, so we have a trace of each failure. On CI we do have retries, so keeping the trace of the first failure allows us to investigate flaky tests.
trace: "retain-on-first-failure",
testIdAttribute: "id",
},
projects: [
{
name: "chrome",
use: {
contextOptions: {
permissions: ["clipboard-read", "clipboard-write"],
},
...devices["Desktop Chrome"],
channel: "chromium",
},
},
{
name: "firefox",
use: { ...devices["Desktop Firefox"] },
},
{
name: "safari",
use: { ...devices["Desktop Safari"] },
},
],
});
export default commonConfig;