mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 16:12:30 +08:00

* Revert: Future-proofing query and data source model in Dashboard Schema v2 --------- Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
22 lines
621 B
TypeScript
22 lines
621 B
TypeScript
import { e2e } from '../..';
|
|
import testV2Dashboard from '../../../dashboards/TestV2Dashboard.json';
|
|
|
|
export interface ImportDashboardConfig {
|
|
title?: string;
|
|
}
|
|
|
|
export const importV2Dashboard = ({ title }: ImportDashboardConfig) => {
|
|
e2e.pages.ImportDashboard.visit();
|
|
e2e.components.DashboardImportPage.textarea().type(JSON.stringify(testV2Dashboard), {
|
|
delay: 0,
|
|
parseSpecialCharSequences: false,
|
|
});
|
|
|
|
e2e.components.DashboardImportPage.submit().click();
|
|
|
|
if (title) {
|
|
e2e.components.ImportDashboardForm.name().clear().type(title);
|
|
}
|
|
e2e.components.ImportDashboardForm.submit().click();
|
|
};
|