2022-07-06 09:53:26 +02:00
|
|
|
import { defineConfig } from 'cypress';
|
2022-08-03 17:45:49 +02:00
|
|
|
|
|
|
|
let tokensCache = new Map<string,string>()
|
|
|
|
let initmfaandpwrequired = true
|
2022-07-06 09:53:26 +02:00
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
reporter: 'mochawesome',
|
|
|
|
|
|
|
|
reporterOptions: {
|
|
|
|
reportDir: 'cypress/results',
|
|
|
|
overwrite: false,
|
|
|
|
html: true,
|
|
|
|
json: true,
|
|
|
|
},
|
|
|
|
|
|
|
|
chromeWebSecurity: false,
|
|
|
|
trashAssetsBeforeRuns: false,
|
|
|
|
defaultCommandTimeout: 10000,
|
|
|
|
|
|
|
|
e2e: {
|
2022-07-09 11:11:25 +02:00
|
|
|
experimentalSessionAndOrigin: true,
|
2022-07-06 09:53:26 +02:00
|
|
|
setupNodeEvents(on, config) {
|
2022-07-09 11:11:25 +02:00
|
|
|
require('cypress-terminal-report/src/installLogsPrinter')(on);
|
|
|
|
|
2022-08-03 17:45:49 +02:00
|
|
|
on('task', {
|
|
|
|
safetoken({key, token}) {
|
|
|
|
tokensCache.set(key,token);
|
|
|
|
return null
|
|
|
|
}
|
|
|
|
})
|
|
|
|
on('task', {
|
|
|
|
loadtoken({key}): string | null {
|
|
|
|
return tokensCache.get(key) || null;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
on('task', {
|
|
|
|
initmfaandpwrequired(){
|
|
|
|
if (config.env.noInitMFAAndPWRequired == 'true'){
|
|
|
|
initmfaandpwrequired = false
|
|
|
|
}
|
|
|
|
if (initmfaandpwrequired){
|
|
|
|
initmfaandpwrequired = false
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
})
|
2022-07-06 09:53:26 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|