-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
73 lines (71 loc) · 2.45 KB
/
Copy pathplaywright.config.ts
File metadata and controls
73 lines (71 loc) · 2.45 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
import { defineConfig, devices } from '@playwright/test'
/**
* E2E suite — automates the browser-checkable parts of
* manual-test-checklist.md. Camera and microphone come from Chromium's fake
* media stack, so recording, editing, playback, and export all run for real
* (only true hardware behavior — torch, zoom optics, share sheets — stays
* on the manual list).
*
* Run: npm run test:e2e
*/
const PORT = 4189
export default defineConfig({
testDir: 'tests/e2e',
fullyParallel: true,
// Recording + export tests do real encoding work.
timeout: 90_000,
expect: { timeout: 10_000 },
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 1 : 0,
reporter: process.env.CI ? [['list'], ['github']] : [['list']],
use: {
baseURL: `http://127.0.0.1:${PORT}`,
trace: 'retain-on-failure',
permissions: ['camera', 'microphone'],
launchOptions: {
args: [
'--use-fake-ui-for-media-stream',
'--use-fake-device-for-media-stream',
'--autoplay-policy=no-user-gesture-required',
// Headless CI has no mDNS: without this, WebRTC host candidates are
// *.local names the other context cannot resolve (send-to-device).
'--disable-features=WebRtcHideLocalIpsWithMdns',
],
},
},
projects: [
{
name: 'mobile',
use: {
...devices['Pixel 7'],
// Mouse-driven pointer events: the app listens to pointerdown, and
// desktop-style input keeps hold/drag gestures deterministic.
isMobile: false,
hasTouch: false,
defaultBrowserType: 'chromium',
},
testIgnore: [/desktop-keyboard/, /orientation-touch/],
},
{
// Real touch emulation (pointer: coarse): the rotate-to-choose
// orientation flow only exists on devices that are physically held.
// Input still drives through the mouse (pointer events fire the same).
name: 'touch',
use: { ...devices['Pixel 7'], defaultBrowserType: 'chromium' },
testMatch: /orientation-touch/,
},
{
name: 'desktop',
use: { ...devices['Desktop Chrome'], viewport: { width: 1100, height: 800 } },
testMatch: /desktop-keyboard/,
},
],
webServer: {
// Dev server (not preview): specs seed state by importing /src modules
// in-page, which needs vite transforms.
command: `npm run dev -- --host 127.0.0.1 --port ${PORT}`,
url: `http://127.0.0.1:${PORT}`,
reuseExistingServer: !process.env.CI,
timeout: 30_000,
},
})