grafana/packages/grafana-e2e/cypress/support/commands.ts
Steven Vachon 78febbbeef
@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
2020-06-01 08:48:23 -04:00

25 lines
604 B
TypeScript

interface CompareSceenshotsConfig {
name: string;
threshold?: number;
}
Cypress.Commands.add('compareSceenshots', (config: CompareSceenshotsConfig | string) => {
cy.task('compareSceenshots', {
config,
screenshotsFolder: Cypress.config('screenshotsFolder'),
specName: Cypress.spec.name,
});
});
// @todo remove
Cypress.Commands.add('logToConsole', (message: string, optional?: any) => {
cy.task('log', { message, optional });
});
Cypress.Commands.add('readProvisions', (filePaths: string[]) => {
cy.task('readProvisions', {
CWD: Cypress.env('CWD'),
filePaths,
});
});