@grafana/plugin-e2e 1.15.0 → 1.16.0-canary.1462.6c19d63.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,8 @@ export declare class PanelEditOptionsGroup {
|
|
|
11
11
|
readonly element: Locator;
|
|
12
12
|
private groupLabel;
|
|
13
13
|
constructor(ctx: PluginTestCtx, element: Locator, groupLabel: string);
|
|
14
|
+
collapse(): Promise<void>;
|
|
15
|
+
expand(): Promise<void>;
|
|
14
16
|
getRadioGroup(label: string): RadioGroup;
|
|
15
17
|
getSwitch(label: string): Switch;
|
|
16
18
|
getTextInput(label: string): Locator;
|
|
@@ -21,4 +23,6 @@ export declare class PanelEditOptionsGroup {
|
|
|
21
23
|
getColorPicker(label: string): ColorPicker;
|
|
22
24
|
getUnitPicker(label: string): UnitPicker;
|
|
23
25
|
private getByLabel;
|
|
26
|
+
private isExpanded;
|
|
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,20 @@ class PanelEditOptionsGroup {
|
|
|
17
18
|
this.element = element;
|
|
18
19
|
this.groupLabel = groupLabel;
|
|
19
20
|
}
|
|
21
|
+
async collapse() {
|
|
22
|
+
const expanded = await this.isExpanded();
|
|
23
|
+
if (!expanded) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
await this.getOptionsGroupToggle().click();
|
|
27
|
+
}
|
|
28
|
+
async expand() {
|
|
29
|
+
const expanded = await this.isExpanded();
|
|
30
|
+
if (expanded) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
await this.getOptionsGroupToggle().click();
|
|
34
|
+
}
|
|
20
35
|
getRadioGroup(label) {
|
|
21
36
|
if ((0, semver_1.gte)(this.ctx.grafanaVersion, '10.2.0')) {
|
|
22
37
|
return new RadioGroup_1.RadioGroup(this.ctx, this.getByLabel(label).getByRole('radiogroup'));
|
|
@@ -53,5 +68,13 @@ class PanelEditOptionsGroup {
|
|
|
53
68
|
getByLabel(optionLabel) {
|
|
54
69
|
return this.element.getByLabel(`${this.groupLabel} ${optionLabel} field property editor`);
|
|
55
70
|
}
|
|
71
|
+
async isExpanded() {
|
|
72
|
+
const expanded = await this.getOptionsGroupToggle().getAttribute('aria-expanded');
|
|
73
|
+
return expanded === 'true';
|
|
74
|
+
}
|
|
75
|
+
getOptionsGroupToggle() {
|
|
76
|
+
const selector = (0, utils_1.resolveGrafanaSelector)(this.ctx.selectors.components.OptionsGroup.toggle(this.groupLabel));
|
|
77
|
+
return this.element.locator(selector);
|
|
78
|
+
}
|
|
56
79
|
}
|
|
57
80
|
exports.PanelEditOptionsGroup = PanelEditOptionsGroup;
|
|
@@ -66,6 +66,7 @@ export declare class PanelEditPage extends GrafanaPage {
|
|
|
66
66
|
refreshPanel(options?: RequestOptions): Promise<Response>;
|
|
67
67
|
/** Return page object for the panel edit options group with the given label */
|
|
68
68
|
getCustomOptions(label: string): PanelEditOptionsGroup;
|
|
69
|
+
getPanelOptions(): PanelEditOptionsGroup;
|
|
69
70
|
getStandardOptions(): PanelEditOptionsGroup;
|
|
70
71
|
getValueMappingOptions(): PanelEditOptionsGroup;
|
|
71
72
|
getDataLinksOptions(): PanelEditOptionsGroup;
|
|
@@ -183,6 +183,9 @@ class PanelEditPage extends GrafanaPage_1.GrafanaPage {
|
|
|
183
183
|
const locator = this.getOptionsGroupLocator(label);
|
|
184
184
|
return new PanelEditOptionsGroup_1.PanelEditOptionsGroup(this.ctx, locator, label);
|
|
185
185
|
}
|
|
186
|
+
getPanelOptions() {
|
|
187
|
+
return this.getCustomOptions('Panel options');
|
|
188
|
+
}
|
|
186
189
|
getStandardOptions() {
|
|
187
190
|
return this.getCustomOptions('Standard options');
|
|
188
191
|
}
|
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.6c19d63.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": "6c19d630b12ea01d738f4621d97041ffdc5d3bfd"
|
|
61
61
|
}
|