forked from temporalio/ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
playwright.config.ts
47 lines (45 loc) · 1.2 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
import { defineConfig, devices } from '@playwright/test';
const PLAYWRIGHT_MODE = process.env.PW_MODE;
const PORT = PLAYWRIGHT_MODE === 'e2e' ? 3000 : 3333;
export default defineConfig({
testDir: './tests',
timeout: 10 * 1000,
expect: {
timeout: 10000,
},
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 3 : 1,
workers: process.env.CI ? 1 : undefined,
reporter: [
['html'],
['json', { outputFile: 'playwright-report/test-results.json' }],
[process.env.CI ? 'list' : 'github'],
[
'./tests/test-utilities/accessibility-reporter',
{ outputFile: 'playwright-report/accessibility-violations.json' },
],
],
use: {
actionTimeout: 0,
baseURL: `http://localhost:${PORT}`,
trace: 'retain-on-failure',
timezoneId: 'America/Denver',
storageState: `./tests/${PLAYWRIGHT_MODE}/storageState.json`,
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
webServer: {
command: `pnpm serve:playwright:${PLAYWRIGHT_MODE}`,
port: PORT,
},
globalSetup: './tests/global-setup.ts',
globalTeardown: './tests/global-teardown.ts',
metadata: {
mode: PLAYWRIGHT_MODE,
},
});