@grafana/plugin-e2e 0.12.0-canary.688.f60db74.0 → 0.12.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/models/DashboardPage.js +0 -27
- package/dist/models/Panel.js +0 -18
- package/dist/models/PanelEditPage.js +0 -9
- package/package.json +2 -2
- package/dist/models/utils.js +0 -12
|
@@ -6,7 +6,6 @@ const DataSourcePicker_1 = require("./DataSourcePicker");
|
|
|
6
6
|
const GrafanaPage_1 = require("./GrafanaPage");
|
|
7
7
|
const PanelEditPage_1 = require("./PanelEditPage");
|
|
8
8
|
const TimeRange_1 = require("./TimeRange");
|
|
9
|
-
const Panel_1 = require("./Panel");
|
|
10
9
|
class DashboardPage extends GrafanaPage_1.GrafanaPage {
|
|
11
10
|
ctx;
|
|
12
11
|
dashboard;
|
|
@@ -43,32 +42,6 @@ class DashboardPage extends GrafanaPage_1.GrafanaPage {
|
|
|
43
42
|
await panelEditPage.goto();
|
|
44
43
|
return panelEditPage;
|
|
45
44
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Returns a Panel object for the panel with the given title. Only works for panels that currently are in the viewport.
|
|
48
|
-
*
|
|
49
|
-
* Note that this won't navigate to the panel edit page, it will only return the Panel object, which
|
|
50
|
-
* points to the locator for the panel in the dashboard page. Can be used to assert on the panel data, eg.
|
|
51
|
-
* const panel = await dashboardPage.getPanelByTitle('Table panel');
|
|
52
|
-
* await expect(panel.getFieldNames()).toContainText(['time', 'temperature']);
|
|
53
|
-
*/
|
|
54
|
-
getPanelByTitle(title) {
|
|
55
|
-
return new Panel_1.Panel(this.ctx, () => {
|
|
56
|
-
return this.getByTestIdOrAriaLabel(this.ctx.selectors.components.Panels.Panel.title(title));
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Returns a Panel object for the panel with the given id. Only works for panels that currently are in the viewport.
|
|
61
|
-
*
|
|
62
|
-
* Note that this won't navigate to the panel edit page, it will only return the Panel object, which
|
|
63
|
-
* points to the locator for the panel in the dashboard page. Can be used to assert on the panel data, eg.
|
|
64
|
-
* const panel = await dashboardPage.getPanelByTitle('2');
|
|
65
|
-
* await expect(panel.getFieldNames()).toContainText(['time', 'temperature']);
|
|
66
|
-
*/
|
|
67
|
-
getPanelById(panelId) {
|
|
68
|
-
return new Panel_1.Panel(this.ctx, () => {
|
|
69
|
-
return this.ctx.page.locator(`[data-panelid="${panelId}"]`);
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
45
|
/**
|
|
73
46
|
* Clicks the buttons to add a new panel and returns the panel edit page for the new panel
|
|
74
47
|
*/
|
package/dist/models/Panel.js
CHANGED
|
@@ -35,24 +35,6 @@ class Panel extends GrafanaPage_1.GrafanaPage {
|
|
|
35
35
|
this.ctx = ctx;
|
|
36
36
|
this.locator = locator;
|
|
37
37
|
}
|
|
38
|
-
/**
|
|
39
|
-
* Returns a locator that resolves element(s) that contain the field name(s) that are currently displayed in the panel.
|
|
40
|
-
*
|
|
41
|
-
* Can be used to assert the field names displayed in the panel visualization. e.g
|
|
42
|
-
* await expect(panelEditPage.panel.getFieldNames()).toHaveValues(['Month', 'Stockholm', 'Berlin', 'Log Angeles']);
|
|
43
|
-
*/
|
|
44
|
-
getFieldNames() {
|
|
45
|
-
return this.locator().locator('[role="columnheader"]');
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Returns a locator that resolves element(s) that contain the value(s) that are currently displayed in the panel.
|
|
49
|
-
*
|
|
50
|
-
* Can be used to assert the values displayed in the panel visualization. e.g
|
|
51
|
-
* await expect(panelEditPage.panel.getData()).toContainText(['1', '4', '14']);
|
|
52
|
-
*/
|
|
53
|
-
getData() {
|
|
54
|
-
return this.locator().locator('[role="cell"]');
|
|
55
|
-
}
|
|
56
38
|
/**
|
|
57
39
|
* Returns the locator for the panel error (if any)
|
|
58
40
|
*/
|
|
@@ -6,7 +6,6 @@ const DataSourcePicker_1 = require("./DataSourcePicker");
|
|
|
6
6
|
const GrafanaPage_1 = require("./GrafanaPage");
|
|
7
7
|
const TimeRange_1 = require("./TimeRange");
|
|
8
8
|
const Panel_1 = require("./Panel");
|
|
9
|
-
const utils_1 = require("./utils");
|
|
10
9
|
class PanelEditPage extends GrafanaPage_1.GrafanaPage {
|
|
11
10
|
ctx;
|
|
12
11
|
args;
|
|
@@ -35,14 +34,6 @@ class PanelEditPage extends GrafanaPage_1.GrafanaPage {
|
|
|
35
34
|
options.queryParams.append('editPanel', this.args.id);
|
|
36
35
|
await super.navigate(url, options);
|
|
37
36
|
}
|
|
38
|
-
async toggleTableView() {
|
|
39
|
-
await (0, utils_1.radioButtonSetChecked)(this.ctx.page, 'Table view', true);
|
|
40
|
-
this.panel = new Panel_1.Panel(this.ctx, () => this.ctx.page.getByTestId('Panel'));
|
|
41
|
-
}
|
|
42
|
-
async untoggleTableView() {
|
|
43
|
-
await (0, utils_1.radioButtonSetChecked)(this.ctx.page, 'Table view', false);
|
|
44
|
-
this.panel = new Panel_1.Panel(this.ctx, () => this.getByTestIdOrAriaLabel(this.ctx.selectors.components.Panels.Panel.title(''), { startsWith: true }));
|
|
45
|
-
}
|
|
46
37
|
/**
|
|
47
38
|
* Sets the title of the panel. This method will open the panel options, set the title and close the panel options.
|
|
48
39
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/plugin-e2e",
|
|
3
|
-
"version": "0.12.0
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"semver": "^7.5.4",
|
|
46
46
|
"uuid": "^9.0.1"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "f6a7e4108b83a253156df57a42a5e9c55d73e4ed"
|
|
49
49
|
}
|
package/dist/models/utils.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.radioButtonSetChecked = void 0;
|
|
4
|
-
const radioButtonSetChecked = async (page, label, checked, options) => {
|
|
5
|
-
try {
|
|
6
|
-
await page.getByLabel(label, options).setChecked(checked);
|
|
7
|
-
}
|
|
8
|
-
catch (_) {
|
|
9
|
-
await page.getByText(label, options).setChecked(checked);
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
exports.radioButtonSetChecked = radioButtonSetChecked;
|