forked from awslabs/iot-application
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaywright.config.ts
85 lines (80 loc) · 2.02 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import { devices, defineConfig } from '@playwright/test';
// Read environment variables
// baseURL defaults to http://localhost:3000
const baseURL = process.env.ENDPOINT ?? 'http://localhost:3000';
// launchWebServer defaults to true
const launchWebServer = process.env.LAUNCH_WEB_SERVER != 'false';
// Configuration for launching the web server
const launchWebServerConfig = [
{
command: 'yarn start:core',
url: 'http://localhost:3000/health',
reuseExistingServer: !process.env.CI,
timeout: 300 * 1000, // 5 minutes
},
{
command: 'yarn start:client',
url: 'http://localhost:3001',
reuseExistingServer: !process.env.CI,
timeout: 300 * 1000, // 5 minutes
},
];
// If launchWebServer is true, add the web server launching configuration
const webServer = launchWebServer ? launchWebServerConfig : undefined;
export default defineConfig({
use: {
baseURL,
navigationTimeout: 30000,
screenshot: 'only-on-failure',
trace: 'on',
video: 'retain-on-failure',
},
testDir: './tests',
/* Maximum time one test can run for. */
timeout: 60000,
expect: {
/**
* Maximum time expect() should wait for the condition to be met.
* For example in `await expect(locator).toHaveText();`
*/
timeout: 30000,
},
fullyParallel: false,
forbidOnly: !!process.env.CI,
maxFailures: 0,
workers: 1,
reporter: 'html',
retries: 0,
projects: [
{
name: 'setup',
testMatch: /.*\.setup\.ts/,
retries: 5,
},
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
storageState: 'playwright/.auth/user.json',
},
dependencies: ['setup'],
},
{
name: 'firefox',
use: {
...devices['Desktop Firefox'],
storageState: 'playwright/.auth/user.json',
},
dependencies: ['setup'],
},
{
name: 'webkit',
use: {
...devices['Desktop Safari'],
storageState: 'playwright/.auth/user.json',
},
dependencies: ['setup'],
},
],
webServer,
});