mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
test: Expose set and getVariable in Cypress tests
Partial cherry pick of 4a90d5328
Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
parent
acf19f7880
commit
bb010b233b
1 changed files with 13 additions and 0 deletions
|
|
@ -68,6 +68,19 @@ export default defineConfig({
|
|||
|
||||
on('task', { removeDirectory })
|
||||
|
||||
// This allows to store global data (e.g. the name of a snapshot)
|
||||
// because Cypress.env() and other options are local to the current spec file.
|
||||
const data = {}
|
||||
on('task', {
|
||||
setVariable({ key, value }) {
|
||||
data[key] = value
|
||||
return null
|
||||
},
|
||||
getVariable({ key }) {
|
||||
return data[key] ?? null
|
||||
},
|
||||
})
|
||||
|
||||
// Disable spell checking to prevent rendering differences
|
||||
on('before:browser:launch', (browser, launchOptions) => {
|
||||
if (browser.family === 'chromium' && browser.name !== 'electron') {
|
||||
|
|
|
|||
Loading…
Reference in a new issue