The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/e2e/cypress/support/commands.js

34 lines
1.1 KiB

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 });
});
Cypress.Commands.add('setLocalStorage', (key, value) => {
cy.window().then((win) => {
win.localStorage.setItem(key, value);
});
});