forked from GoodDollar/GoodWidget
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
56 lines (55 loc) · 1.73 KB
/
Copy pathplaywright.config.ts
File metadata and controls
56 lines (55 loc) · 1.73 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
/**
* playwright.config.ts — Playwright configuration for the GoodWidget Storybook.
*
* Targets the Storybook dev server at http://localhost:6006.
*
* Usage:
* # Start Storybook first:
* pnpm storybook
*
* # Run Playwright tests against Storybook story URLs:
* pnpm test:demo
*
* # Run Storybook's built-in test runner (interaction + play function tests):
* pnpm test:storybook
*
* Playwright traces/videos/attachments are written to test-results/ (gitignored).
* Spec-authored screenshots can also be written tests/ in a widgets localized folder..
*/
import { defineConfig, devices } from '@playwright/test'
export default defineConfig({
testDir: './tests',
timeout: 30_000,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 1,
workers: process.env.CI ? 1 : undefined,
reporter: [['html', { outputFolder: 'playwright-report', open: 'never' }], ['list']],
use: {
baseURL: 'http://localhost:6006',
screenshot: 'on',
trace: 'on-first-retry',
video: 'retain-on-failure',
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
// Required for citizen-claim-widget tests: viem makes cross-origin POST
// requests to forno.celo.org / rpc.fuse.io from a localhost Storybook page.
// In sandboxed CI environments the browser's certificate store may not
// include all CA certs used by RPC providers, hence both flags are needed.
launchOptions: {
args: ['--disable-web-security', '--ignore-certificate-errors'],
},
},
},
],
webServer: {
command: 'pnpm storybook',
url: 'http://localhost:6006',
reuseExistingServer: true,
timeout: 120_000,
},
outputDir: 'test-results',
})