@grafana/plugin-e2e 0.2.0 → 0.2.1-canary.616.2fc2cca.0
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.
|
@@ -288,6 +288,9 @@ export declare const versionedComponents: {
|
|
|
288
288
|
OptionsGroup: {
|
|
289
289
|
group: (title?: string) => string;
|
|
290
290
|
toggle: (title?: string) => string;
|
|
291
|
+
groupTitle: {
|
|
292
|
+
"8.0.0": string;
|
|
293
|
+
};
|
|
291
294
|
};
|
|
292
295
|
PluginVisualization: {
|
|
293
296
|
item: (title: string) => string;
|
|
@@ -296,6 +296,9 @@ exports.versionedComponents = {
|
|
|
296
296
|
OptionsGroup: {
|
|
297
297
|
group: (title) => (title ? `Options group ${title}` : 'Options group'),
|
|
298
298
|
toggle: (title) => (title ? `Options group ${title} toggle` : 'Options group toggle'),
|
|
299
|
+
groupTitle: {
|
|
300
|
+
[constants_1.MIN_GRAFANA_VERSION]: 'Panel options',
|
|
301
|
+
},
|
|
299
302
|
},
|
|
300
303
|
PluginVisualization: {
|
|
301
304
|
item: (title) => `Plugin visualization item ${title}`,
|
|
@@ -10,7 +10,9 @@ export declare class PanelEditPage extends GrafanaPage implements PanelError {
|
|
|
10
10
|
timeRange: TimeRange;
|
|
11
11
|
constructor(ctx: PluginTestCtx, args: DashboardEditViewArgs<string>);
|
|
12
12
|
goto(options?: NavigateOptions): Promise<void>;
|
|
13
|
+
setPanelTitle(title: string): Promise<void>;
|
|
13
14
|
setVisualization(visualization: Visualization): Promise<void>;
|
|
15
|
+
getVisualizationName(): Locator;
|
|
14
16
|
apply(): Promise<void>;
|
|
15
17
|
getQueryEditorRow(refId: string): Promise<Locator>;
|
|
16
18
|
getPanelError(): Locator;
|
|
@@ -51,11 +51,28 @@ class PanelEditPage extends GrafanaPage_1.GrafanaPage {
|
|
|
51
51
|
options.queryParams.append('editPanel', this.args.id);
|
|
52
52
|
await super.navigate(url, options);
|
|
53
53
|
}
|
|
54
|
+
async setPanelTitle(title) {
|
|
55
|
+
const { OptionsGroup } = this.ctx.selectors.components;
|
|
56
|
+
//TODO: add new selector and use it in grafana/ui
|
|
57
|
+
const vizInput = await this.getByTestIdOrAriaLabel(OptionsGroup.group(OptionsGroup.groupTitle))
|
|
58
|
+
.locator('input')
|
|
59
|
+
.first();
|
|
60
|
+
const isVisible = await vizInput.isVisible();
|
|
61
|
+
if (!isVisible) {
|
|
62
|
+
// expand panel options if not visible
|
|
63
|
+
//TODO: add new selector and use it in grafana/ui
|
|
64
|
+
await this.getByTestIdOrAriaLabel(OptionsGroup.group(OptionsGroup.groupTitle)).locator('button').click();
|
|
65
|
+
}
|
|
66
|
+
await vizInput.fill(title);
|
|
67
|
+
}
|
|
54
68
|
async setVisualization(visualization) {
|
|
55
69
|
await this.getByTestIdOrAriaLabel(this.ctx.selectors.components.PanelEditor.toggleVizPicker).click();
|
|
56
70
|
await this.getByTestIdOrAriaLabel(this.ctx.selectors.components.PluginVisualization.item(visualization)).click();
|
|
57
71
|
await (0, test_1.expect)(this.getByTestIdOrAriaLabel(this.ctx.selectors.components.PanelEditor.toggleVizPicker), `Could not set visualization to ${visualization}. Ensure the panel is installed.`).toHaveText(visualization);
|
|
58
72
|
}
|
|
73
|
+
getVisualizationName() {
|
|
74
|
+
return this.getByTestIdOrAriaLabel(this.ctx.selectors.components.PanelEditor.toggleVizPicker);
|
|
75
|
+
}
|
|
59
76
|
async apply() {
|
|
60
77
|
await this.ctx.page.getByTestId(this.ctx.selectors.components.PanelEditor.applyButton).click();
|
|
61
78
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/plugin-e2e",
|
|
3
|
-
"version": "0.2.0",
|
|
3
|
+
"version": "0.2.1-canary.616.2fc2cca.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"semver": "^7.5.4",
|
|
45
45
|
"uuid": "^9.0.1"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "2fc2cca3377dbdfcdfc1ac0c247cb5e06e1460e1"
|
|
48
48
|
}
|