generated from eea/volto-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 5
/
cypress.config.js
43 lines (39 loc) · 1.05 KB
/
cypress.config.js
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
const { defineConfig } = require('cypress');
const fs = require('fs');
const path = require('path');
module.exports = defineConfig({
viewportWidth: 1280,
defaultCommandTimeout: 8888,
chromeWebSecurity: false,
reporter: 'junit',
video: false,
retries: {
runMode: 2,
openMode: 0,
},
reporterOptions: {
mochaFile: 'cypress/reports/cypress-[hash].xml',
jenkinsMode: true,
toConsole: true,
},
e2e: {
setupNodeEvents(on, config) {
// e2e testing node events setup code
require('@cypress/code-coverage/task')(on, config);
on('task', {
getVoltoVersion() {
const baseProjectRoot = path.resolve(__dirname, '../../../');
const packageJsonPath = path.join(
baseProjectRoot,
'node_modules/@plone/volto/package.json',
);
const contents = fs.readFileSync(packageJsonPath, 'utf-8');
const file = JSON.parse(contents);
return file.version;
},
});
return config;
},
baseUrl: 'http://localhost:3000',
},
});