@grafana/plugin-ui 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/e2e/flows/editor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fillQuery = void 0;
|
|
3
|
+
exports.runQuery = exports.fillQuery = void 0;
|
|
4
4
|
const e2e_1 = require("@grafana/e2e");
|
|
5
5
|
const selectors_1 = require("../selectors");
|
|
6
6
|
const e2eSelectors = e2e_1.e2e.getSelectors(selectors_1.selectors.components);
|
|
@@ -22,4 +22,24 @@ const fillQuery = (query, overrideFormat) => {
|
|
|
22
22
|
(0, e2e_1.e2e)().wait(3000);
|
|
23
23
|
};
|
|
24
24
|
exports.fillQuery = fillQuery;
|
|
25
|
+
const runQuery = (opts, pre, post) => {
|
|
26
|
+
if (pre !== undefined) {
|
|
27
|
+
pre();
|
|
28
|
+
}
|
|
29
|
+
if (opts.viewport !== undefined) {
|
|
30
|
+
cy.viewport(opts.viewport);
|
|
31
|
+
}
|
|
32
|
+
e2e_1.e2e.flows.login();
|
|
33
|
+
e2e_1.e2e.flows.addDashboard({ timeRange: opts.timeRange });
|
|
34
|
+
e2e_1.e2e.flows.addPanel({
|
|
35
|
+
dataSourceName: `E2E Datasource for ${opts.name}`,
|
|
36
|
+
panelTitle: opts.title || 'Query',
|
|
37
|
+
saveDashboard: false,
|
|
38
|
+
queriesForm: () => (0, exports.fillQuery)(opts.query),
|
|
39
|
+
});
|
|
40
|
+
if (post !== undefined) {
|
|
41
|
+
post();
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.runQuery = runQuery;
|
|
25
45
|
//# sourceMappingURL=editor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../src/e2e/flows/editor.ts"],"names":[],"mappings":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AAE,IAAiB,EAAE,EAAE;IAC7E,IAAI,GAAG,KAAK,SAAS,EAAE;QACnB,GAAG,EAAE,CAAC;KACT;IACD,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;QAC7B,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;KAC9B;IACD,SAAG,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IAClB,SAAG,CAAC,KAAK,CAAC,YAAY,CAAC,EAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAC,CAAC,CAAC;IACpD,SAAG,CAAC,KAAK,CAAC,QAAQ,CAAC;QACjB,cAAc,EAAE,sBAAsB,IAAI,CAAC,IAAI,EAAE;QACjD,UAAU,EAAE,IAAI,CAAC,KAAK,IAAI,OAAO;QACjC,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,GAAG,EAAE,CAAC,IAAA,iBAAS,EAAC,IAAI,CAAC,KAAK,CAAC;KACzC,CAAC,CAAC;IACH,IAAI,IAAI,KAAK,SAAS,EAAE;QACpB,IAAI,EAAE,CAAC;KACV;AACL,CAAC,CAAA;AAlBY,QAAA,QAAQ,YAkBpB"}
|
|
@@ -1 +1,11 @@
|
|
|
1
|
+
/// <reference types="cypress" />
|
|
2
|
+
import { TimeRangeConfig } from '@grafana/e2e/flows/setTimeRange';
|
|
1
3
|
export declare const fillQuery: (query: string, overrideFormat?: 'Table' | 'Time Series' | 'Logs') => void;
|
|
4
|
+
export interface QueryOpts {
|
|
5
|
+
name: string;
|
|
6
|
+
query: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
timeRange: TimeRangeConfig;
|
|
9
|
+
viewport?: Cypress.ViewportPreset;
|
|
10
|
+
}
|
|
11
|
+
export declare const runQuery: (opts: QueryOpts, pre?: () => void, post?: () => void) => void;
|