-
Notifications
You must be signed in to change notification settings - Fork 6
/
playwright.common.config.ts
43 lines (41 loc) · 1.17 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
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,
timeout: 10 * 1000, // 10 seconds, because tests are small for now
// Use the list reporter even on CI, to get immediate feedback
reporter: "list",
fullyParallel: true,
use: {
trace: "retain-on-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;