mirror of
https://github.com/grafana/grafana.git
synced 2024-12-28 01:41:24 -06:00
7bca69849f
* Mark Scenes feature toggles as GA * Move old arch e2e to a new folder * Run E2E on scenes by default * Upgrade e2e-selectors to ensure the tests in Playwright works
18 lines
869 B
TypeScript
18 lines
869 B
TypeScript
import { importDashboard, Dashboard } from './importDashboard';
|
|
|
|
/**
|
|
* Smoke test several dashboard json files from a test directory
|
|
* and validate that all the panels in each import finish loading their queries
|
|
* @param dirPath the relative path to a directory which contains json files representing dashboards,
|
|
* for example if your dashboards live in `cypress/testDashboards` you can pass `/testDashboards`
|
|
* @param queryTimeout a number of ms to wait for the imported dashboard to finish loading
|
|
* @param skipPanelValidation skips panel validation
|
|
*/
|
|
export const importDashboards = async (dirPath: string, queryTimeout?: number, skipPanelValidation?: boolean) => {
|
|
cy.getJSONFilesFromDir(dirPath).then((jsonFiles: Dashboard[]) => {
|
|
jsonFiles.forEach((file) => {
|
|
importDashboard(file, queryTimeout || 6000, skipPanelValidation);
|
|
});
|
|
});
|
|
};
|