-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
98 lines (93 loc) · 2.81 KB
/
Copy pathplaywright.config.ts
File metadata and controls
98 lines (93 loc) · 2.81 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
import { defineConfig, devices } from '@playwright/test';
import { DEFAULT_ACTION_TIMEOUT_MS, TEST_TIMEOUT_MS } from './e2e/timeouts';
export const baseURL = process.env.E2E_BASE_URL || 'http://localhost:3000';
/**
* Playwright E2E test configuration for Norse.
*
* By default tests run against http://localhost:3000.
* Override with environment variable:
*
* E2E_BASE_URL=https://staging.example.com
*
* For authenticated tests (Favorites), provide:
* TEST_USER_EMAIL=...
* TEST_USER_PASSWORD=...
*/
export default defineConfig({
testDir: './e2e',
fullyParallel: true,
forbidOnly: !!process.env.CI,
workers: process.env.CI ? 1 : undefined,
reporter: [['html', { open: 'never' }], ['list']],
expect: {
/** @see e2e/timeouts `DEFAULT_ACTION_TIMEOUT_MS` / `E2E_DEFAULT_ACTION_TIMEOUT_MS` */
timeout: DEFAULT_ACTION_TIMEOUT_MS,
},
/**
* Per-test ceiling only. Each expect/goto uses `e2e/timeouts` (e.g. 20s
* `SEARCH_NAV_TIMEOUT_MS` per URL wait) so failures name the action; this
* value must be large enough for long flows. @see E2E_TEST_TIMEOUT_MS
*/
timeout: TEST_TIMEOUT_MS,
use: {
baseURL,
/**
* Per locator action (click, fill, …). @see e2e/timeouts
* `DEFAULT_ACTION_TIMEOUT_MS` — must match `expect.timeout` for consistency.
*/
actionTimeout: DEFAULT_ACTION_TIMEOUT_MS,
launchOptions: {
slowMo: Number(process.env.PW_SLOWMO ?? 0),
},
trace: 'on-first-retry',
screenshot: 'only-on-failure',
video: 'retain-on-failure',
locale: 'en',
},
projects: [
{
name: 'search-taxonomy',
testMatch: [
'**/search-taxonomy.spec.ts',
'**/search-suggestions.spec.ts',
],
use: { ...devices['Desktop Chrome'], baseURL },
},
{
name: 'translations',
testMatch: ['**/translations.spec.ts'],
use: { ...devices['Desktop Chrome'], baseURL },
},
{
name: 'search-geocode',
testMatch: ['**/search-location-geocode.spec.ts'],
use: { ...devices['Desktop Chrome'], baseURL },
},
{
name: 'favorites',
testMatch: ['**/favorites.spec.ts', '**/local-favorites.spec.ts'],
use: { ...devices['Desktop Chrome'], baseURL },
workers: 1,
},
{
name: 'share-link',
testMatch: ['**/share-link.spec.ts'],
use: { ...devices['Desktop Chrome'], baseURL },
},
{
name: 'accessibility',
testMatch: ['**/search-accessibility.spec.ts'],
use: { ...devices['Desktop Chrome'], baseURL },
},
{
name: 'ai-classification',
testMatch: ['**/search-ai-classification.spec.ts'],
use: { ...devices['Desktop Chrome'], baseURL },
},
{
name: 'resource-direct-link',
testMatch: ['**/search-resource-direct-link.spec.ts'],
use: { ...devices['Desktop Chrome'], baseURL },
},
],
});