mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
@grafana/e2e: generate JSON report file (#25033)
* Output JSON report from Cypress * Updated lockfile
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"supportFile": "cypress/support/index.ts",
|
||||
"projectId": "zb7k1c"
|
||||
"projectId": "zb7k1c",
|
||||
"supportFile": "cypress/support/index.ts"
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
"@cypress/webpack-preprocessor": "4.1.3",
|
||||
"@grafana/e2e-selectors": "7.1.0-pre.0",
|
||||
"@grafana/tsconfig": "^1.0.0-rc1",
|
||||
"@mochajs/json-file-reporter": "^1.2.0",
|
||||
"blink-diff": "1.0.13",
|
||||
"commander": "5.0.0",
|
||||
"cypress": "4.5.0",
|
||||
|
||||
Reference in New Issue
Block a user