forked from internetarchive/openlibrary
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
44 lines (41 loc) · 1.21 KB
/
Copy pathplaywright.config.ts
File metadata and controls
44 lines (41 loc) · 1.21 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
import { defineConfig, devices } from '@playwright/test';
/**
* Run tests against a local Docker instance:
* OL_MOUNT_DIR="$(pwd)" docker compose up -d web infobase db memcached home covers
* npx playwright install chromium chromium-headless-shell
* npm run test:e2e
*
* Projects are split so nothing runs twice: the core smoke tests run on the
* `desktop` project only, while tests tagged `@mobile` (responsive-layout
* checks) run on the `mobile` project only.
*/
export default defineConfig({
testDir: './tests/e2e',
timeout: 30_000,
retries: 0,
reporter: [['list'], ['html', { open: 'never' }]],
use: {
baseURL: process.env.OL_BASE_URL || 'http://localhost:8080',
headless: true,
},
projects: [
{
name: 'desktop',
grepInvert: /@mobile/,
use: {
...devices['Desktop Chrome'],
viewport: { width: 1280, height: 800 },
},
},
{
name: 'mobile',
grep: /@mobile/,
use: {
// Use Pixel 5 (Chromium) instead of iPhone 12 (WebKit).
// WebKit headless launch times out on some macOS systems; Chromium is more reliable.
...devices['Pixel 5'],
viewport: { width: 390, height: 844 },
},
},
],
});