@grafana/plugin-ui 0.3.6 → 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 +45 -0
- package/dist/e2e/flows/editor.js.map +1 -0
- package/dist/e2e/index.js +2 -0
- package/dist/e2e/index.js.map +1 -1
- package/dist/e2e/selectors.js +19 -0
- package/dist/e2e/selectors.js.map +1 -0
- package/dist/src/e2e/flows/editor.d.ts +11 -0
- package/dist/src/e2e/index.d.ts +2 -0
- package/dist/src/e2e/selectors.d.ts +16 -0
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runQuery = exports.fillQuery = void 0;
|
|
4
|
+
const e2e_1 = require("@grafana/e2e");
|
|
5
|
+
const selectors_1 = require("../selectors");
|
|
6
|
+
const e2eSelectors = e2e_1.e2e.getSelectors(selectors_1.selectors.components);
|
|
7
|
+
const selectDropdown = (container, text) => {
|
|
8
|
+
container.within(() => {
|
|
9
|
+
e2e_1.e2e.components.Select.input().first().should('be.empty').focus().type(`${text}{enter}`);
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
const fillQuery = (query, overrideFormat) => {
|
|
13
|
+
e2eSelectors.QueryEditor.CodeEditor.input()
|
|
14
|
+
.scrollIntoView()
|
|
15
|
+
.type(Cypress.platform === 'darwin' ? '{cmd}a' : '{ctrl}a')
|
|
16
|
+
.type('{backspace}')
|
|
17
|
+
.type(query)
|
|
18
|
+
.type(Cypress.platform === 'darwin' ? '{cmd}s' : '{ctrl}s');
|
|
19
|
+
if (overrideFormat) {
|
|
20
|
+
selectDropdown(e2eSelectors.QueryEditor.FormatAs.label(), overrideFormat);
|
|
21
|
+
}
|
|
22
|
+
(0, e2e_1.e2e)().wait(3000);
|
|
23
|
+
};
|
|
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;
|
|
45
|
+
//# sourceMappingURL=editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../src/e2e/flows/editor.ts"],"names":[],"mappings":";;;AAAA,sCAAmC;AACnC,4CAAyC;AAGzC,MAAM,YAAY,GAAG,SAAG,CAAC,YAAY,CAAC,qBAAS,CAAC,UAAU,CAAC,CAAC;AAE5D,MAAM,cAAc,GAAG,CAAC,SAAiD,EAAE,IAAY,EAAE,EAAE;IACvF,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE;QAClB,SAAG,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,GAAG,IAAI,SAAS,CAAC,CAAC;IAC5F,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEK,MAAM,SAAS,GAAG,CAAC,KAAa,EAAE,cAAiD,EAAE,EAAE;IAC1F,YAAY,CAAC,WAAW,CAAC,UAAU,CAAC,KAAK,EAAE;SACtC,cAAc,EAAE;SA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AACL,CAAC,CAAA;AAlBY,QAAA,QAAQ,YAkBpB"}
|
package/dist/e2e/index.js
CHANGED
|
@@ -3,4 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./migrate"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./flows/flows"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./flows/editor"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./selectors"), exports);
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
package/dist/e2e/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/e2e/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,wDAA8B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/e2e/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,wDAA8B;AAC9B,yDAA+B;AAC/B,sDAA4B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.selectors = exports.Components = void 0;
|
|
4
|
+
exports.Components = {
|
|
5
|
+
QueryEditor: {
|
|
6
|
+
CodeEditor: {
|
|
7
|
+
label: `SQL Query`,
|
|
8
|
+
tip: 'Tip: To re-run the query while you are editing, press ctrl/cmd+s.',
|
|
9
|
+
input: () => '.monaco-editor textarea',
|
|
10
|
+
},
|
|
11
|
+
FormatAs: {
|
|
12
|
+
label: `Format as`,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
exports.selectors = {
|
|
17
|
+
components: exports.Components,
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=selectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors.js","sourceRoot":"","sources":["../../src/e2e/selectors.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG;IACtB,WAAW,EAAE;QACT,UAAU,EAAE;YACR,KAAK,EAAE,WAAW;YAClB,GAAG,EAAE,mEAAmE;YACxE,KAAK,EAAE,GAAG,EAAE,CAAC,yBAAyB;SACzC;QACD,QAAQ,EAAE;YACN,KAAK,EAAE,WAAW;SACrB;KACJ;CACJ,CAAC;AAEW,QAAA,SAAS,GAAoD;IACtE,UAAU,EAAE,kBAAU;CACzB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="cypress" />
|
|
2
|
+
import { TimeRangeConfig } from '@grafana/e2e/flows/setTimeRange';
|
|
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;
|
package/dist/src/e2e/index.d.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { E2ESelectors } from '@grafana/e2e-selectors';
|
|
2
|
+
export declare const Components: {
|
|
3
|
+
QueryEditor: {
|
|
4
|
+
CodeEditor: {
|
|
5
|
+
label: string;
|
|
6
|
+
tip: string;
|
|
7
|
+
input: () => string;
|
|
8
|
+
};
|
|
9
|
+
FormatAs: {
|
|
10
|
+
label: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare const selectors: {
|
|
15
|
+
components: E2ESelectors<typeof Components>;
|
|
16
|
+
};
|