@grafana/plugin-e2e 2.1.9-canary.2053.17260068442.0 → 2.1.9-canary.2053.17260283567.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,20 +151,20 @@ class AlertRuleEditPage extends GrafanaPage.GrafanaPage {
|
|
|
151
151
|
*/
|
|
152
152
|
async evaluate(options) {
|
|
153
153
|
await this.ctx.page.waitForTimeout(1e3);
|
|
154
|
-
if (this.
|
|
154
|
+
if (this.fulfilled) {
|
|
155
155
|
await this.ctx.page.unroute(this.ctx.selectors.apis.Alerting.eval);
|
|
156
|
-
this.
|
|
156
|
+
this.fulfilled = false;
|
|
157
157
|
}
|
|
158
158
|
if (semver__namespace.gte(this.ctx.grafanaVersion, "10.0.0")) {
|
|
159
159
|
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.
|
|
162
|
+
this.fulfilled = true;
|
|
163
163
|
return route.fulfill({ response });
|
|
164
164
|
}
|
|
165
165
|
let body = await response.json();
|
|
166
166
|
const statuses = Object.keys(body.results).map((key) => body.results[key].status);
|
|
167
|
-
this.
|
|
167
|
+
this.fulfilled = true;
|
|
168
168
|
route.fulfill({
|
|
169
169
|
response,
|
|
170
170
|
status: statuses.every((status) => status >= 200 && status < 300) ? 200 : statuses[0]
|
|
@@ -179,12 +179,12 @@ class AlertRuleEditPage extends GrafanaPage.GrafanaPage {
|
|
|
179
179
|
if (semver__namespace.lt(this.ctx.grafanaVersion, "11.1.0")) {
|
|
180
180
|
evaluateButton = this.ctx.page.getByRole("button", { name: "Preview", exact: true });
|
|
181
181
|
}
|
|
182
|
+
await test.expect(evaluateButton).toBeVisible();
|
|
182
183
|
const evalReq = this.ctx.page.waitForRequest((req) => req.url().includes(this.ctx.selectors.apis.Alerting.eval), {
|
|
183
184
|
timeout: 5e3
|
|
184
185
|
}).catch(async () => {
|
|
185
186
|
await evaluateButton.click();
|
|
186
187
|
});
|
|
187
|
-
await test.expect(evaluateButton).toBeVisible();
|
|
188
188
|
await evaluateButton.click();
|
|
189
189
|
await evalReq;
|
|
190
190
|
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.17260283567.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": "3f3f2d74646d1a892750d98bea495b7a7337f728"
|
|
51
51
|
}
|