-
Notifications
You must be signed in to change notification settings - Fork 2
/
playwright.config.ts
49 lines (48 loc) · 1.65 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
import { defineConfig, devices } from '@playwright/test';
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './playwright',
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 0 : 0,
workers: process.env.CI ? 2 : 2,
reporter: process.env.CI ? [['github'], ['list'], ['html', { open: 'never' }]] : [['list'], ['html', { open: 'never' }]],
use: {
baseURL: 'http://127.0.0.1:8080',
testIdAttribute: 'data-testid',
viewport: { width: 1920, height: 1080 },
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
/* Capture screenshot after each test failure: https://playwright.dev/docs/test-use-options#recording-options */
screenshot: 'only-on-failure',
/* Capture video */
// video: 'retain-on-failure',
},
expect: { timeout: 20000 },
timeout: 1000 * 60,
globalTimeout: 8 * 60 * 1000,
projects: [
{ name: 'setup', testMatch: /.*\.setup\.ts/ },
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], viewport: { width: 1920, height: 1080 }, storageState: 'playwright/.auth/user.json' },
dependencies: ['setup'],
},
],
/* Run your local dev server before starting the tests */
webServer: [
{
command: 'yarn start dev_server_only=true',
url: 'http://127.0.0.1:8080',
reuseExistingServer: !process.env.CI,
},
{
command: 'make start',
url: 'http://127.0.0.1:9000/health',
reuseExistingServer: !process.env.CI,
},
],
});