-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
76 lines (71 loc) · 2.06 KB
/
playwright.config.ts
File metadata and controls
76 lines (71 loc) · 2.06 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
/*!
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { defineConfig, devices } from '@playwright/test'
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests/playwright',
fullyParallel: true,
// ensure no `test.only` is left in the code causing false positives
forbidOnly: !!process.env.CI,
// on CI we retry once to get traces of failures
retries: process.env.CI ? 1 : 0,
// we shard on CI to speed up the tests so no parallelism in workers
workers: process.env.CI ? 1 : undefined,
// on CI we want to have blob (so we can merge reports and download them for inspection),
// dot (so we have a quick overview in the logs while the tests are running)
// github (to have annotations in the PR)
// locally we just want the html report with the traces
reporter: process.env.CI ? [['blob'], ['dot'], ['github']] : 'html',
use: {
baseURL: 'http://localhost:8089/index.php/',
// we record traces but only keep them when the test fails
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
},
...(process.env.CI
? [
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
{
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},
]
: []),
],
webServer: {
// url: 'http://127.0.0.1:8089',
// Starts the Nextcloud docker container
command: 'node tests/playwright/start-nextcloud-server.js',
env: {
NEXTCLOUD_PORT: '8089',
},
// get output of the webserver
stderr: 'pipe',
stdout: 'pipe',
// we use sigterm to notify the script to stop the container
// if it does not respond, we force kill it after 10 seconds
gracefulShutdown: {
signal: 'SIGTERM',
timeout: 10000,
},
reuseExistingServer: !process.env.CI,
timeout: 5 * 60 * 1000,
wait: {
// we wait for this line to appear in the output of the webserver until consider it done
stdout: /Nextcloud is now ready to use/,
},
},
})