-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcypress.config.mjs
More file actions
33 lines (31 loc) · 906 Bytes
/
cypress.config.mjs
File metadata and controls
33 lines (31 loc) · 906 Bytes
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
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { defineConfig } from 'cypress'
import { configureNextcloud, startNextcloud, stopNextcloud, waitOnNextcloud } from '@nextcloud/cypress/docker'
export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
// Remove container after run
on('after:run', () => {
if (!process.env.CI) {
stopNextcloud()
}
})
// starting Nextcloud testing container with specified server branch
return startNextcloud(process.env.BRANCH)
.then((ip) => {
// Setting container's IP as base Url
config.baseUrl = `http://${ip}/index.php`
return ip
})
.then(waitOnNextcloud)
// configure Nextcloud, also enable the app
.then(() => configureNextcloud(['data_request']))
.then(() => {
return config
})
},
},
})