@camunda/e2e-test-suite 0.0.1594 → 0.0.1595

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.
@@ -351,13 +351,49 @@ class ClusterDetailsPage {
351
351
  if (isOn === enabled) {
352
352
  return 'unchanged';
353
353
  }
354
- await this.authorizationsSwitch.click({ timeout: 30000 });
355
- if (await this.dialog.isVisible({ timeout: 15000 }).catch(() => false)) {
354
+ // On SaaS INT the Console PATCH behind the confirm button sometimes fails
355
+ // at the network level: the release trace shows it with no response at
356
+ // all. The dialog then stays open with a "fetch error" alert, and the
357
+ // switch behind it is aria-hidden, so the toggle assertion below could
358
+ // only time out. Cancel, reload the settings route so the cluster data is
359
+ // fetched again (waitForAuthorizationsSection already retries until it
360
+ // renders), and toggle again. If every attempt fails, the assertion below
361
+ // still fails.
362
+ const changeError = this.dialog.getByRole('alert');
363
+ const maxAttempts = 3;
364
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
365
+ await this.authorizationsSwitch.click({ timeout: 30000 });
366
+ if (!(await this.dialog.isVisible({ timeout: 15000 }).catch(() => false))) {
367
+ break;
368
+ }
356
369
  const confirm = enabled ? this.rbaEnableButton : this.rbaDisableButton;
357
370
  if (await confirm.isVisible().catch(() => false)) {
358
371
  await confirm.click({ timeout: 30000 });
359
372
  }
360
373
  await (0, test_1.expect)(this.page.getByText(enabled ? 'Enabling...' : 'Disabling...')).not.toBeVisible({ timeout: 60000 });
374
+ const failed = await changeError
375
+ .waitFor({ state: 'visible', timeout: 5000 })
376
+ .then(() => true)
377
+ .catch(() => false);
378
+ if (!failed || attempt === maxAttempts) {
379
+ break;
380
+ }
381
+ const reason = await changeError.innerText().catch(() => '');
382
+ console.warn(`Authorizations change failed (${reason.trim()}); ` +
383
+ `reloading settings, attempt ${attempt + 1}/${maxAttempts}.`);
384
+ await this.dialog.getByRole('button', { name: 'Cancel' }).click({
385
+ timeout: 30000,
386
+ });
387
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
388
+ await this.settingsTab.waitFor({ state: 'visible', timeout: 60000 });
389
+ await this.clickSettingsTab();
390
+ await this.waitForAuthorizationsSection();
391
+ await (0, test_1.expect)(this.authorizationsSwitch).toBeVisible({ timeout: 60000 });
392
+ const nowOn = (await this.authorizationsSwitch.getAttribute('aria-checked')) ===
393
+ 'true';
394
+ if (nowOn === enabled) {
395
+ break;
396
+ }
361
397
  }
362
398
  await (0, test_1.expect)(this.authorizationsSwitch).toHaveAttribute('aria-checked', String(enabled), { timeout: 120000 });
363
399
  return 'changed';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1594",
3
+ "version": "0.0.1595",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",