@grafana/plugin-e2e 2.1.9-canary.2051.17213322732.0 → 2.1.9-canary.2051.17231349037.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.
@@ -146,20 +146,21 @@ 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(5e3);
149
+ await this.ctx.page.waitForTimeout(1e3);
150
150
  if (semver__namespace.gte(this.ctx.grafanaVersion, "10.0.0")) {
151
- this.ctx.page.route(this.ctx.selectors.apis.Alerting.eval, async (route) => {
152
- const response = await route.fetch();
153
- if (!response.ok()) {
151
+ await this.ctx.page.unroute(this.ctx.selectors.apis.Alerting.eval);
152
+ await this.ctx.page.route(this.ctx.selectors.apis.Alerting.eval, async (route) => {
153
+ const response2 = await route.fetch();
154
+ if (!response2.ok()) {
154
155
  console.log("response not ok for", this.ctx.selectors.apis.Alerting.eval);
155
- return route.fulfill({ response });
156
+ return route.fulfill({ response: response2 });
156
157
  }
157
- let body = await response.json();
158
+ let body = await response2.json();
158
159
  const statuses = Object.keys(body.results).map((key) => body.results[key].status);
159
160
  console.log("response statuses for", this.ctx.selectors.apis.Alerting.eval);
160
161
  console.log("statuses", statuses);
161
162
  route.fulfill({
162
- response,
163
+ response: response2,
163
164
  status: statuses.every((status) => status >= 200 && status < 300) ? 200 : statuses[0]
164
165
  });
165
166
  });
@@ -173,13 +174,15 @@ class AlertRuleEditPage extends GrafanaPage.GrafanaPage {
173
174
  evaluateButton = this.ctx.page.getByRole("button", { name: "Preview", exact: true });
174
175
  }
175
176
  const evalReq = this.ctx.page.waitForRequest((req) => req.url().includes(this.ctx.selectors.apis.Alerting.eval), {
176
- timeout: 1e4
177
+ timeout: 5e3
177
178
  }).catch(async () => {
178
179
  await evaluateButton.click();
179
180
  });
180
181
  await evaluateButton.click();
181
182
  await evalReq;
182
- return responsePromise;
183
+ const response = await responsePromise;
184
+ await this.ctx.page.unroute(this.ctx.selectors.apis.Alerting.eval);
185
+ return response;
183
186
  }
184
187
  }
185
188
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/plugin-e2e",
3
- "version": "2.1.9-canary.2051.17213322732.0",
3
+ "version": "2.1.9-canary.2051.17231349037.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": "e7ef32428c4fb5e52767853bdc586e08c45a2e54"
50
+ "gitHead": "f6195182ba8431622f5fa5bfdcfe0cc96badea80"
51
51
  }