1- import {
2- configureNextcloud ,
3- startNextcloud ,
4- stopNextcloud ,
5- waitOnNextcloud ,
6- } from './cypress/dockerNode'
1+ import { configureNextcloud , startNextcloud , stopNextcloud , waitOnNextcloud } from '@nextcloud/cypress/docker'
72// eslint-disable-next-line n/no-extraneous-import
83import { defineConfig } from 'cypress'
94
@@ -48,8 +43,18 @@ export default defineConfig({
4843 // Fix browserslist extend https://github.com/cypress-io/cypress/issues/2983#issuecomment-570616682
4944 on ( 'file:preprocessor' , vitePreprocessor ( { configFile : false } ) )
5045
51- // Enable the snapshot compare plugin
52- configureVisualRegression ( on )
46+ // This allows to store global data (e.g. the name of a snapshot)
47+ // because Cypress.env() and other options are local to the current spec file.
48+ const data = { }
49+ on ( 'task' , {
50+ setVariable ( { key, value } ) {
51+ data [ key ] = value
52+ return null
53+ } ,
54+ getVariable ( { key } ) {
55+ return data [ key ] ?? null
56+ } ,
57+ } )
5358
5459 // Disable spell checking to prevent rendering differences
5560 on ( 'before:browser:launch' , ( browser , launchOptions ) => {
@@ -76,17 +81,12 @@ export default defineConfig({
7681
7782 // Before the browser launches
7883 // starting Nextcloud testing container
79- return startNextcloud ( process . env . BRANCH )
80- . then ( ( ip ) => {
81- // Setting container's IP as base Url
82- config . baseUrl = `http://${ ip } /index.php`
83- return ip
84- } )
85- . then ( waitOnNextcloud )
86- . then ( ( ) => configureNextcloud ( process . env . BRANCH ) )
87- . then ( ( ) => {
88- return config
89- } )
84+ const ip = await startNextcloud ( process . env . BRANCH || 'master' )
85+ // Setting container's IP as base Url
86+ config . baseUrl = `http://${ ip } /index.php`
87+ await waitOnNextcloud ( ip )
88+ await configureNextcloud ( [ 'viewer' ] )
89+ return config
9090 } ,
9191 } ,
9292
0 commit comments