-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
72 lines (69 loc) · 2.19 KB
/
Copy pathplaywright.config.ts
File metadata and controls
72 lines (69 loc) · 2.19 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
import { defineConfig, devices } from '@playwright/test';
const port = process.env.SABLE_PREVIEW_PORT ?? '4173';
const origin = `http://127.0.0.1:${port}`;
const SCRIPTED_TIMELINE_SPECS =
/(?:^|\/)(?:timeline-(?:anchoring|stability|gap|keyboard|lifecycle|media)|thread-links)\.spec\.ts$/;
const build = process.env.SABLE_E2E_PREBUILT
? ''
: 'SABLE_WASM_OUTPUT=src/generated/wasm-e2e pnpm run build && ';
export default defineConfig({
testDir: 'tests/e2e',
fullyParallel: true,
// One preview server and one homeserver back the whole suite, so uncapped
// workers starve each other into timeouts.
workers: 4,
forbidOnly: Boolean(process.env.CI),
retries: process.env.CI ? 2 : 0,
timeout: 60_000,
reporter: process.env.CI ? [['html', { open: 'never' }], ['list']] : 'list',
use: {
baseURL: origin,
trace: 'on-first-retry',
// A click must not land mid-transition.
contextOptions: { reducedMotion: 'reduce' },
},
projects: [
{
name: 'setup',
testMatch: /global\.setup\.ts/,
teardown: 'teardown',
retries: 0,
timeout: 300_000,
},
{ name: 'teardown', testMatch: /global\.teardown\.ts/ },
{
name: 'chromium',
dependencies: ['setup'],
testIgnore: /global\.(setup|teardown)\.ts/,
use: devices['Desktop Chrome'],
},
{
// Sable ships an iOS app, whose Tauri webview is WebKit. Keep this
// deliberately small so it catches compatibility regressions cheaply.
name: 'webkit',
dependencies: ['setup'],
testMatch: /(?:^|\/)(?:app-shell|login|navigation|window-activity|thread-links)\.spec\.ts$/,
use: devices['Desktop Safari'],
},
{
name: 'android',
testMatch: SCRIPTED_TIMELINE_SPECS,
use: { ...devices['Pixel 7'], browserName: 'chromium' },
},
{
name: 'ios',
testMatch: SCRIPTED_TIMELINE_SPECS,
use: { ...devices['iPhone 13'], browserName: 'webkit' },
},
],
webServer: {
command: `${build}pnpm exec vite preview --host 127.0.0.1 --port ${port} --strictPort`,
url: origin,
reuseExistingServer: !process.env.CI,
timeout: 600_000,
gracefulShutdown: {
signal: 'SIGTERM',
timeout: 5_000,
},
},
});