@grafana/plugin-e2e 1.4.0 → 1.5.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.
@@ -108,7 +108,7 @@ export type Components = {
108
108
  };
109
109
  PageToolbar: {
110
110
  item: (tooltip: string) => string;
111
- shotMoreItems: string;
111
+ showMoreItems: string;
112
112
  itemButton: (title: string) => string;
113
113
  itemButtonTitle: string;
114
114
  };
@@ -194,6 +194,9 @@ export type Pages = {
194
194
  Dashboard: {
195
195
  url: (uid: string) => string;
196
196
  Settings: {
197
+ Actions: {
198
+ close: string;
199
+ };
197
200
  Annotations: {
198
201
  Edit: {
199
202
  url: (dashboardUid: string, annotationIndex: string) => string;
@@ -219,10 +222,23 @@ export type Pages = {
219
222
  generalTypeSelectV2: string;
220
223
  previewOfValuesOption: string;
221
224
  submitButton: string;
225
+ generalNameInputV2: string;
226
+ applyButton: string;
222
227
  };
223
228
  };
224
229
  };
225
230
  };
231
+ SubMenu: {
232
+ submenuItemLabels: (item: string) => string;
233
+ submenuItemValueDropDownValueLinkTexts: (item: string) => string;
234
+ submenuItemValueDropDownDropDown: string;
235
+ submenuItemValueDropDownOptionTexts: (item: string) => string;
236
+ };
237
+ SaveDashboardAsModal: {
238
+ saveButton: string;
239
+ newName: string;
240
+ save: string;
241
+ };
226
242
  };
227
243
  Explore: {
228
244
  url: string;
@@ -36,7 +36,7 @@ exports.versionedAPIs = {
36
36
  },
37
37
  Dashboard: {
38
38
  delete: {
39
- [constants_1.MIN_GRAFANA_VERSION]: (uid) => `/api/datasources/uid/${uid}`,
39
+ [constants_1.MIN_GRAFANA_VERSION]: (uid) => `/api/dashboards/uid/${uid}`,
40
40
  },
41
41
  },
42
42
  Plugin: {
@@ -191,7 +191,7 @@ export declare const versionedComponents: {
191
191
  item: {
192
192
  "8.0.0": (tooltip: string) => string;
193
193
  };
194
- shotMoreItems: {
194
+ showMoreItems: {
195
195
  "8.0.0": string;
196
196
  };
197
197
  itemButton: {
@@ -172,7 +172,7 @@ exports.versionedComponents = {
172
172
  item: {
173
173
  [constants_1.MIN_GRAFANA_VERSION]: (tooltip) => `${tooltip}`,
174
174
  },
175
- shotMoreItems: {
175
+ showMoreItems: {
176
176
  [constants_1.MIN_GRAFANA_VERSION]: 'Show more items',
177
177
  },
178
178
  itemButton: {
@@ -74,6 +74,12 @@ export declare const versionedPages: {
74
74
  "8.0.0": (uid: string) => string;
75
75
  };
76
76
  Settings: {
77
+ Actions: {
78
+ close: {
79
+ "8.0.0": string;
80
+ '9.5.0': string;
81
+ };
82
+ };
77
83
  Annotations: {
78
84
  Edit: {
79
85
  url: {
@@ -128,10 +134,39 @@ export declare const versionedPages: {
128
134
  selectionOptionsIncludeAllSwitch: {
129
135
  "8.0.0": string;
130
136
  };
137
+ generalNameInputV2: {
138
+ '8.5.0': string;
139
+ "8.0.0": string;
140
+ };
141
+ applyButton: {
142
+ '9.3.0': string;
143
+ };
131
144
  };
132
145
  };
133
146
  };
134
147
  };
148
+ SubMenu: {
149
+ submenuItemLabels: {
150
+ "8.0.0": (item: string) => string;
151
+ };
152
+ submenuItemValueDropDownValueLinkTexts: {
153
+ "8.0.0": (item: string) => string;
154
+ };
155
+ submenuItemValueDropDownDropDown: {
156
+ "8.0.0": string;
157
+ };
158
+ submenuItemValueDropDownOptionTexts: {
159
+ "8.0.0": (item: string) => string;
160
+ };
161
+ };
162
+ SaveDashboardAsModal: {
163
+ newName: {
164
+ "8.0.0": string;
165
+ };
166
+ save: {
167
+ "8.0.0": string;
168
+ };
169
+ };
135
170
  };
136
171
  Explore: {
137
172
  url: {
@@ -79,6 +79,12 @@ exports.versionedPages = {
79
79
  [constants_1.MIN_GRAFANA_VERSION]: (uid) => `/d/${uid}`,
80
80
  },
81
81
  Settings: {
82
+ Actions: {
83
+ close: {
84
+ [constants_1.MIN_GRAFANA_VERSION]: 'Go Back button',
85
+ '9.5.0': 'data-testid dashboard-settings-close',
86
+ },
87
+ },
82
88
  Annotations: {
83
89
  Edit: {
84
90
  url: {
@@ -134,10 +140,37 @@ exports.versionedPages = {
134
140
  selectionOptionsIncludeAllSwitch: {
135
141
  [constants_1.MIN_GRAFANA_VERSION]: 'Variable editor Form IncludeAll switch',
136
142
  },
143
+ generalNameInputV2: {
144
+ '8.5.0': 'data-testid Variable editor Form Name field',
145
+ [constants_1.MIN_GRAFANA_VERSION]: 'Variable editor Form Name field',
146
+ },
147
+ applyButton: {
148
+ '9.3.0': 'data-testid Variable editor Apply button',
149
+ },
137
150
  },
138
151
  },
139
152
  },
140
153
  },
154
+ SubMenu: {
155
+ submenuItemLabels: {
156
+ [constants_1.MIN_GRAFANA_VERSION]: (item) => `data-testid Dashboard template variables submenu Label ${item}`,
157
+ },
158
+ submenuItemValueDropDownValueLinkTexts: {
159
+ [constants_1.MIN_GRAFANA_VERSION]: (item) => `data-testid Dashboard template variables Variable Value DropDown value link text ${item}`,
160
+ },
161
+ submenuItemValueDropDownDropDown: { [constants_1.MIN_GRAFANA_VERSION]: 'Variable options' },
162
+ submenuItemValueDropDownOptionTexts: {
163
+ [constants_1.MIN_GRAFANA_VERSION]: (item) => `data-testid Dashboard template variables Variable Value DropDown option text ${item}`,
164
+ },
165
+ },
166
+ SaveDashboardAsModal: {
167
+ newName: {
168
+ [constants_1.MIN_GRAFANA_VERSION]: 'Save dashboard title field',
169
+ },
170
+ save: {
171
+ [constants_1.MIN_GRAFANA_VERSION]: 'Save dashboard button',
172
+ },
173
+ },
141
174
  },
142
175
  Explore: {
143
176
  url: {
@@ -0,0 +1,6 @@
1
+ import { TestFixture } from '@playwright/test';
2
+ import { DashboardPageArgs, PlaywrightArgs } from '../../types';
3
+ import { VariablePage } from '../../models/pages/VariablePage';
4
+ type GotoVariablePageFixture = TestFixture<(args: DashboardPageArgs) => Promise<VariablePage>, PlaywrightArgs>;
5
+ export declare const gotoVariablePage: GotoVariablePageFixture;
6
+ export {};
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gotoVariablePage = void 0;
4
+ const VariablePage_1 = require("../../models/pages/VariablePage");
5
+ const gotoVariablePage = async ({ request, page, selectors, grafanaVersion }, use, testInfo) => {
6
+ await use(async (args) => {
7
+ const variablePage = new VariablePage_1.VariablePage({ page, selectors, grafanaVersion, request, testInfo }, args);
8
+ await variablePage.goto();
9
+ return variablePage;
10
+ });
11
+ };
12
+ exports.gotoVariablePage = gotoVariablePage;
@@ -0,0 +1,6 @@
1
+ import { TestFixture } from '@playwright/test';
2
+ import { PlaywrightArgs } from '../types';
3
+ import { VariablePage } from '../models/pages/VariablePage';
4
+ type VariablePageFixture = TestFixture<VariablePage, PlaywrightArgs>;
5
+ export declare const variablePage: VariablePageFixture;
6
+ export {};
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.variablePage = void 0;
4
+ const VariablePage_1 = require("../models/pages/VariablePage");
5
+ const variablePage = async ({ page, selectors, grafanaVersion, request }, use, testInfo) => {
6
+ const variablePage = new VariablePage_1.VariablePage({ page, selectors, grafanaVersion, request, testInfo });
7
+ await variablePage.goto();
8
+ await use(variablePage);
9
+ };
10
+ exports.variablePage = variablePage;
package/dist/index.js CHANGED
@@ -45,6 +45,8 @@ const options_1 = require("./options");
45
45
  const toHaveAlert_1 = require("./matchers/toHaveAlert");
46
46
  const toDisplayPreviews_1 = require("./matchers/toDisplayPreviews");
47
47
  const toBeOK_1 = require("./matchers/toBeOK");
48
+ const variablePage_1 = require("./fixtures/variablePage");
49
+ const gotoVariablePage_1 = require("./fixtures/commands/gotoVariablePage");
48
50
  // models
49
51
  var DataSourcePicker_1 = require("./models/components/DataSourcePicker");
50
52
  Object.defineProperty(exports, "DataSourcePicker", { enumerable: true, get: function () { return DataSourcePicker_1.DataSourcePicker; } });
@@ -89,6 +91,7 @@ exports.test = test_1.test.extend({
89
91
  dashboardPage: dashboardPage_1.dashboardPage,
90
92
  panelEditPage: panelEditPage_1.panelEditPage,
91
93
  variableEditPage: variableEditPage_1.variableEditPage,
94
+ variablePage: variablePage_1.variablePage,
92
95
  annotationEditPage: annotationEditPage_1.annotationEditPage,
93
96
  alertRuleEditPage: alertRuleEditPage_1.alertRuleEditPage,
94
97
  explorePage: explorePage_1.explorePage,
@@ -101,6 +104,7 @@ exports.test = test_1.test.extend({
101
104
  gotoDashboardPage: gotoDashboardPage_1.gotoDashboardPage,
102
105
  gotoPanelEditPage: gotoPanelEditPage_1.gotoPanelEditPage,
103
106
  gotoVariableEditPage: gotoVariableEditPage_1.gotoVariableEditPage,
107
+ gotoVariablePage: gotoVariablePage_1.gotoVariablePage,
104
108
  gotoAnnotationEditPage: gotoAnnotationEditPage_1.gotoAnnotationEditPage,
105
109
  gotoAlertRuleEditPage: gotoAlertRuleEditPage_1.gotoAlertRuleEditPage,
106
110
  gotoDataSourceConfigPage: gotoDataSourceConfigPage_1.gotoDataSourceConfigPage,
@@ -86,7 +86,7 @@ class ExplorePage extends GrafanaPage_1.GrafanaPage {
86
86
  }
87
87
  catch (_) {
88
88
  // handle the case when the run button is hidden behind the "Show more items" button
89
- await this.getByGrafanaSelector(components.PageToolbar.item(components.PageToolbar.shotMoreItems)).click();
89
+ await this.getByGrafanaSelector(components.PageToolbar.item(components.PageToolbar.showMoreItems)).click();
90
90
  await this.getByGrafanaSelector(components.RefreshPicker.runButtonV2).last().click();
91
91
  }
92
92
  return responsePromise;
package/dist/types.d.ts CHANGED
@@ -8,6 +8,7 @@ import { DataSourceConfigPage } from './models/pages/DataSourceConfigPage';
8
8
  import { ExplorePage } from './models/pages/ExplorePage';
9
9
  import { PanelEditPage } from './models/pages/PanelEditPage';
10
10
  import { VariableEditPage } from './models/pages/VariableEditPage';
11
+ import { VariablePage } from './models/pages/VariablePage';
11
12
  import { AlertRuleEditPage } from './models/pages/AlertRuleEditPage';
12
13
  export type PluginOptions = {
13
14
  /**
@@ -193,6 +194,13 @@ export type PluginFixture = {
193
194
  * To load an existing dashboard with an existing variable, use the {@link gotoVariableEditPage} fixture.
194
195
  */
195
196
  variableEditPage: VariableEditPage;
197
+ /**
198
+ * Isolated {@link VariablePage} instance for each test.
199
+ *
200
+ * When using this fixture in a test, you will get a new dashboard page with a new empty variable edit page
201
+ * To load an existing dashboard with an existing variable, use the {@link gotoVariableEditPage} fixture.
202
+ */
203
+ variablePage: VariablePage;
196
204
  /**
197
205
  * Isolated {@link AnnotationEditPage} instance for each test.
198
206
  *
@@ -230,6 +238,10 @@ export type PluginFixture = {
230
238
  * Fixture command that navigates a variable edit page for an already existing variable query in a dashboard.
231
239
  */
232
240
  gotoVariableEditPage: (args: DashboardEditViewArgs<string>) => Promise<VariableEditPage>;
241
+ /**
242
+ * Fixture command that navigates a variable edit page for an already existing variable query in a dashboard.
243
+ */
244
+ gotoVariablePage: (args: DashboardPageArgs) => Promise<VariablePage>;
233
245
  /**
234
246
  * Fixture command that navigates an annotation edit page for an already existing annotation query in a dashboard.
235
247
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/plugin-e2e",
3
- "version": "1.4.0",
3
+ "version": "1.5.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
@@ -55,5 +55,5 @@
55
55
  "start": "cls || clear"
56
56
  }
57
57
  },
58
- "gitHead": "8a883c5069c25ba18070b88a83ac0eb46b097720"
58
+ "gitHead": "c323be85acf515e6e5f82bf4b705118fc89da74e"
59
59
  }