@grafana/plugin-e2e 2.1.9-canary.2051.17231349037.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>;
|
|
@@ -148,19 +148,15 @@ class AlertRuleEditPage extends GrafanaPage.GrafanaPage {
|
|
|
148
148
|
async evaluate(options) {
|
|
149
149
|
await this.ctx.page.waitForTimeout(1e3);
|
|
150
150
|
if (semver__namespace.gte(this.ctx.grafanaVersion, "10.0.0")) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
console.log("response not ok for", this.ctx.selectors.apis.Alerting.eval);
|
|
156
|
-
return route.fulfill({ response: response2 });
|
|
151
|
+
this.ctx.page.route(this.ctx.selectors.apis.Alerting.eval, async (route) => {
|
|
152
|
+
const response = await route.fetch();
|
|
153
|
+
if (!response.ok()) {
|
|
154
|
+
return route.fulfill({ response });
|
|
157
155
|
}
|
|
158
|
-
let body = await
|
|
156
|
+
let body = await response.json();
|
|
159
157
|
const statuses = Object.keys(body.results).map((key) => body.results[key].status);
|
|
160
|
-
console.log("response statuses for", this.ctx.selectors.apis.Alerting.eval);
|
|
161
|
-
console.log("statuses", statuses);
|
|
162
158
|
route.fulfill({
|
|
163
|
-
response
|
|
159
|
+
response,
|
|
164
160
|
status: statuses.every((status) => status >= 200 && status < 300) ? 200 : statuses[0]
|
|
165
161
|
});
|
|
166
162
|
});
|
|
@@ -169,9 +165,11 @@ class AlertRuleEditPage extends GrafanaPage.GrafanaPage {
|
|
|
169
165
|
(resp) => resp.url().includes(this.ctx.selectors.apis.Alerting.eval),
|
|
170
166
|
options
|
|
171
167
|
);
|
|
172
|
-
let evaluateButton
|
|
168
|
+
let evaluateButton;
|
|
173
169
|
if (semver__namespace.lt(this.ctx.grafanaVersion, "11.1.0")) {
|
|
174
|
-
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);
|
|
175
173
|
}
|
|
176
174
|
const evalReq = this.ctx.page.waitForRequest((req) => req.url().includes(this.ctx.selectors.apis.Alerting.eval), {
|
|
177
175
|
timeout: 5e3
|
|
@@ -180,9 +178,7 @@ class AlertRuleEditPage extends GrafanaPage.GrafanaPage {
|
|
|
180
178
|
});
|
|
181
179
|
await evaluateButton.click();
|
|
182
180
|
await evalReq;
|
|
183
|
-
|
|
184
|
-
await this.ctx.page.unroute(this.ctx.selectors.apis.Alerting.eval);
|
|
185
|
-
return response;
|
|
181
|
+
return responsePromise;
|
|
186
182
|
}
|
|
187
183
|
}
|
|
188
184
|
|
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
|
}
|