@grafana/e2e: generate JSON report file (#25033)

* Output JSON report from Cypress

* Updated lockfile
This commit is contained in:
Steven Vachon
2020-05-25 15:07:28 -04:00
committed by GitHub
parent a0e5f51d05
commit 68154cf98d
4 changed files with 92 additions and 4 deletions
@@ -14,6 +14,10 @@ module.exports = async baseConfig => {
const projectConfig = {
fixturesFolder: `${CWD}/cypress/fixtures`,
integrationFolder: `${CWD}/cypress/integration`,
reporter: '@mochajs/json-file-reporter', // putting this in cypress.json caused weird errors
reporterOptions: {
output: `${CWD}/cypress/report.json`,
},
screenshotsFolder: `${CWD}/cypress/screenshots`,
videosFolder: `${CWD}/cypress/videos`,
};
@@ -46,14 +50,23 @@ module.exports = async baseConfig => {
.catch(error => {
if (error.code === 'ENOENT') {
// File is optional
return null;
return {};
} else {
// Unexpected error
throw error;
}
});
return { ...baseConfig, ...projectConfig, ...customProjectConfig };
return {
...baseConfig,
...projectConfig,
...customProjectConfig,
reporterOptions: {
...baseConfig.reporterOptions,
...projectConfig.reporterOptions,
...customProjectConfig.reporterOptions,
},
};
} else {
// Temporary legacy support for Grafana core (using `yarn start`)
return baseConfig;