-
Notifications
You must be signed in to change notification settings - Fork 8
/
playwright.config.ts
56 lines (53 loc) · 1.28 KB
/
playwright.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
45
46
47
48
49
50
51
52
53
54
55
56
import { PlaywrightTestConfig, defineConfig, devices } from "@playwright/test";
const ciConfig: Partial<PlaywrightTestConfig> = {
forbidOnly: true,
retries: 2,
workers: 1,
reporter: "github",
use: {
actionTimeout: 30000,
trace: "on-first-retry",
screenshot: "on",
},
};
const localConfig: Partial<PlaywrightTestConfig> = {
forbidOnly: false,
retries: 0,
workers: undefined,
reporter: "dot",
use: {
actionTimeout: 0,
trace: "on-first-retry",
screenshot: "on",
},
};
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./tests",
/* Maximum time one test can run for. */
timeout: 30 * 1000,
expect: {
/**
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 5000,
},
/* Run tests in files in parallel */
fullyParallel: true,
/* Configure projects for major browsers */
projects: [
{
name: "chromium",
use: {
...devices["Desktop Chrome"],
viewport: { width: 360, height: 660 },
},
},
],
/* Folder for test artifacts such as screenshots, videos, traces, etc. */
outputDir: "test-results/",
...(process.env.CI ? ciConfig : localConfig),
});