-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.js
More file actions
59 lines (48 loc) · 1.48 KB
/
Copy pathplaywright.config.js
File metadata and controls
59 lines (48 loc) · 1.48 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
// @ts-check
const { defineConfig, devices } = require('@playwright/test');
/**
* Playwright configuration for LockIn e2e tests.
* @see https://playwright.dev/docs/test-configuration
*/
module.exports = defineConfig({
testDir: './tests',
testIgnore: '**/unit/**',
testMatch: '*.spec.js',
/* Maximum time one test can run */
timeout: 30_000,
/* Expect timeout for assertions */
expect: {
timeout: 5_000,
},
/* Run tests sequentially in CI, parallel locally */
fullyParallel: true,
/* 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,
/* Reporter */
reporter: 'html',
/* Shared settings for all projects */
use: {
baseURL: 'http://localhost:3000',
/* Collect trace when retrying the failed test */
trace: 'on-first-retry',
},
/* Only test with Chromium for speed */
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
/* Run the appropriate server before starting the tests.
* In CI we always run `next start` (serves the pre-built production bundle)
* because the dev compiler is too slow and non-deterministic on cold runners.
* Locally we use `next dev` so hot-reload works as expected. */
webServer: {
command: process.env.CI ? 'npm run start' : 'npm run dev',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
timeout: 120_000,
},
});