@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
@@ -1,24 +1,22 @@
const compareSnapshotsPlugin = require('./compareSnapshots');
const compareScreenshots = require('./compareScreenshots');
const extendConfig = require('./extendConfig');
const readProvisions = require('./readProvisions');
const typescriptPreprocessor = require('./typescriptPreprocessor');
const { install: installConsoleLogger } = require('cypress-log-to-output');
module.exports = (on, config) => {
// yarn build fails with:
// >> /Users/hugo/go/src/github.com/grafana/grafana/node_modules/stringmap/stringmap.js:99
// >> throw new Error("StringMap expected string key");
// on('task', {
// failed: require('cypress-failed-log/src/failed')(),
// });
on('file:preprocessor', typescriptPreprocessor);
on('task', { compareSnapshotsPlugin, readProvisions });
on('task', { compareScreenshots, readProvisions });
on('task', {
// @todo remove
log({ message, optional }) {
optional ? console.log(message, optional) : console.log(message);
return null;
},
});
installConsoleLogger(on);
// Always extend with this library's config and return for diffing
// @todo remove this when possible: https://github.com/cypress-io/cypress/issues/5674
return extendConfig(config);