@grafana/plugin-e2e 1.15.0 → 1.16.0-canary.1462.03160e8.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.
|
@@ -11,6 +11,9 @@ export declare class PanelEditOptionsGroup {
|
|
|
11
11
|
readonly element: Locator;
|
|
12
12
|
private groupLabel;
|
|
13
13
|
constructor(ctx: PluginTestCtx, element: Locator, groupLabel: string);
|
|
14
|
+
isExpanded(): Promise<boolean>;
|
|
15
|
+
collapse(): Promise<void>;
|
|
16
|
+
expand(): Promise<void>;
|
|
14
17
|
getRadioGroup(label: string): RadioGroup;
|
|
15
18
|
getSwitch(label: string): Switch;
|
|
16
19
|
getTextInput(label: string): Locator;
|
|
@@ -21,4 +24,5 @@ export declare class PanelEditOptionsGroup {
|
|
|
21
24
|
getColorPicker(label: string): ColorPicker;
|
|
22
25
|
getUnitPicker(label: string): UnitPicker;
|
|
23
26
|
private getByLabel;
|
|
27
|
+
private getOptionsGroupToggle;
|
|
24
28
|
}
|
|
@@ -8,6 +8,7 @@ const MultiSelect_1 = require("./MultiSelect");
|
|
|
8
8
|
const Switch_1 = require("./Switch");
|
|
9
9
|
const semver_1 = require("semver");
|
|
10
10
|
const RadioGroup_1 = require("./RadioGroup");
|
|
11
|
+
const utils_1 = require("../utils");
|
|
11
12
|
class PanelEditOptionsGroup {
|
|
12
13
|
ctx;
|
|
13
14
|
element;
|
|
@@ -17,6 +18,24 @@ class PanelEditOptionsGroup {
|
|
|
17
18
|
this.element = element;
|
|
18
19
|
this.groupLabel = groupLabel;
|
|
19
20
|
}
|
|
21
|
+
async isExpanded() {
|
|
22
|
+
const expanded = await this.getOptionsGroupToggle().getAttribute('aria-expanded');
|
|
23
|
+
return expanded === 'true';
|
|
24
|
+
}
|
|
25
|
+
async collapse() {
|
|
26
|
+
const expanded = await this.isExpanded();
|
|
27
|
+
if (!expanded) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
await this.getOptionsGroupToggle().click();
|
|
31
|
+
}
|
|
32
|
+
async expand() {
|
|
33
|
+
const expanded = await this.isExpanded();
|
|
34
|
+
if (expanded) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
await this.getOptionsGroupToggle().click();
|
|
38
|
+
}
|
|
20
39
|
getRadioGroup(label) {
|
|
21
40
|
if ((0, semver_1.gte)(this.ctx.grafanaVersion, '10.2.0')) {
|
|
22
41
|
return new RadioGroup_1.RadioGroup(this.ctx, this.getByLabel(label).getByRole('radiogroup'));
|
|
@@ -53,5 +72,12 @@ class PanelEditOptionsGroup {
|
|
|
53
72
|
getByLabel(optionLabel) {
|
|
54
73
|
return this.element.getByLabel(`${this.groupLabel} ${optionLabel} field property editor`);
|
|
55
74
|
}
|
|
75
|
+
getOptionsGroupToggle() {
|
|
76
|
+
const selector = (0, utils_1.resolveGrafanaSelector)(this.ctx.selectors.components.OptionsGroup.toggle(this.groupLabel));
|
|
77
|
+
if ((0, semver_1.gte)(this.ctx.grafanaVersion, '10.0.0')) {
|
|
78
|
+
return this.element.locator(selector);
|
|
79
|
+
}
|
|
80
|
+
return this.element.locator(selector).getByRole('button');
|
|
81
|
+
}
|
|
56
82
|
}
|
|
57
83
|
exports.PanelEditOptionsGroup = PanelEditOptionsGroup;
|
|
@@ -30,6 +30,7 @@ export declare class PanelEditPage extends GrafanaPage {
|
|
|
30
30
|
setVisualization(visualization: Visualization | string): Promise<void>;
|
|
31
31
|
/**
|
|
32
32
|
* Expands the section for the given category name. If the section is already expanded, this method does nothing.
|
|
33
|
+
* @deprecated use {@link PanelEditOptionsGroup.expand} method instead.
|
|
33
34
|
*/
|
|
34
35
|
collapseSection(categoryName: string): Promise<void>;
|
|
35
36
|
/**
|
|
@@ -66,6 +67,7 @@ export declare class PanelEditPage extends GrafanaPage {
|
|
|
66
67
|
refreshPanel(options?: RequestOptions): Promise<Response>;
|
|
67
68
|
/** Return page object for the panel edit options group with the given label */
|
|
68
69
|
getCustomOptions(label: string): PanelEditOptionsGroup;
|
|
70
|
+
getPanelOptions(): PanelEditOptionsGroup;
|
|
69
71
|
getStandardOptions(): PanelEditOptionsGroup;
|
|
70
72
|
getValueMappingOptions(): PanelEditOptionsGroup;
|
|
71
73
|
getDataLinksOptions(): PanelEditOptionsGroup;
|
|
@@ -111,6 +111,7 @@ class PanelEditPage extends GrafanaPage_1.GrafanaPage {
|
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* Expands the section for the given category name. If the section is already expanded, this method does nothing.
|
|
114
|
+
* @deprecated use {@link PanelEditOptionsGroup.expand} method instead.
|
|
114
115
|
*/
|
|
115
116
|
async collapseSection(categoryName) {
|
|
116
117
|
const section = this.getByGrafanaSelector(this.ctx.selectors.components.OptionsGroup.group(categoryName));
|
|
@@ -183,6 +184,9 @@ class PanelEditPage extends GrafanaPage_1.GrafanaPage {
|
|
|
183
184
|
const locator = this.getOptionsGroupLocator(label);
|
|
184
185
|
return new PanelEditOptionsGroup_1.PanelEditOptionsGroup(this.ctx, locator, label);
|
|
185
186
|
}
|
|
187
|
+
getPanelOptions() {
|
|
188
|
+
return this.getCustomOptions('Panel options');
|
|
189
|
+
}
|
|
186
190
|
getStandardOptions() {
|
|
187
191
|
return this.getCustomOptions('Standard options');
|
|
188
192
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/plugin-e2e",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0-canary.1462.03160e8.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"start": "cls || clear"
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "03160e86e62ce968efccbcbdbe0e2a124f8e86de"
|
|
61
61
|
}
|