@grafana/e2e: screenshots and panel flow (#25203)

* Cleanup

* addPanel now supports (optional) custom dashboardUid

* addPanel now supports (optional) visualization name

* Added CLI option for updating screenshot fixtures

* Added support for console.* functions within tests

* Refactored screenshot command for greater simplicity

* addPanel now sets a unique title

* Updated lockfile
This commit is contained in:
Steven Vachon
2020-06-01 08:48:23 -04:00
committed by GitHub
parent 01ecbae2ee
commit 78febbbeef
10 changed files with 145 additions and 79 deletions
@@ -4,10 +4,11 @@ const {
} = require('fs');
const { resolve } = require('path');
// @todo use https://github.com/bahmutov/cypress-extends when possible
module.exports = async baseConfig => {
// From CLI
const {
env: { CWD },
env: { CWD, UPDATE_SCREENSHOTS },
} = baseConfig;
if (CWD) {
@@ -21,7 +22,7 @@ module.exports = async baseConfig => {
reporterOptions: {
output: `${CWD}/cypress/report.json`,
},
screenshotsFolder: `${CWD}/cypress/screenshots`,
screenshotsFolder: `${CWD}/cypress/screenshots/${UPDATE_SCREENSHOTS ? 'expected' : 'actual'}`,
videosFolder: `${CWD}/cypress/videos`,
};