@grafana/plugin-e2e 2.1.9-canary.2051.17213322732.0 → 2.1.9-canary.2053.17240496040.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
CHANGED
|
@@ -435,8 +435,8 @@ declare class AlertRuleEditPage extends GrafanaPage {
|
|
|
435
435
|
/**
|
|
436
436
|
* Returns a locator for hte alert rule name field
|
|
437
437
|
*/
|
|
438
|
-
get alertRuleNameField():
|
|
439
|
-
get advancedModeSwitch():
|
|
438
|
+
get alertRuleNameField(): Locator;
|
|
439
|
+
get advancedModeSwitch(): Locator;
|
|
440
440
|
isAdvancedModeSupported(): Promise<boolean>;
|
|
441
441
|
enableAdvancedQueryMode(): Promise<void>;
|
|
442
442
|
disableAdvancedQueryMode(): Promise<void>;
|
|
@@ -146,18 +146,15 @@ class AlertRuleEditPage extends GrafanaPage.GrafanaPage {
|
|
|
146
146
|
* Only supported for Grafana version 9.5.0 ad later.
|
|
147
147
|
*/
|
|
148
148
|
async evaluate(options) {
|
|
149
|
-
await this.ctx.page.waitForTimeout(
|
|
149
|
+
await this.ctx.page.waitForTimeout(1e3);
|
|
150
150
|
if (semver__namespace.gte(this.ctx.grafanaVersion, "10.0.0")) {
|
|
151
151
|
this.ctx.page.route(this.ctx.selectors.apis.Alerting.eval, async (route) => {
|
|
152
152
|
const response = await route.fetch();
|
|
153
153
|
if (!response.ok()) {
|
|
154
|
-
console.log("response not ok for", this.ctx.selectors.apis.Alerting.eval);
|
|
155
154
|
return route.fulfill({ response });
|
|
156
155
|
}
|
|
157
156
|
let body = await response.json();
|
|
158
157
|
const statuses = Object.keys(body.results).map((key) => body.results[key].status);
|
|
159
|
-
console.log("response statuses for", this.ctx.selectors.apis.Alerting.eval);
|
|
160
|
-
console.log("statuses", statuses);
|
|
161
158
|
route.fulfill({
|
|
162
159
|
response,
|
|
163
160
|
status: statuses.every((status) => status >= 200 && status < 300) ? 200 : statuses[0]
|
|
@@ -168,12 +165,14 @@ class AlertRuleEditPage extends GrafanaPage.GrafanaPage {
|
|
|
168
165
|
(resp) => resp.url().includes(this.ctx.selectors.apis.Alerting.eval),
|
|
169
166
|
options
|
|
170
167
|
);
|
|
171
|
-
let evaluateButton
|
|
168
|
+
let evaluateButton;
|
|
172
169
|
if (semver__namespace.lt(this.ctx.grafanaVersion, "11.1.0")) {
|
|
173
|
-
evaluateButton = this.ctx.page.getByRole("button", { name: "Preview", exact: true });
|
|
170
|
+
evaluateButton = await this.ctx.page.getByRole("button", { name: "Preview", exact: true });
|
|
171
|
+
} else {
|
|
172
|
+
evaluateButton = await this.getByGrafanaSelector(this.ctx.selectors.components.AlertRules.previewButton);
|
|
174
173
|
}
|
|
175
174
|
const evalReq = this.ctx.page.waitForRequest((req) => req.url().includes(this.ctx.selectors.apis.Alerting.eval), {
|
|
176
|
-
timeout:
|
|
175
|
+
timeout: 5e3
|
|
177
176
|
}).catch(async () => {
|
|
178
177
|
await evaluateButton.click();
|
|
179
178
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/plugin-e2e",
|
|
3
|
-
"version": "2.1.9-canary.
|
|
3
|
+
"version": "2.1.9-canary.2053.17240496040.0",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"uuid": "^11.0.2",
|
|
48
48
|
"yaml": "^2.3.4"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "5f8dce1c79bcc41cd8a0843c37a6d6e1c1932d55"
|
|
51
51
|
}
|