@grafana/plugin-e2e 0.10.2 → 0.10.3-canary.694.f97a4af.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/api.js +2 -1
- package/dist/fixtures/grafanaVersion.js +1 -1
- package/dist/fixtures/index.js +0 -3
- package/dist/models/DashboardPage.js +4 -4
- package/dist/models/DataSourceConfigPage.js +5 -5
- package/dist/models/PanelEditPage.js +1 -1
- package/dist/options/index.js +8 -0
- package/package.json +3 -3
- package/dist/api.d.ts +0 -177
- package/dist/e2e-selectors/index.d.ts +0 -2
- package/dist/e2e-selectors/resolver.d.ts +0 -10
- package/dist/e2e-selectors/resolver.test.d.ts +0 -1
- package/dist/e2e-selectors/types.d.ts +0 -174
- package/dist/e2e-selectors/versioned/apis.d.ts +0 -29
- package/dist/e2e-selectors/versioned/components.d.ts +0 -154
- package/dist/e2e-selectors/versioned/constants.d.ts +0 -1
- package/dist/e2e-selectors/versioned/index.d.ts +0 -2
- package/dist/e2e-selectors/versioned/pages.d.ts +0 -125
- package/dist/e2e-selectors/versioned/types.d.ts +0 -8
- package/dist/fixtures/annotationEditPage.d.ts +0 -7
- package/dist/fixtures/commands/createDataSource.d.ts +0 -8
- package/dist/fixtures/commands/createDataSourceConfigPage.d.ts +0 -8
- package/dist/fixtures/commands/login.d.ts +0 -6
- package/dist/fixtures/commands/readProvision.d.ts +0 -7
- package/dist/fixtures/explorePage.d.ts +0 -7
- package/dist/fixtures/grafanaVersion.d.ts +0 -6
- package/dist/fixtures/index.d.ts +0 -4
- package/dist/fixtures/isFeatureToggleEnabled.d.ts +0 -6
- package/dist/fixtures/newDashboardPage.d.ts +0 -7
- package/dist/fixtures/page.d.ts +0 -17
- package/dist/fixtures/panelEditPage.d.ts +0 -7
- package/dist/fixtures/scripts/overrideFeatureToggles.d.ts +0 -1
- package/dist/fixtures/selectors.d.ts +0 -7
- package/dist/fixtures/types.d.ts +0 -2
- package/dist/fixtures/variableEditPage.d.ts +0 -7
- package/dist/index.d.ts +0 -39
- package/dist/matchers/index.d.ts +0 -24
- package/dist/matchers/toBeOK.d.ts +0 -7
- package/dist/matchers/toDisplayPreviews.d.ts +0 -8
- package/dist/matchers/toHaveAlert.d.ts +0 -8
- package/dist/matchers/toHavePanelError.d.ts +0 -9
- package/dist/matchers/utils.d.ts +0 -1
- package/dist/models/AnnotationEditPage.d.ts +0 -18
- package/dist/models/AnnotationPage.d.ts +0 -16
- package/dist/models/DashboardPage.d.ts +0 -33
- package/dist/models/DataSourceConfigPage.d.ts +0 -23
- package/dist/models/DataSourcePicker.d.ts +0 -9
- package/dist/models/ExplorePage.d.ts +0 -21
- package/dist/models/GrafanaPage.d.ts +0 -43
- package/dist/models/PanelEditPage.d.ts +0 -57
- package/dist/models/TimeRange.d.ts +0 -9
- package/dist/models/VariableEditPage.d.ts +0 -26
- package/dist/models/VariablePage.d.ts +0 -16
- package/dist/models/index.d.ts +0 -8
- package/dist/selectorEngine.d.ts +0 -7
- package/dist/types.d.ts +0 -206
package/dist/api.js
CHANGED
|
@@ -8,8 +8,9 @@ const test_1 = require("@playwright/test");
|
|
|
8
8
|
const fixtures_1 = __importDefault(require("./fixtures"));
|
|
9
9
|
const matchers_1 = __importDefault(require("./matchers"));
|
|
10
10
|
const selectorEngine_1 = require("./selectorEngine");
|
|
11
|
+
const options_1 = __importDefault(require("./options"));
|
|
11
12
|
// extend Playwright with Grafana plugin specific fixtures
|
|
12
|
-
exports.test = test_1.test.extend(fixtures_1.default);
|
|
13
|
+
exports.test = test_1.test.extend({ ...fixtures_1.default, ...options_1.default });
|
|
13
14
|
exports.expect = test_1.expect.extend(matchers_1.default);
|
|
14
15
|
/** Register a custom selector engine that resolves locators for Grafana E2E selectors
|
|
15
16
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const grafanaVersion = async ({ page }, use) => {
|
|
4
|
-
let grafanaVersion = process.env.GRAFANA_VERSION;
|
|
4
|
+
let grafanaVersion = process.env.GRAFANA_VERSION ?? '';
|
|
5
5
|
if (!grafanaVersion) {
|
|
6
6
|
await page.goto('/');
|
|
7
7
|
grafanaVersion = await page.evaluate('window.grafanaBootData.settings.buildInfo.version');
|
package/dist/fixtures/index.js
CHANGED
|
@@ -3,7 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const path_1 = __importDefault(require("path"));
|
|
7
6
|
const annotationEditPage_1 = __importDefault(require("./annotationEditPage"));
|
|
8
7
|
const grafanaVersion_1 = __importDefault(require("./grafanaVersion"));
|
|
9
8
|
const selectors_1 = __importDefault(require("./selectors"));
|
|
@@ -18,8 +17,6 @@ const explorePage_1 = __importDefault(require("./explorePage"));
|
|
|
18
17
|
const isFeatureToggleEnabled_1 = __importDefault(require("./isFeatureToggleEnabled"));
|
|
19
18
|
const page_1 = __importDefault(require("./page"));
|
|
20
19
|
const fixtures = {
|
|
21
|
-
provisioningRootDir: [path_1.default.join(process.cwd(), 'provisioning'), { option: true, scope: 'worker' }],
|
|
22
|
-
featureToggles: [{}, { option: true, scope: 'worker' }],
|
|
23
20
|
selectors: selectors_1.default,
|
|
24
21
|
grafanaVersion: grafanaVersion_1.default,
|
|
25
22
|
login: login_1.default,
|
|
@@ -21,12 +21,12 @@ class DashboardPage extends GrafanaPage_1.GrafanaPage {
|
|
|
21
21
|
/**
|
|
22
22
|
* Navigates to the dashboard page. If a dashboard uid was not provided, it's assumed that it's a new dashboard.
|
|
23
23
|
*/
|
|
24
|
-
async goto(options) {
|
|
24
|
+
async goto(options = {}) {
|
|
25
25
|
let url = this.dashboard?.uid
|
|
26
26
|
? this.ctx.selectors.pages.Dashboard.url(this.dashboard.uid)
|
|
27
27
|
: this.ctx.selectors.pages.AddDashboard.url;
|
|
28
28
|
if (this.dashboard?.timeRange) {
|
|
29
|
-
options.queryParams = options
|
|
29
|
+
options.queryParams = options?.queryParams ?? new URLSearchParams();
|
|
30
30
|
options.queryParams.append('from', this.dashboard.timeRange.from);
|
|
31
31
|
options.queryParams.append('to', this.dashboard.timeRange.to);
|
|
32
32
|
}
|
|
@@ -58,13 +58,13 @@ class DashboardPage extends GrafanaPage_1.GrafanaPage {
|
|
|
58
58
|
const urlParams = new URLSearchParams(window.location.search);
|
|
59
59
|
return urlParams.get('editPanel');
|
|
60
60
|
});
|
|
61
|
-
return new PanelEditPage_1.PanelEditPage(this.ctx, { dashboard: this.dashboard, id: panelId });
|
|
61
|
+
return new PanelEditPage_1.PanelEditPage(this.ctx, { dashboard: this.dashboard, id: panelId ?? '' });
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* Deletes the dashboard
|
|
65
65
|
*/
|
|
66
66
|
async deleteDashboard() {
|
|
67
|
-
await this.ctx.request.delete(this.ctx.selectors.apis.Dashboard.delete(this.dashboard
|
|
67
|
+
await this.ctx.request.delete(this.ctx.selectors.apis.Dashboard.delete(this.dashboard?.uid ?? ''));
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
70
|
* Clicks the run button in the refresh picker to refresh the dashboard
|
|
@@ -9,13 +9,13 @@ class DataSourceConfigPage extends GrafanaPage_1.GrafanaPage {
|
|
|
9
9
|
this.datasource = datasource;
|
|
10
10
|
}
|
|
11
11
|
async deleteDataSource() {
|
|
12
|
-
await this.ctx.request.delete(this.ctx.selectors.apis.DataSource.datasourceByUID(this.datasource.uid));
|
|
12
|
+
await this.ctx.request.delete(this.ctx.selectors.apis.DataSource.datasourceByUID(this.datasource.uid ?? ''));
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Navigates to the datasource edit page for an existing datasource
|
|
16
16
|
*/
|
|
17
17
|
async goto(options) {
|
|
18
|
-
return super.navigate(this.ctx.selectors.pages.EditDataSource.url(this.datasource.uid), options);
|
|
18
|
+
return super.navigate(this.ctx.selectors.pages.EditDataSource.url(this.datasource.uid ?? ''), options);
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Mocks the response of the datasource health check call
|
|
@@ -23,7 +23,7 @@ class DataSourceConfigPage extends GrafanaPage_1.GrafanaPage {
|
|
|
23
23
|
* @param status the HTTP status code to return. Defaults to 200
|
|
24
24
|
*/
|
|
25
25
|
async mockHealthCheckResponse(json, status = 200) {
|
|
26
|
-
await this.ctx.page.route(`${this.ctx.selectors.apis.DataSource.health(this.datasource.uid ?? '', this.datasource.id
|
|
26
|
+
await this.ctx.page.route(`${this.ctx.selectors.apis.DataSource.health(this.datasource.uid ?? '', this.datasource.id?.toString() ?? '')}`, async (route) => {
|
|
27
27
|
await route.fulfill({ json, status });
|
|
28
28
|
});
|
|
29
29
|
}
|
|
@@ -36,10 +36,10 @@ class DataSourceConfigPage extends GrafanaPage_1.GrafanaPage {
|
|
|
36
36
|
if (options?.skipWaitForResponse) {
|
|
37
37
|
return this.getByTestIdOrAriaLabel(this.ctx.selectors.pages.DataSource.saveAndTest).click();
|
|
38
38
|
}
|
|
39
|
-
const saveResponsePromise = this.ctx.page.waitForResponse((resp) => resp.url().includes(this.ctx.selectors.apis.DataSource.datasourceByUID(this.datasource.uid)));
|
|
39
|
+
const saveResponsePromise = this.ctx.page.waitForResponse((resp) => resp.url().includes(this.ctx.selectors.apis.DataSource.datasourceByUID(this.datasource.uid ?? '')));
|
|
40
40
|
const healthResponsePromise = this.ctx.page.waitForResponse((resp) => resp
|
|
41
41
|
.url()
|
|
42
|
-
.includes(this.ctx.selectors.apis.DataSource.health(this.datasource.uid ?? '', this.datasource.id
|
|
42
|
+
.includes(this.ctx.selectors.apis.DataSource.health(this.datasource.uid ?? '', this.datasource.id?.toString() ?? '')));
|
|
43
43
|
await this.getByTestIdOrAriaLabel(this.ctx.selectors.pages.DataSource.saveAndTest).click();
|
|
44
44
|
return saveResponsePromise.then(() => healthResponsePromise);
|
|
45
45
|
}
|
|
@@ -88,7 +88,7 @@ class PanelEditPage extends GrafanaPage_1.GrafanaPage {
|
|
|
88
88
|
const section = this.getByTestIdOrAriaLabel(this.ctx.selectors.components.OptionsGroup.group(categoryName));
|
|
89
89
|
await (0, test_1.expect)(section, `Could not find any section for category: ${categoryName}`).toBeVisible();
|
|
90
90
|
const sectionToggle = this.getByTestIdOrAriaLabel(this.ctx.selectors.components.OptionsGroup.toggle(categoryName));
|
|
91
|
-
const expandedAttr = await sectionToggle.getAttribute('aria-expanded');
|
|
91
|
+
const expandedAttr = (await sectionToggle.getAttribute('aria-expanded')) ?? '';
|
|
92
92
|
if (/false/.test(expandedAttr)) {
|
|
93
93
|
await section.click();
|
|
94
94
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const options = {
|
|
5
|
+
featureToggles: [{}, { option: true, scope: 'worker' }],
|
|
6
|
+
provisioningRootDir: [path.join(process.cwd(), 'provisioning'), { option: true, scope: 'worker' }],
|
|
7
|
+
};
|
|
8
|
+
exports.default = options;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/plugin-e2e",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3-canary.694.f97a4af.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"lint:fix": "npm run lint -- --fix",
|
|
26
26
|
"server": "docker-compose up --build",
|
|
27
27
|
"typecheck": "tsc --emitDeclarationOnly false --noEmit",
|
|
28
|
-
"test": "
|
|
28
|
+
"test": "vitest",
|
|
29
29
|
"playwright:test": "npx playwright test",
|
|
30
30
|
"playwright:test:ui": "npx playwright test --ui",
|
|
31
31
|
"playwright:showreport": "npx playwright show-report"
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"semver": "^7.5.4",
|
|
46
46
|
"uuid": "^9.0.1"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "f97a4af609f8d9b4fd498d88f6811f26725e4ca8"
|
|
49
49
|
}
|
package/dist/api.d.ts
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { E2ESelectors } from './e2e-selectors/types';
|
|
2
|
-
import { CreateDataSourceArgs, CreateDataSourcePageArgs, DataSource, ReadProvisionArgs } from './types';
|
|
3
|
-
import { PanelEditPage, GrafanaPage, DataSourceConfigPage, DashboardPage, VariableEditPage, AnnotationEditPage } from './models';
|
|
4
|
-
import { ExplorePage } from './models/ExplorePage';
|
|
5
|
-
export type PluginOptions = {
|
|
6
|
-
/**
|
|
7
|
-
* When using the readProvisioning fixture, files will be read from this directory. If no directory is provided,
|
|
8
|
-
* the 'provisioning' directory in the current working directory will be used.
|
|
9
|
-
*
|
|
10
|
-
* eg.
|
|
11
|
-
* export default defineConfig({
|
|
12
|
-
use: {
|
|
13
|
-
provisioningRootDir: 'path/to/provisioning',
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
provisioningRootDir: string;
|
|
19
|
-
/**
|
|
20
|
-
* Optionally, you can add or override feature toggles.
|
|
21
|
-
* The feature toggles you specify here will only work in the frontend. If you need a feature toggle to work across the entire stack, you
|
|
22
|
-
* need to need to enable the feature in the Grafana config. See https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#feature_toggles
|
|
23
|
-
*
|
|
24
|
-
* To override feature toggles globally in the playwright.config.ts file:
|
|
25
|
-
* export default defineConfig({
|
|
26
|
-
use: {
|
|
27
|
-
featureToggles: {
|
|
28
|
-
exploreMixedDatasource: true,
|
|
29
|
-
redshiftAsyncQueryDataSupport: false
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
*
|
|
34
|
-
* To override feature toggles for tests on a certain file:
|
|
35
|
-
test.use({
|
|
36
|
-
featureToggles: {
|
|
37
|
-
exploreMixedDatasource: true,
|
|
38
|
-
},
|
|
39
|
-
* });
|
|
40
|
-
*/
|
|
41
|
-
featureToggles: Record<string, boolean>;
|
|
42
|
-
};
|
|
43
|
-
export type PluginFixture = {
|
|
44
|
-
/**
|
|
45
|
-
* The current Grafana version.
|
|
46
|
-
*
|
|
47
|
-
* If a GRAFANA_VERSION environment variable is set, this will be used. Otherwise,
|
|
48
|
-
* the version will be picked from window.grafanaBootData.settings.buildInfo.version.
|
|
49
|
-
*/
|
|
50
|
-
grafanaVersion: string;
|
|
51
|
-
/**
|
|
52
|
-
* The E2E selectors to use for the current version of Grafana
|
|
53
|
-
*/
|
|
54
|
-
selectors: E2ESelectors;
|
|
55
|
-
/**
|
|
56
|
-
* Isolated {@link DashboardPage} instance for each test.
|
|
57
|
-
*
|
|
58
|
-
* Navigates to a new dashboard page and adds a new panel.
|
|
59
|
-
*
|
|
60
|
-
* Use {@link PanelEditPage.setVisualization} to change the visualization
|
|
61
|
-
* Use {@link PanelEditPage.datasource.set} to change the datasource
|
|
62
|
-
* Use {@link PanelEditPage.getQueryEditorEditorRow} to retrieve the query
|
|
63
|
-
* editor row locator for a given query refId
|
|
64
|
-
*/
|
|
65
|
-
newDashboardPage: DashboardPage;
|
|
66
|
-
/**
|
|
67
|
-
* Isolated {@link PanelEditPage} instance for each test.
|
|
68
|
-
*
|
|
69
|
-
* Navigates to a new dashboard page and adds a new panel.
|
|
70
|
-
*
|
|
71
|
-
* Use {@link PanelEditPage.setVisualization} to change the visualization
|
|
72
|
-
* Use {@link PanelEditPage.datasource.set} to change the datasource
|
|
73
|
-
* Use {@link ExplorePage.getQueryEditorEditorRow} to retrieve the query
|
|
74
|
-
* editor row locator for a given query refId
|
|
75
|
-
*/
|
|
76
|
-
panelEditPage: PanelEditPage;
|
|
77
|
-
/**
|
|
78
|
-
* Isolated {@link VariableEditPage} instance for each test.
|
|
79
|
-
*
|
|
80
|
-
* Navigates to a new dashboard page and adds a new variable.
|
|
81
|
-
*
|
|
82
|
-
* Use {@link VariableEditPage.setVariableType} to change the variable type
|
|
83
|
-
*/
|
|
84
|
-
variableEditPage: VariableEditPage;
|
|
85
|
-
/**
|
|
86
|
-
* Isolated {@link AnnotationEditPage} instance for each test.
|
|
87
|
-
*
|
|
88
|
-
* Navigates to a new dashboard page and adds a new annotation.
|
|
89
|
-
*
|
|
90
|
-
* Use {@link AnnotationEditPage.datasource.set} to change the datasource
|
|
91
|
-
*/
|
|
92
|
-
annotationEditPage: AnnotationEditPage;
|
|
93
|
-
/**
|
|
94
|
-
* Isolated {@link ExplorePage} instance for each test.
|
|
95
|
-
*
|
|
96
|
-
* Navigates to a the explore page.
|
|
97
|
-
*
|
|
98
|
-
* Use {@link ExplorePage.datasource.set} to change the datasource
|
|
99
|
-
* Use {@link ExplorePage.getQueryEditorEditorRow} to retrieve the query editor
|
|
100
|
-
* row locator for a given query refId
|
|
101
|
-
*/
|
|
102
|
-
explorePage: ExplorePage;
|
|
103
|
-
/**
|
|
104
|
-
* Fixture command that will create an isolated DataSourceConfigPage instance for a given data source type.
|
|
105
|
-
*
|
|
106
|
-
* The data source config page cannot be navigated to without a data source uid, so this fixture will create a new
|
|
107
|
-
* data source using the Grafana API, create a new DataSourceConfigPage instance and navigate to the page.
|
|
108
|
-
*/
|
|
109
|
-
createDataSourceConfigPage: (args: CreateDataSourcePageArgs) => Promise<DataSourceConfigPage>;
|
|
110
|
-
/**
|
|
111
|
-
* Fixture command that creates a data source via the Grafana API.
|
|
112
|
-
*
|
|
113
|
-
* If you have tests that depend on the the existance of a data source,
|
|
114
|
-
* you may use this command in a setup project. Read more about setup projects
|
|
115
|
-
* here: https://playwright.dev/docs/auth#basic-shared-account-in-all-tests
|
|
116
|
-
*/
|
|
117
|
-
createDataSource: (args: CreateDataSourceArgs) => Promise<DataSource>;
|
|
118
|
-
/**
|
|
119
|
-
* Fixture command that login to Grafana using the Grafana API.
|
|
120
|
-
* If the same credentials should be used in every test,
|
|
121
|
-
* invoke this fixture in a setup project.
|
|
122
|
-
* See https://playwright.dev/docs/auth#basic-shared-account-in-all-tests
|
|
123
|
-
*
|
|
124
|
-
* If no credentials are provided, the default admin/admin credentials will be used.
|
|
125
|
-
*
|
|
126
|
-
* The default credentials can be overridden in the playwright.config.ts file:
|
|
127
|
-
* eg.
|
|
128
|
-
* export default defineConfig({
|
|
129
|
-
use: {
|
|
130
|
-
httpCredentials: {
|
|
131
|
-
username: 'user',
|
|
132
|
-
password: 'pass',
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
});
|
|
136
|
-
*
|
|
137
|
-
* To override credentials in a single test:
|
|
138
|
-
* test.use({ httpCredentials: { username: 'admin', password: 'admin' } });
|
|
139
|
-
* To avoid authentication in a single test:
|
|
140
|
-
* test.use({ storageState: { cookies: [], origins: [] } });
|
|
141
|
-
*/
|
|
142
|
-
login: () => Promise<void>;
|
|
143
|
-
/**
|
|
144
|
-
* Fixture command that reads a the yaml file for a provisioned dashboard
|
|
145
|
-
* or data source and returns it as json.
|
|
146
|
-
*/
|
|
147
|
-
readProvision<T = any>(args: ReadProvisionArgs): Promise<T>;
|
|
148
|
-
/**
|
|
149
|
-
* Function that checks if a feature toggle is enabled. Only works for frontend feature toggles.
|
|
150
|
-
*/
|
|
151
|
-
isFeatureToggleEnabled<T = object>(featureToggle: keyof T): Promise<boolean>;
|
|
152
|
-
};
|
|
153
|
-
export declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & PluginFixture, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & PluginOptions>;
|
|
154
|
-
export declare const expect: import("@playwright/test").Expect<{
|
|
155
|
-
toBeOK: (request: Promise<import("@playwright/test").Response>) => Promise<{
|
|
156
|
-
message: () => string;
|
|
157
|
-
pass: boolean;
|
|
158
|
-
actual: number;
|
|
159
|
-
}>;
|
|
160
|
-
toHavePanelError: (panelError: import("./types").PanelError, options?: {
|
|
161
|
-
timeout?: number;
|
|
162
|
-
}) => Promise<{
|
|
163
|
-
message: () => any;
|
|
164
|
-
pass: boolean;
|
|
165
|
-
actual: number;
|
|
166
|
-
}>;
|
|
167
|
-
toDisplayPreviews: (variableEditPage: VariableEditPage, previewTexts: (string | RegExp)[], options?: import("./types").ContainTextOptions) => Promise<{
|
|
168
|
-
pass: boolean;
|
|
169
|
-
actual: boolean;
|
|
170
|
-
message: () => string;
|
|
171
|
-
}>;
|
|
172
|
-
toHaveAlert: (grafanaPage: GrafanaPage, severity: import("./matchers/toHaveAlert").AlertVariant, options?: import("./types").AlertPageOptions) => Promise<{
|
|
173
|
-
message: () => any;
|
|
174
|
-
pass: boolean;
|
|
175
|
-
}>;
|
|
176
|
-
}>;
|
|
177
|
-
export { selectors } from '@playwright/test';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { E2ESelectors } from './types';
|
|
2
|
-
import { VersionedSelectors } from './versioned/types';
|
|
3
|
-
/**
|
|
4
|
-
* Resolves selectors based on the Grafana version
|
|
5
|
-
*
|
|
6
|
-
* If the selector has multiple versions, the last version that is less
|
|
7
|
-
* than or equal to the Grafana version will be returned.
|
|
8
|
-
* If the selector doesn't have a version, it will be returned as is.
|
|
9
|
-
*/
|
|
10
|
-
export declare const resolveSelectors: (versionedSelectors: VersionedSelectors, grafanaVersion: string) => E2ESelectors;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
export type E2ESelectors = {
|
|
2
|
-
pages: Pages;
|
|
3
|
-
components: Components;
|
|
4
|
-
apis: APIs;
|
|
5
|
-
};
|
|
6
|
-
export type APIs = {
|
|
7
|
-
DataSource: {
|
|
8
|
-
resourcePattern: string;
|
|
9
|
-
resourceUIDPattern: string;
|
|
10
|
-
queryPattern: string;
|
|
11
|
-
query: string;
|
|
12
|
-
health: (uid: string, id: string) => string;
|
|
13
|
-
datasourceByUID: (uid: string) => string;
|
|
14
|
-
};
|
|
15
|
-
Dashboard: {
|
|
16
|
-
delete: (uid: string) => string;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export type Components = {
|
|
20
|
-
TimePicker: {
|
|
21
|
-
openButton: string;
|
|
22
|
-
fromField: string;
|
|
23
|
-
toField: string;
|
|
24
|
-
applyTimeRange: string;
|
|
25
|
-
absoluteTimeRangeTitle: string;
|
|
26
|
-
};
|
|
27
|
-
Panels: {
|
|
28
|
-
Panel: {
|
|
29
|
-
title: (title: string) => string;
|
|
30
|
-
headerCornerInfo: (mode: string) => string;
|
|
31
|
-
status: (status: string) => string;
|
|
32
|
-
};
|
|
33
|
-
Visualization: {
|
|
34
|
-
Table: {
|
|
35
|
-
header: string;
|
|
36
|
-
footer: string;
|
|
37
|
-
body: string;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
PanelEditor: {
|
|
42
|
-
General: {
|
|
43
|
-
content: string;
|
|
44
|
-
};
|
|
45
|
-
applyButton: string;
|
|
46
|
-
toggleVizPicker: string;
|
|
47
|
-
};
|
|
48
|
-
RefreshPicker: {
|
|
49
|
-
runButtonV2: string;
|
|
50
|
-
};
|
|
51
|
-
QueryEditorRows: {
|
|
52
|
-
rows: string;
|
|
53
|
-
};
|
|
54
|
-
QueryEditorRow: {
|
|
55
|
-
title: (refId: string) => string;
|
|
56
|
-
};
|
|
57
|
-
Alert: {
|
|
58
|
-
alertV2: (severity: string) => string;
|
|
59
|
-
};
|
|
60
|
-
PageToolbar: {
|
|
61
|
-
item: (tooltip: string) => string;
|
|
62
|
-
shotMoreItems: string;
|
|
63
|
-
itemButton: (title: string) => string;
|
|
64
|
-
itemButtonTitle: string;
|
|
65
|
-
};
|
|
66
|
-
OptionsGroup: {
|
|
67
|
-
group: (title?: string) => string;
|
|
68
|
-
toggle: (title?: string) => string;
|
|
69
|
-
groupTitle: string;
|
|
70
|
-
};
|
|
71
|
-
PluginVisualization: {
|
|
72
|
-
item: (title: string) => string;
|
|
73
|
-
};
|
|
74
|
-
Select: {
|
|
75
|
-
option: string;
|
|
76
|
-
input: () => string;
|
|
77
|
-
singleValue: () => string;
|
|
78
|
-
};
|
|
79
|
-
DataSourcePicker: {
|
|
80
|
-
container: string;
|
|
81
|
-
};
|
|
82
|
-
TimeZonePicker: {
|
|
83
|
-
containerV2: string;
|
|
84
|
-
};
|
|
85
|
-
CodeEditor: {
|
|
86
|
-
container: string;
|
|
87
|
-
};
|
|
88
|
-
Variables: {
|
|
89
|
-
variableOption: string;
|
|
90
|
-
};
|
|
91
|
-
Annotations: {
|
|
92
|
-
annotationsTypeInput: string;
|
|
93
|
-
annotationsChoosePanelInput: string;
|
|
94
|
-
};
|
|
95
|
-
Tooltip: {
|
|
96
|
-
container: string;
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
export type Pages = {
|
|
100
|
-
Home: {
|
|
101
|
-
url: string;
|
|
102
|
-
};
|
|
103
|
-
DataSource: {
|
|
104
|
-
name: string;
|
|
105
|
-
delete: string;
|
|
106
|
-
readOnly: string;
|
|
107
|
-
saveAndTest: string;
|
|
108
|
-
alert: string;
|
|
109
|
-
};
|
|
110
|
-
EditDataSource: {
|
|
111
|
-
url: (dataSourceUid: string) => string;
|
|
112
|
-
};
|
|
113
|
-
AddDashboard: {
|
|
114
|
-
url: string;
|
|
115
|
-
itemButton: (title: string) => string;
|
|
116
|
-
addNewPanel: string;
|
|
117
|
-
itemButtonAddViz: string;
|
|
118
|
-
Settings: {
|
|
119
|
-
Annotations: {
|
|
120
|
-
List: {
|
|
121
|
-
url: string;
|
|
122
|
-
};
|
|
123
|
-
Edit: {
|
|
124
|
-
url: (annotationIndex: string) => string;
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
Variables: {
|
|
128
|
-
List: {
|
|
129
|
-
url: string;
|
|
130
|
-
};
|
|
131
|
-
Edit: {
|
|
132
|
-
url: (variableIndex: string) => string;
|
|
133
|
-
};
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
};
|
|
137
|
-
Dashboard: {
|
|
138
|
-
url: (uid: string) => string;
|
|
139
|
-
Settings: {
|
|
140
|
-
Annotations: {
|
|
141
|
-
Edit: {
|
|
142
|
-
url: (dashboardUid: string, annotationIndex: string) => string;
|
|
143
|
-
};
|
|
144
|
-
List: {
|
|
145
|
-
url: (uid: string) => string;
|
|
146
|
-
/**
|
|
147
|
-
* @deprecated use addAnnotationCTAV2 from Grafana 8.3 instead
|
|
148
|
-
*/
|
|
149
|
-
addAnnotationCTA: string;
|
|
150
|
-
addAnnotationCTAV2: string;
|
|
151
|
-
};
|
|
152
|
-
};
|
|
153
|
-
Variables: {
|
|
154
|
-
List: {
|
|
155
|
-
url: (dashboardUid: string) => string;
|
|
156
|
-
newButton: string;
|
|
157
|
-
addVariableCTAV2: (variableName: string) => string;
|
|
158
|
-
addVariableCTAV2Item: string;
|
|
159
|
-
};
|
|
160
|
-
Edit: {
|
|
161
|
-
url: (dashboardUid: string, editIndex: string) => string;
|
|
162
|
-
General: {
|
|
163
|
-
generalTypeSelectV2: string;
|
|
164
|
-
previewOfValuesOption: string;
|
|
165
|
-
submitButton: string;
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
Explore: {
|
|
172
|
-
url: string;
|
|
173
|
-
};
|
|
174
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export declare const versionedAPIs: {
|
|
2
|
-
DataSource: {
|
|
3
|
-
resourcePattern: {
|
|
4
|
-
"8.0.0": string;
|
|
5
|
-
};
|
|
6
|
-
resourceUIDPattern: {
|
|
7
|
-
'9.4.4': string;
|
|
8
|
-
"8.0.0": string;
|
|
9
|
-
};
|
|
10
|
-
queryPattern: {
|
|
11
|
-
"8.0.0": string;
|
|
12
|
-
};
|
|
13
|
-
query: {
|
|
14
|
-
"8.0.0": string;
|
|
15
|
-
};
|
|
16
|
-
health: {
|
|
17
|
-
"9.5.0": (uid: string, _: string) => string;
|
|
18
|
-
"8.0.0": (_: string, id: string) => string;
|
|
19
|
-
};
|
|
20
|
-
datasourceByUID: {
|
|
21
|
-
"8.0.0": (uid: string) => string;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
Dashboard: {
|
|
25
|
-
delete: {
|
|
26
|
-
"8.0.0": (uid: string) => string;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
};
|