generated from digitalservicebund/remix-application-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaywright.config-base.ts
62 lines (58 loc) · 1.4 KB
/
playwright.config-base.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { devices, PlaywrightTestConfig } from "@playwright/test";
const projects = [
{
name: "Desktop Chrome",
use: {
...devices["Desktop Chrome"],
channel: "chrome",
},
},
{
name: "Desktop Firefox",
use: { ...devices["Desktop Firefox"] },
},
{
name: "Desktop Safari",
use: { ...devices["Desktop Safari"] },
},
{
name: "Desktop Edge",
use: { ...devices["Desktop Edge"] },
},
{
name: "Mobile Chrome",
use: { ...devices["Pixel 7"] },
},
// Omit tests with mobile safari due to very flaky test results
// {
// name: "Mobile Safari",
// use: { ...devices["iPhone 14 Pro"] },
// },
{
name: "Tablet Chrome",
use: { ...devices["Galaxy Tab S4 landscape"] },
},
{
name: "Tablet Safari",
use: { ...devices["iPad Pro 11 landscape"] },
},
];
export const projectsCi = projects.filter(
(project) => project.name === "Desktop Chrome",
);
const config: PlaywrightTestConfig = {
forbidOnly: !!process.env.CI, // Fail the build on CI if test.only is present
retries: process.env.CI ? 1 : 0, // Retry on CI only
use: {
viewport: { width: 1280, height: 720 },
acceptDownloads: true,
screenshot: "only-on-failure",
trace: "retain-on-failure",
},
reporter: [
[process.env.CI ? "github" : "list"],
["html", { outputFolder: "./playwright-report" }],
],
projects: projects,
};
export default config;