@grafana/plugin-e2e 3.9.0-canary.2621.26565643518.0 → 3.9.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.
- package/dist/index.d.ts +49 -69
- package/dist/index.js +0 -12
- package/dist/models/Components.js +0 -18
- package/dist/models/components/ColorPicker.js +0 -9
- package/dist/models/components/MultiSelect.js +0 -12
- package/dist/models/components/RadioGroup.js +0 -14
- package/dist/models/components/Select.js +0 -11
- package/dist/models/components/Switch.js +0 -14
- package/dist/models/components/UnitPicker.js +0 -12
- package/package.json +4 -3
package/dist/index.d.ts
CHANGED
|
@@ -171,58 +171,6 @@ declare class AppPage extends GrafanaPage {
|
|
|
171
171
|
goto(options?: AppPageNavigateOptions): Promise<void>;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
type LocatorParams = Parameters<Locator['locator']>;
|
|
175
|
-
declare abstract class ComponentBase {
|
|
176
|
-
readonly ctx: PluginTestCtx;
|
|
177
|
-
protected readonly element: Locator;
|
|
178
|
-
constructor(ctx: PluginTestCtx, element: Locator);
|
|
179
|
-
locator(selectorOrLocator?: LocatorParams[0], options?: LocatorParams[1]): Locator;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
type SelectOptionsType = Parameters<Locator['selectOption']>[1];
|
|
183
|
-
type CheckOptionsType = Parameters<Locator['check']>[0];
|
|
184
|
-
|
|
185
|
-
declare class ColorPicker extends ComponentBase {
|
|
186
|
-
constructor(ctx: PluginTestCtx, element: Locator);
|
|
187
|
-
static getContainer(ctx: PluginTestCtx, root?: Locator): Locator;
|
|
188
|
-
within(root: Locator): ColorPicker;
|
|
189
|
-
selectOption(rgbOrHex: string, options?: SelectOptionsType): Promise<void>;
|
|
190
|
-
private getCustomTab;
|
|
191
|
-
private getContainer;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
declare class MultiSelect extends ComponentBase {
|
|
195
|
-
constructor(ctx: PluginTestCtx, element: Locator);
|
|
196
|
-
static getContainer(ctx: PluginTestCtx, root?: Locator): Locator;
|
|
197
|
-
within(root: Locator): MultiSelect;
|
|
198
|
-
selectOptions(values: string[], options?: SelectOptionsType): Promise<string[]>;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
declare class RadioGroup extends ComponentBase {
|
|
202
|
-
constructor(ctx: PluginTestCtx, element: Locator);
|
|
203
|
-
static getContainer(ctx: PluginTestCtx, root?: Locator): Locator;
|
|
204
|
-
within(root: Locator): RadioGroup;
|
|
205
|
-
check(labelOrValue: string, options?: CheckOptionsType): Promise<void>;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
declare class Select extends ComponentBase {
|
|
209
|
-
constructor(ctx: PluginTestCtx, element: Locator);
|
|
210
|
-
static getContainer(ctx: PluginTestCtx, root?: Locator): Locator;
|
|
211
|
-
within(root: Locator): Select;
|
|
212
|
-
selectOption(values: string, options?: SelectOptionsType): Promise<string>;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
declare class Switch extends ComponentBase {
|
|
216
|
-
private group;
|
|
217
|
-
constructor(ctx: PluginTestCtx, group: Locator);
|
|
218
|
-
static getContainer(ctx: PluginTestCtx, root?: Locator): Locator;
|
|
219
|
-
within(root: Locator): Switch;
|
|
220
|
-
private static getElement;
|
|
221
|
-
check(options?: CheckOptionsType): Promise<void>;
|
|
222
|
-
uncheck(options?: CheckOptionsType): Promise<void>;
|
|
223
|
-
private getSwitch;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
174
|
declare class TimeRange extends ScopedComponent {
|
|
227
175
|
/**
|
|
228
176
|
* Opens the time picker and sets the time range to the provided values
|
|
@@ -230,14 +178,6 @@ declare class TimeRange extends ScopedComponent {
|
|
|
230
178
|
set({ from, to, zone }: TimeRangeArgs): Promise<void>;
|
|
231
179
|
}
|
|
232
180
|
|
|
233
|
-
declare class UnitPicker extends ComponentBase {
|
|
234
|
-
constructor(ctx: PluginTestCtx, element: Locator);
|
|
235
|
-
static getContainer(ctx: PluginTestCtx, root?: Locator): Locator;
|
|
236
|
-
within(root: Locator): UnitPicker;
|
|
237
|
-
selectOption(value: string, options?: SelectOptionsType): Promise<void>;
|
|
238
|
-
private getOption;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
181
|
/**
|
|
242
182
|
* Factory for components that are not attached to a specific page.
|
|
243
183
|
*
|
|
@@ -251,19 +191,11 @@ declare class UnitPicker extends ComponentBase {
|
|
|
251
191
|
* ```typescript
|
|
252
192
|
* await components.dataSourcePicker.set('prom');
|
|
253
193
|
* await components.dataSourcePicker.within(panel).set('prom');
|
|
254
|
-
* await components.select.within(fieldLabel).selectOption('Europe/Stockholm');
|
|
255
|
-
* await components.switch.within(fieldLabel).check();
|
|
256
194
|
* ```
|
|
257
195
|
*/
|
|
258
196
|
declare class Components {
|
|
259
197
|
readonly dataSourcePicker: DataSourcePicker;
|
|
260
198
|
readonly timeRangePicker: TimeRange;
|
|
261
|
-
readonly select: Select;
|
|
262
|
-
readonly multiSelect: MultiSelect;
|
|
263
|
-
readonly switch: Switch;
|
|
264
|
-
readonly radioGroup: RadioGroup;
|
|
265
|
-
readonly unitPicker: UnitPicker;
|
|
266
|
-
readonly colorPicker: ColorPicker;
|
|
267
199
|
constructor(ctx: PluginTestCtx);
|
|
268
200
|
}
|
|
269
201
|
|
|
@@ -309,6 +241,54 @@ declare class Panel extends GrafanaPage {
|
|
|
309
241
|
getErrorIcon(): Locator;
|
|
310
242
|
}
|
|
311
243
|
|
|
244
|
+
type LocatorParams = Parameters<Locator['locator']>;
|
|
245
|
+
declare abstract class ComponentBase {
|
|
246
|
+
readonly ctx: PluginTestCtx;
|
|
247
|
+
protected readonly element: Locator;
|
|
248
|
+
constructor(ctx: PluginTestCtx, element: Locator);
|
|
249
|
+
locator(selectorOrLocator?: LocatorParams[0], options?: LocatorParams[1]): Locator;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
type SelectOptionsType = Parameters<Locator['selectOption']>[1];
|
|
253
|
+
type CheckOptionsType = Parameters<Locator['check']>[0];
|
|
254
|
+
|
|
255
|
+
declare class ColorPicker extends ComponentBase {
|
|
256
|
+
constructor(ctx: PluginTestCtx, element: Locator);
|
|
257
|
+
selectOption(rgbOrHex: string, options?: SelectOptionsType): Promise<void>;
|
|
258
|
+
private getCustomTab;
|
|
259
|
+
private getContainer;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
declare class UnitPicker extends ComponentBase {
|
|
263
|
+
constructor(ctx: PluginTestCtx, element: Locator);
|
|
264
|
+
selectOption(value: string, options?: SelectOptionsType): Promise<void>;
|
|
265
|
+
private getOption;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
declare class Select extends ComponentBase {
|
|
269
|
+
constructor(ctx: PluginTestCtx, element: Locator);
|
|
270
|
+
selectOption(values: string, options?: SelectOptionsType): Promise<string>;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
declare class MultiSelect extends ComponentBase {
|
|
274
|
+
constructor(ctx: PluginTestCtx, element: Locator);
|
|
275
|
+
selectOptions(values: string[], options?: SelectOptionsType): Promise<string[]>;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
declare class Switch extends ComponentBase {
|
|
279
|
+
private group;
|
|
280
|
+
constructor(ctx: PluginTestCtx, group: Locator);
|
|
281
|
+
private static getElement;
|
|
282
|
+
check(options?: CheckOptionsType): Promise<void>;
|
|
283
|
+
uncheck(options?: CheckOptionsType): Promise<void>;
|
|
284
|
+
private getSwitch;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
declare class RadioGroup extends ComponentBase {
|
|
288
|
+
constructor(ctx: PluginTestCtx, element: Locator);
|
|
289
|
+
check(labelOrValue: string, options?: CheckOptionsType): Promise<void>;
|
|
290
|
+
}
|
|
291
|
+
|
|
312
292
|
declare class PanelEditOptionsGroup {
|
|
313
293
|
private ctx;
|
|
314
294
|
readonly element: Locator;
|
|
@@ -1581,5 +1561,5 @@ declare global {
|
|
|
1581
1561
|
}
|
|
1582
1562
|
}
|
|
1583
1563
|
|
|
1584
|
-
export { AnnotationEditPage, AnnotationPage, AppConfigPage, AppPage,
|
|
1564
|
+
export { AnnotationEditPage, AnnotationPage, AppConfigPage, AppPage, Components, DEFAULT_A11Y_TAGS, DashboardPage, DataSourceConfigPage, DataSourcePicker, ExplorePage, GrafanaPage, Panel, PanelEditPage, PluginConfigPage, ScopedComponent, TimeRange, VariableEditPage, VariablePage, expect, isFeatureEnabled, isLegacyFeatureEnabled, test };
|
|
1585
1565
|
export type { A11yViolationsOptions, AlertPageOptions, AlertRule, AlertRuleArgs, AlertVariant$1 as AlertVariant, AppPageNavigateOptions, AxeScanContext, ContainTextOptions, CreateDataSourceArgs, CreateDataSourcePageArgs, Credentials, Dashboard, DashboardEditViewArgs, DashboardPageArgs, DataSourceSettings, E2ESelectorGroups, FeatureFlagValue, GotoAppConfigPageArgs, GotoAppPageArgs, GrafanaPageArgs, InternalFixtures, NavigateOptions, OrgRole, PlaywrightArgs, PluginFixture, PluginOptions, PluginPageArgs, PluginTestCtx, ReadProvisionedAlertRuleArgs, ReadProvisionedDashboardArgs, ReadProvisionedDataSourceArgs, RequestOptions, TimeRangeArgs, TriggerRequestOptions, User, UserPreferences, Visualization, getByGrafanaSelectorOptions };
|
package/dist/index.js
CHANGED
|
@@ -45,16 +45,10 @@ var toHaveChecked = require('./matchers/toHaveChecked.js');
|
|
|
45
45
|
var toHaveColor = require('./matchers/toHaveColor.js');
|
|
46
46
|
var toHavePanelErrors = require('./matchers/toHavePanelErrors.js');
|
|
47
47
|
var Components = require('./models/Components.js');
|
|
48
|
-
var ColorPicker = require('./models/components/ColorPicker.js');
|
|
49
48
|
var DataSourcePicker = require('./models/components/DataSourcePicker.js');
|
|
50
|
-
var MultiSelect = require('./models/components/MultiSelect.js');
|
|
51
|
-
var RadioGroup = require('./models/components/RadioGroup.js');
|
|
52
49
|
var ScopedComponent = require('./models/components/ScopedComponent.js');
|
|
53
|
-
var Select = require('./models/components/Select.js');
|
|
54
|
-
var Switch = require('./models/components/Switch.js');
|
|
55
50
|
var Panel = require('./models/components/Panel.js');
|
|
56
51
|
var TimeRange = require('./models/components/TimeRange.js');
|
|
57
|
-
var UnitPicker = require('./models/components/UnitPicker.js');
|
|
58
52
|
var AnnotationEditPage = require('./models/pages/AnnotationEditPage.js');
|
|
59
53
|
var AnnotationPage = require('./models/pages/AnnotationPage.js');
|
|
60
54
|
var DashboardPage = require('./models/pages/DashboardPage.js');
|
|
@@ -127,16 +121,10 @@ exports.isFeatureEnabled = isFeatureToggleEnabled.isFeatureEnabled;
|
|
|
127
121
|
exports.isLegacyFeatureEnabled = isFeatureToggleEnabled.isLegacyFeatureEnabled;
|
|
128
122
|
exports.DEFAULT_A11Y_TAGS = scanForA11yViolations.DEFAULT_A11Y_TAGS;
|
|
129
123
|
exports.Components = Components.Components;
|
|
130
|
-
exports.ColorPicker = ColorPicker.ColorPicker;
|
|
131
124
|
exports.DataSourcePicker = DataSourcePicker.DataSourcePicker;
|
|
132
|
-
exports.MultiSelect = MultiSelect.MultiSelect;
|
|
133
|
-
exports.RadioGroup = RadioGroup.RadioGroup;
|
|
134
125
|
exports.ScopedComponent = ScopedComponent.ScopedComponent;
|
|
135
|
-
exports.Select = Select.Select;
|
|
136
|
-
exports.Switch = Switch.Switch;
|
|
137
126
|
exports.Panel = Panel.Panel;
|
|
138
127
|
exports.TimeRange = TimeRange.TimeRange;
|
|
139
|
-
exports.UnitPicker = UnitPicker.UnitPicker;
|
|
140
128
|
exports.AnnotationEditPage = AnnotationEditPage.AnnotationEditPage;
|
|
141
129
|
exports.AnnotationPage = AnnotationPage.AnnotationPage;
|
|
142
130
|
exports.DashboardPage = DashboardPage.DashboardPage;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var ColorPicker = require('./components/ColorPicker.js');
|
|
4
3
|
var DataSourcePicker = require('./components/DataSourcePicker.js');
|
|
5
|
-
var MultiSelect = require('./components/MultiSelect.js');
|
|
6
|
-
var RadioGroup = require('./components/RadioGroup.js');
|
|
7
|
-
var Select = require('./components/Select.js');
|
|
8
|
-
var Switch = require('./components/Switch.js');
|
|
9
4
|
var TimeRange = require('./components/TimeRange.js');
|
|
10
|
-
var UnitPicker = require('./components/UnitPicker.js');
|
|
11
5
|
|
|
12
6
|
var __defProp = Object.defineProperty;
|
|
13
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -16,20 +10,8 @@ class Components {
|
|
|
16
10
|
constructor(ctx) {
|
|
17
11
|
__publicField(this, "dataSourcePicker");
|
|
18
12
|
__publicField(this, "timeRangePicker");
|
|
19
|
-
__publicField(this, "select");
|
|
20
|
-
__publicField(this, "multiSelect");
|
|
21
|
-
__publicField(this, "switch");
|
|
22
|
-
__publicField(this, "radioGroup");
|
|
23
|
-
__publicField(this, "unitPicker");
|
|
24
|
-
__publicField(this, "colorPicker");
|
|
25
13
|
this.dataSourcePicker = new DataSourcePicker.DataSourcePicker(ctx);
|
|
26
14
|
this.timeRangePicker = new TimeRange.TimeRange(ctx);
|
|
27
|
-
this.select = new Select.Select(ctx, Select.Select.getContainer(ctx));
|
|
28
|
-
this.multiSelect = new MultiSelect.MultiSelect(ctx, MultiSelect.MultiSelect.getContainer(ctx));
|
|
29
|
-
this.switch = new Switch.Switch(ctx, Switch.Switch.getContainer(ctx));
|
|
30
|
-
this.radioGroup = new RadioGroup.RadioGroup(ctx, RadioGroup.RadioGroup.getContainer(ctx));
|
|
31
|
-
this.unitPicker = new UnitPicker.UnitPicker(ctx, UnitPicker.UnitPicker.getContainer(ctx));
|
|
32
|
-
this.colorPicker = new ColorPicker.ColorPicker(ctx, ColorPicker.ColorPicker.getContainer(ctx));
|
|
33
15
|
}
|
|
34
16
|
}
|
|
35
17
|
|
|
@@ -8,15 +8,6 @@ class ColorPicker extends ComponentBase.ComponentBase {
|
|
|
8
8
|
constructor(ctx, element) {
|
|
9
9
|
super(ctx, element);
|
|
10
10
|
}
|
|
11
|
-
static getContainer(ctx, root) {
|
|
12
|
-
if (root) {
|
|
13
|
-
return root;
|
|
14
|
-
}
|
|
15
|
-
return ctx.page.locator('[data-testid*="colorswatch"]').locator("xpath=..").first();
|
|
16
|
-
}
|
|
17
|
-
within(root) {
|
|
18
|
-
return new ColorPicker(this.ctx, root);
|
|
19
|
-
}
|
|
20
11
|
async selectOption(rgbOrHex, options) {
|
|
21
12
|
await this.element.getByRole("button").click(options);
|
|
22
13
|
await this.getCustomTab().click(options);
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var semver = require('semver');
|
|
4
3
|
var Select = require('./Select.js');
|
|
5
4
|
var ComponentBase = require('./ComponentBase.js');
|
|
6
|
-
var utils = require('../utils.js');
|
|
7
5
|
|
|
8
6
|
class MultiSelect extends ComponentBase.ComponentBase {
|
|
9
7
|
constructor(ctx, element) {
|
|
10
8
|
super(ctx, element);
|
|
11
9
|
}
|
|
12
|
-
static getContainer(ctx, root) {
|
|
13
|
-
const base = root ?? ctx.page;
|
|
14
|
-
if (semver.gte(ctx.grafanaVersion, "13.1.0")) {
|
|
15
|
-
return base.locator(utils.resolveGrafanaSelector(ctx.selectors.components.MultiSelect.container)).locator("xpath=..").first();
|
|
16
|
-
}
|
|
17
|
-
return base.locator('[class*="-grafana-select-value-container-multi"]').locator("xpath=..").first();
|
|
18
|
-
}
|
|
19
|
-
within(root) {
|
|
20
|
-
return new MultiSelect(this.ctx, MultiSelect.getContainer(this.ctx, root));
|
|
21
|
-
}
|
|
22
10
|
async selectOptions(values, options) {
|
|
23
11
|
const menu = await Select.openSelect(this, options);
|
|
24
12
|
const selected = [];
|
|
@@ -2,25 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
var ComponentBase = require('./ComponentBase.js');
|
|
4
4
|
var semver = require('semver');
|
|
5
|
-
var utils = require('../utils.js');
|
|
6
5
|
|
|
7
6
|
class RadioGroup extends ComponentBase.ComponentBase {
|
|
8
7
|
constructor(ctx, element) {
|
|
9
8
|
super(ctx, element);
|
|
10
9
|
}
|
|
11
|
-
static getContainer(ctx, root) {
|
|
12
|
-
const base = root ?? ctx.page;
|
|
13
|
-
if (semver.gte(ctx.grafanaVersion, "13.1.0")) {
|
|
14
|
-
return base.locator(utils.resolveGrafanaSelector(ctx.selectors.components.RadioGroup.container)).first();
|
|
15
|
-
}
|
|
16
|
-
if (semver.gte(ctx.grafanaVersion, "10.0.0")) {
|
|
17
|
-
return base.locator('[role="radiogroup"]').first();
|
|
18
|
-
}
|
|
19
|
-
return base.locator('div:has(> input[type="radio"]), div:has(> div > input[type="radio"])').first();
|
|
20
|
-
}
|
|
21
|
-
within(root) {
|
|
22
|
-
return new RadioGroup(this.ctx, RadioGroup.getContainer(this.ctx, root));
|
|
23
|
-
}
|
|
24
10
|
async check(labelOrValue, options) {
|
|
25
11
|
if (semver.gte(this.ctx.grafanaVersion, "10.2.0")) {
|
|
26
12
|
return this.element.getByLabel(labelOrValue, { exact: true }).check(options);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var semver = require('semver');
|
|
4
3
|
var ComponentBase = require('./ComponentBase.js');
|
|
5
4
|
var utils = require('../utils.js');
|
|
6
5
|
|
|
@@ -8,16 +7,6 @@ class Select extends ComponentBase.ComponentBase {
|
|
|
8
7
|
constructor(ctx, element) {
|
|
9
8
|
super(ctx, element);
|
|
10
9
|
}
|
|
11
|
-
static getContainer(ctx, root) {
|
|
12
|
-
const base = root ?? ctx.page;
|
|
13
|
-
if (semver.gte(ctx.grafanaVersion, "13.1.0")) {
|
|
14
|
-
return base.locator(utils.resolveGrafanaSelector(ctx.selectors.components.Select.container)).locator("xpath=..").first();
|
|
15
|
-
}
|
|
16
|
-
return base.locator('[class*="-grafana-select-value-container"]:not([class*="-grafana-select-value-container-multi"])').locator("xpath=..").first();
|
|
17
|
-
}
|
|
18
|
-
within(root) {
|
|
19
|
-
return new Select(this.ctx, Select.getContainer(this.ctx, root));
|
|
20
|
-
}
|
|
21
10
|
async selectOption(values, options) {
|
|
22
11
|
const menu = await openSelect(this, options);
|
|
23
12
|
await this.locator().page().keyboard.type(values);
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var ComponentBase = require('./ComponentBase.js');
|
|
4
4
|
var semver = require('semver');
|
|
5
|
-
var utils = require('../utils.js');
|
|
6
5
|
|
|
7
6
|
var __defProp = Object.defineProperty;
|
|
8
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -13,19 +12,6 @@ class Switch extends ComponentBase.ComponentBase {
|
|
|
13
12
|
__publicField(this, "group");
|
|
14
13
|
this.group = group;
|
|
15
14
|
}
|
|
16
|
-
static getContainer(ctx, root) {
|
|
17
|
-
const base = root ?? ctx.page;
|
|
18
|
-
if (semver.gte(ctx.grafanaVersion, "13.1.0")) {
|
|
19
|
-
return base.locator(utils.resolveGrafanaSelector(ctx.selectors.components.Switch.container)).first();
|
|
20
|
-
}
|
|
21
|
-
if (semver.gte(ctx.grafanaVersion, "12.0.0")) {
|
|
22
|
-
return base.locator('div:has(> input[type="checkbox"][role="switch"])').first();
|
|
23
|
-
}
|
|
24
|
-
return base.locator('div:has(> input[type="checkbox"] + label)').first();
|
|
25
|
-
}
|
|
26
|
-
within(root) {
|
|
27
|
-
return new Switch(this.ctx, Switch.getContainer(this.ctx, root));
|
|
28
|
-
}
|
|
29
15
|
static getElement(ctx, group) {
|
|
30
16
|
if (semver.gte(ctx.grafanaVersion, "11.5.0")) {
|
|
31
17
|
return group.getByRole("switch");
|
|
@@ -1,23 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var semver = require('semver');
|
|
4
3
|
var ComponentBase = require('./ComponentBase.js');
|
|
5
|
-
var utils = require('../utils.js');
|
|
6
4
|
|
|
7
5
|
class UnitPicker extends ComponentBase.ComponentBase {
|
|
8
6
|
constructor(ctx, element) {
|
|
9
7
|
super(ctx, element);
|
|
10
8
|
}
|
|
11
|
-
static getContainer(ctx, root) {
|
|
12
|
-
const base = root ?? ctx.page;
|
|
13
|
-
if (semver.gte(ctx.grafanaVersion, "13.1.0")) {
|
|
14
|
-
return base.locator(utils.resolveGrafanaSelector(ctx.selectors.components.UnitPicker.container)).first();
|
|
15
|
-
}
|
|
16
|
-
return base.locator('div:has(> div > [data-testid="input-wrapper"] input[placeholder="Choose"])').first();
|
|
17
|
-
}
|
|
18
|
-
within(root) {
|
|
19
|
-
return new UnitPicker(this.ctx, UnitPicker.getContainer(this.ctx, root));
|
|
20
|
-
}
|
|
21
9
|
async selectOption(value, options) {
|
|
22
10
|
await this.element.getByRole("textbox").click();
|
|
23
11
|
const option = await this.getOption(value, options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/plugin-e2e",
|
|
3
|
-
"version": "3.9.0
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"./package.json"
|
|
9
9
|
],
|
|
10
10
|
"repository": {
|
|
11
|
+
"type": "git",
|
|
11
12
|
"directory": "packages/plugin-e2e",
|
|
12
13
|
"url": "https://github.com/grafana/plugin-tools"
|
|
13
14
|
},
|
|
@@ -49,10 +50,10 @@
|
|
|
49
50
|
"dotenv": "^17.2.4"
|
|
50
51
|
},
|
|
51
52
|
"dependencies": {
|
|
52
|
-
"@grafana/e2e-selectors": "13.1.0-
|
|
53
|
+
"@grafana/e2e-selectors": "13.1.0-25644485979",
|
|
53
54
|
"semver": "^7.5.4",
|
|
54
55
|
"uuid": "^13.0.0",
|
|
55
56
|
"yaml": "^2.3.4"
|
|
56
57
|
},
|
|
57
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "57e7611bcbbd068694bda70df57fa86008dd3353"
|
|
58
59
|
}
|