-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
109 lines (94 loc) · 2.97 KB
/
Copy pathplaywright.config.ts
File metadata and controls
109 lines (94 loc) · 2.97 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import { defineConfig, devices } from '@playwright/test';
/**
* @see https://playwright.dev/docs/test-configuration
*/
export default defineConfig({
testDir: './tests',
/* 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 ? 1 : 0,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: [
['html', { outputFolder: 'playwright-report' }],
['json', { outputFile: 'test-results.json' }],
['list']
],
/* Shared settings for all projects. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: process.env.PLAYWRIGHT_BASE_URL || 'http://localhost:8081',
/* Collect trace when retrying the failed test. */
trace: 'on-first-retry',
/* Take screenshot on failure */
screenshot: 'only-on-failure',
/* Record video on failure */
video: 'retain-on-failure',
/* Global timeout for each action (e.g. click, fill, etc.) */
actionTimeout: 30000,
/* Global timeout for each navigation action */
navigationTimeout: 30000,
},
/* Configure projects for different test execution modes */
projects: [
{
name: 'site-tests',
testMatch: ['tests/site.spec.ts'],
fullyParallel: true,
use: {
...devices['Desktop Chrome'],
headless: true,
viewport: { width: 1280, height: 720 }
},
},
{
name: 'smoke-tests',
testMatch: ['tests/e2e/smoke/*.spec.js'],
fullyParallel: true,
// workers: process.env.CI ? 1 : undefined,
use: {
...devices['Desktop Chrome'],
headless: true,
viewport: { width: 1920, height: 1080 }
},
},
{
name: 'parallel-e2e-tests',
testMatch: ['tests/e2e/queries/*.spec.js', 'tests/e2e/wallet/*.spec.js'],
fullyParallel: true,
// workers: process.env.CI ? 1 : undefined,
use: {
...devices['Desktop Chrome'],
headless: true,
viewport: { width: 1920, height: 1080 }
},
},
// Skip state transitions tests in CI environments
// These are very slow-running due to https://github.com/dashpay/platform/issues/2736
...(process.env.CI ? [] : [{
name: 'sequential-e2e-tests',
testMatch: ['tests/e2e/transitions/*.spec.js'],
fullyParallel: false,
workers: 1,
use: {
...devices['Desktop Chrome'],
headless: true,
viewport: { width: 1920, height: 1080 }
},
}]),
],
/* Run local dev server only if testing locally */
webServer: process.env.PLAYWRIGHT_BASE_URL ? undefined : {
command: process.env.DEBUG ? 'python3 -m http.server 8081' : 'python3 -m http.server 8081 2>/dev/null',
url: 'http://localhost:8081',
cwd: 'public',
reuseExistingServer: !process.env.CI,
timeout: 60000,
},
/* Global test timeout */
timeout: 120000,
/* Expect timeout for assertions */
expect: {
timeout: 10000,
},
});