grafana/e2e/cypress/support/commands.js
Ashley Harrison 6a5de14ed1
Chore: Remove compareScreenshot + blink-diff dependency from core (#77920)
* remove compareScreenshot + blink-diff dependency from core

* missed one...
2023-11-09 13:18:12 +00:00

29 lines
945 B
JavaScript

import 'cypress-file-upload';
Cypress.Commands.add('logToConsole', (message, optional) => {
cy.task('log', { message: '(' + new Date().toISOString() + ') ' + message, optional });
});
Cypress.Commands.add('readProvisions', (filePaths) => {
cy.task('readProvisions', {
CWD: Cypress.env('CWD'),
filePaths,
});
});
Cypress.Commands.add('getJSONFilesFromDir', (dirPath) => {
return cy.task('getJSONFilesFromDir', {
// CWD is set for plugins in the cli but not for the main grafana repo: https://github.com/grafana/grafana/blob/main/packages/grafana-e2e/cli.js#L12
projectPath: Cypress.env('CWD') || Cypress.config().parentTestsFolder,
relativePath: dirPath,
});
});
Cypress.Commands.add('startBenchmarking', (testName) => {
return cy.task('startBenchmarking', { testName });
});
Cypress.Commands.add('stopBenchmarking', (testName, appStats) => {
return cy.task('stopBenchmarking', { testName, appStats });
});