-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
60 lines (56 loc) · 1.85 KB
/
playwright.config.ts
File metadata and controls
60 lines (56 loc) · 1.85 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
/**
* SPDX-FileCopyrightText: 2026 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: './playwright',
// ensure no `test.only` is left in the code causing false positives
forbidOnly: !!process.env.CI,
// retry on CI only
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: {
// Base URL to use in actions like `await page.goto('./')`.
baseURL: process.env.baseURL ?? 'http://localhost:8089/index.php/',
// record traces but only keep them when the test fails
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
},
],
webServer: {
// url: 'http://127.0.0.1:8089',
// Starts the Nextcloud docker container
command: 'node playwright/start-nextcloud-server.js',
// 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,
stderr: 'pipe',
stdout: 'pipe',
// max. 5 minutes for creating the container
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/,
},
},
})