@grafana/plugin-e2e 2.1.9-canary.2051.17231349037.0 → 2.1.9-canary.2053.17260056832.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
|
@@ -427,6 +427,7 @@ declare class AlertRuleQuery extends GrafanaPage {
|
|
|
427
427
|
declare class AlertRuleEditPage extends GrafanaPage {
|
|
428
428
|
readonly ctx: PluginTestCtx;
|
|
429
429
|
readonly args?: AlertRuleArgs | undefined;
|
|
430
|
+
private fullfilled;
|
|
430
431
|
constructor(ctx: PluginTestCtx, args?: AlertRuleArgs | undefined);
|
|
431
432
|
/**
|
|
432
433
|
* Navigates to the annotation edit page. If a dashboard uid was not provided, it's assumed that it's a new dashboard.
|
|
@@ -25,12 +25,16 @@ function _interopNamespaceDefault(e) {
|
|
|
25
25
|
|
|
26
26
|
var semver__namespace = /*#__PURE__*/_interopNamespaceDefault(semver);
|
|
27
27
|
|
|
28
|
+
var __defProp = Object.defineProperty;
|
|
29
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
30
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value);
|
|
28
31
|
const QUERY_AND_EXPRESSION_STEP_ID = "2";
|
|
29
32
|
class AlertRuleEditPage extends GrafanaPage.GrafanaPage {
|
|
30
33
|
constructor(ctx, args) {
|
|
31
34
|
super(ctx, args);
|
|
32
35
|
this.ctx = ctx;
|
|
33
36
|
this.args = args;
|
|
37
|
+
__publicField(this, "fullfilled", false);
|
|
34
38
|
}
|
|
35
39
|
/**
|
|
36
40
|
* Navigates to the annotation edit page. If a dashboard uid was not provided, it's assumed that it's a new dashboard.
|
|
@@ -147,20 +151,21 @@ class AlertRuleEditPage extends GrafanaPage.GrafanaPage {
|
|
|
147
151
|
*/
|
|
148
152
|
async evaluate(options) {
|
|
149
153
|
await this.ctx.page.waitForTimeout(1e3);
|
|
150
|
-
if (
|
|
154
|
+
if (this.fullfilled) {
|
|
151
155
|
await this.ctx.page.unroute(this.ctx.selectors.apis.Alerting.eval);
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
156
|
+
}
|
|
157
|
+
if (semver__namespace.gte(this.ctx.grafanaVersion, "10.0.0")) {
|
|
158
|
+
this.ctx.page.route(this.ctx.selectors.apis.Alerting.eval, async (route) => {
|
|
159
|
+
const response = await route.fetch();
|
|
160
|
+
if (!response.ok()) {
|
|
161
|
+
this.fullfilled = true;
|
|
162
|
+
return route.fulfill({ response });
|
|
157
163
|
}
|
|
158
|
-
let body = await
|
|
164
|
+
let body = await response.json();
|
|
159
165
|
const statuses = Object.keys(body.results).map((key) => body.results[key].status);
|
|
160
|
-
|
|
161
|
-
console.log("statuses", statuses);
|
|
166
|
+
this.fullfilled = true;
|
|
162
167
|
route.fulfill({
|
|
163
|
-
response
|
|
168
|
+
response,
|
|
164
169
|
status: statuses.every((status) => status >= 200 && status < 300) ? 200 : statuses[0]
|
|
165
170
|
});
|
|
166
171
|
});
|
|
@@ -178,11 +183,10 @@ class AlertRuleEditPage extends GrafanaPage.GrafanaPage {
|
|
|
178
183
|
}).catch(async () => {
|
|
179
184
|
await evaluateButton.click();
|
|
180
185
|
});
|
|
186
|
+
await test.expect(evaluateButton).toBeVisible();
|
|
181
187
|
await evaluateButton.click();
|
|
182
188
|
await evalReq;
|
|
183
|
-
|
|
184
|
-
await this.ctx.page.unroute(this.ctx.selectors.apis.Alerting.eval);
|
|
185
|
-
return response;
|
|
189
|
+
return responsePromise;
|
|
186
190
|
}
|
|
187
191
|
}
|
|
188
192
|
|
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.17260056832.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": "e37895f0b543c6dafaea7683deceb9dd13afcf9d"
|
|
51
51
|
}
|