@grafana/plugin-e2e 2.1.9-canary.2053.17260068442.0 → 2.1.9-canary.2053.17260432343.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,7 +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
|
|
430
|
+
private fulfilled;
|
|
431
431
|
constructor(ctx: PluginTestCtx, args?: AlertRuleArgs | undefined);
|
|
432
432
|
/**
|
|
433
433
|
* Navigates to the annotation edit page. If a dashboard uid was not provided, it's assumed that it's a new dashboard.
|
|
@@ -34,7 +34,7 @@ class AlertRuleEditPage extends GrafanaPage.GrafanaPage {
|
|
|
34
34
|
super(ctx, args);
|
|
35
35
|
this.ctx = ctx;
|
|
36
36
|
this.args = args;
|
|
37
|
-
__publicField(this, "
|
|
37
|
+
__publicField(this, "fulfilled", false);
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Navigates to the annotation edit page. If a dashboard uid was not provided, it's assumed that it's a new dashboard.
|
|
@@ -151,21 +151,22 @@ class AlertRuleEditPage extends GrafanaPage.GrafanaPage {
|
|
|
151
151
|
*/
|
|
152
152
|
async evaluate(options) {
|
|
153
153
|
await this.ctx.page.waitForTimeout(1e3);
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
this.
|
|
154
|
+
console.log({ fulfilled: this.fulfilled });
|
|
155
|
+
if (this.fulfilled) {
|
|
156
|
+
this.fulfilled = false;
|
|
157
157
|
}
|
|
158
158
|
if (semver__namespace.gte(this.ctx.grafanaVersion, "10.0.0")) {
|
|
159
|
-
this.ctx.page.route(this.ctx.selectors.apis.Alerting.eval, async (route) => {
|
|
159
|
+
await this.ctx.page.route(this.ctx.selectors.apis.Alerting.eval, async (route) => {
|
|
160
160
|
const response = await route.fetch();
|
|
161
161
|
if (!response.ok()) {
|
|
162
|
-
this.
|
|
163
|
-
|
|
162
|
+
this.fulfilled = true;
|
|
163
|
+
await route.fulfill({ response });
|
|
164
|
+
return;
|
|
164
165
|
}
|
|
165
166
|
let body = await response.json();
|
|
166
167
|
const statuses = Object.keys(body.results).map((key) => body.results[key].status);
|
|
167
|
-
this.
|
|
168
|
-
route.fulfill({
|
|
168
|
+
this.fulfilled = true;
|
|
169
|
+
await route.fulfill({
|
|
169
170
|
response,
|
|
170
171
|
status: statuses.every((status) => status >= 200 && status < 300) ? 200 : statuses[0]
|
|
171
172
|
});
|
|
@@ -179,12 +180,12 @@ class AlertRuleEditPage extends GrafanaPage.GrafanaPage {
|
|
|
179
180
|
if (semver__namespace.lt(this.ctx.grafanaVersion, "11.1.0")) {
|
|
180
181
|
evaluateButton = this.ctx.page.getByRole("button", { name: "Preview", exact: true });
|
|
181
182
|
}
|
|
183
|
+
await test.expect(evaluateButton).toBeVisible();
|
|
182
184
|
const evalReq = this.ctx.page.waitForRequest((req) => req.url().includes(this.ctx.selectors.apis.Alerting.eval), {
|
|
183
185
|
timeout: 5e3
|
|
184
186
|
}).catch(async () => {
|
|
185
187
|
await evaluateButton.click();
|
|
186
188
|
});
|
|
187
|
-
await test.expect(evaluateButton).toBeVisible();
|
|
188
189
|
await evaluateButton.click();
|
|
189
190
|
await evalReq;
|
|
190
191
|
return responsePromise;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafana/plugin-e2e",
|
|
3
|
-
"version": "2.1.9-canary.2053.
|
|
3
|
+
"version": "2.1.9-canary.2053.17260432343.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": "035c18948b61bd9d13128252ac9b7961b1d12f31"
|
|
51
51
|
}
|