-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
76 lines (73 loc) · 3.47 KB
/
Copy pathplaywright.config.ts
File metadata and controls
76 lines (73 loc) · 3.47 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
import { defineConfig, devices } from '@playwright/test'
/**
* Playwright end-to-end configuration for Versioniq.
*
* The suite drives the real admin UI against a running Nextcloud instance with
* this app enabled. Point it at a disposable instance (see docs/e2e.md) — the
* specs create and clean up their own state (pins, policies), but they operate
* on a live instance and must never be aimed at production.
*
* Base URL and credentials come from the environment so the same suite runs
* against a throwaway container locally and against CI's instance later:
* NC_BASE_URL (default http://localhost:8099)
* NC_ADMIN_USER (default admin)
* NC_ADMIN_PASS (default adminadmin123)
*/
export const NC_BASE_URL = process.env.NC_BASE_URL ?? 'http://localhost:8099'
export const NC_ADMIN_USER = process.env.NC_ADMIN_USER ?? 'admin'
export const NC_ADMIN_PASS = process.env.NC_ADMIN_PASS ?? 'adminadmin123'
/** Where the logged-in admin session is persisted by `auth.setup.ts`. */
export const AUTH_FILE = 'tests/e2e/.auth/admin.json'
export default defineConfig({
testDir: './tests/e2e',
// The admin settings page is a single shared surface and several specs mutate
// server-side state (pins, policies, cache). Serial execution keeps them from
// racing each other on the same instance.
fullyParallel: false,
workers: 1,
forbidOnly: !!process.env.CI,
// One retry everywhere. The forge specs mutate shared server-side state (the
// fixture app's installed version, recorded digests) on a single instance
// they run serially against; a retry re-runs a flaked test from a clean
// beforeEach. Each such test is verified to pass in isolation, so a retry
// recovers from state-isolation races, not from a product defect.
retries: 1,
// The shared quality.yml Playwright job is `timeout-minutes: 45`, and a job
// cancelled by that cap produces NO verdict: Playwright never prints its
// tally, the `if: failure()` trace upload never fires, and the
// `if: always()` report upload does not run on a cancelled job either — the
// run you most need to read is the one that leaves nothing behind, and it
// still renders as "fail" in `gh pr checks` while carrying no information.
// Runs cancelled at ~45m16s have been observed in this fleet. Measured
// overhead before `Run Playwright tests` starts is 2.0-2.4 min and the
// uploads after it take seconds, so 38m keeps ~7 min of margin while
// guaranteeing both a tally and the artifacts that explain it.
globalTimeout: 38 * 60_000,
reporter: process.env.CI ? [['list'], ['html', { open: 'never' }]] : [['list']],
timeout: 60_000,
expect: { timeout: 15_000 },
use: {
baseURL: NC_BASE_URL,
// A cold Nextcloud (empty opcache) can take ~30s to serve the first page,
// which is exactly the default navigation timeout — be generous so a cold
// instance is slow rather than flaky.
navigationTimeout: 90_000,
actionTimeout: 20_000,
trace: 'retain-on-failure',
screenshot: 'only-on-failure',
video: 'off',
ignoreHTTPSErrors: true,
},
projects: [
// Logs in once and persists the session for every other project. It must
// run without a stored session, so `storageState` is set on the consuming
// project rather than globally (an inherited `undefined` still resolves to
// the parent value and would make setup fail on a missing state file).
{ name: 'setup', testMatch: /auth\.setup\.ts/ },
{
name: 'chromium',
use: { ...devices['Desktop Chrome'], storageState: AUTH_FILE },
dependencies: ['setup'],
},
],
})