@camunda/e2e-test-suite 0.0.1490 → 0.0.1492

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.
@@ -6,6 +6,7 @@ declare class OCIdentityRolesPage {
6
6
  readonly mappingSearchBox: Locator;
7
7
  readonly mappingSearchTrigger: Locator;
8
8
  readonly assignMappingModal: Locator;
9
+ readonly assignMappingModalHeading: Locator;
9
10
  readonly assignMappingRuleOption: (name: string) => Locator;
10
11
  readonly assignMappingModalAssignRuleButton: Locator;
11
12
  readonly rolesList: Locator;
@@ -14,6 +14,7 @@ class OCIdentityRolesPage {
14
14
  mappingSearchBox;
15
15
  mappingSearchTrigger;
16
16
  assignMappingModal;
17
+ assignMappingModalHeading;
17
18
  assignMappingRuleOption;
18
19
  assignMappingModalAssignRuleButton;
19
20
  rolesList;
@@ -50,6 +51,9 @@ class OCIdentityRolesPage {
50
51
  this.assignMappingModal = page.getByRole('dialog', {
51
52
  name: 'Assign mapping rule',
52
53
  });
54
+ this.assignMappingModalHeading = this.assignMappingModal
55
+ .getByRole('heading', { name: 'Assign mapping rule' })
56
+ .first();
53
57
  // The design-system modal renders a MultiSelect whose trigger is a
54
58
  // div[role="combobox"], not the searchbox the pre design-system modal
55
59
  // rendered; the Mapping rules list page keeps a page-level searchbox with
@@ -207,6 +211,19 @@ class OCIdentityRolesPage {
207
211
  await (0, test_1.expect)(this.assignMappingModalAssignRuleButton).toBeEnabled({
208
212
  timeout: 30000,
209
213
  });
214
+ // The MultiSelect keeps its result popover open after a pick, and the
215
+ // popover overlaps the modal footer, so the submit click is
216
+ // intercepted by the selected option. Click outside the popover but
217
+ // inside the dialog (its heading) to dismiss only the popover.
218
+ const optionStillOpen = await this.assignMappingRuleOption(mappingId)
219
+ .isVisible()
220
+ .catch(() => false);
221
+ if (optionStillOpen) {
222
+ await this.assignMappingModalHeading.click({ timeout: 30000 });
223
+ await (0, test_1.expect)(this.assignMappingRuleOption(mappingId)).toBeHidden({
224
+ timeout: 30000,
225
+ });
226
+ }
210
227
  await this.assignMappingModalAssignRuleButton.click({ timeout: 30000 });
211
228
  return;
212
229
  }
@@ -288,8 +305,24 @@ class OCIdentityRolesPage {
288
305
  .then(() => true)
289
306
  .catch(() => false);
290
307
  if (!shellVisible) {
291
- await this.page.reload({ waitUntil: 'domcontentloaded' });
292
- await (0, test_1.expect)(this.rolesNavTab).toBeVisible({ timeout });
308
+ // A reload can land on a transient ingress 503 page with no app shell,
309
+ // so reload again with backoff before asserting the nav is back.
310
+ const maxReloads = 3;
311
+ for (let reload = 1; reload <= maxReloads; reload++) {
312
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
313
+ if (reload === maxReloads) {
314
+ await (0, test_1.expect)(this.rolesNavTab).toBeVisible({ timeout });
315
+ break;
316
+ }
317
+ const navBack = await this.rolesNavTab
318
+ .waitFor({ state: 'visible', timeout: Math.min(timeout, 20000) })
319
+ .then(() => true)
320
+ .catch(() => false);
321
+ if (navBack) {
322
+ break;
323
+ }
324
+ await this.page.waitForTimeout(5000 * reload);
325
+ }
293
326
  }
294
327
  await this.rolesNavTab.click({ timeout });
295
328
  await (0, test_1.expect)(this.createRoleButton.first()).toBeVisible({ timeout });
@@ -305,11 +338,16 @@ class OCIdentityRolesPage {
305
338
  .isVisible()
306
339
  .catch(() => false);
307
340
  if (modalOpen) {
308
- await this.page.keyboard.press('Escape');
309
- const closed = await this.assignMappingModal
310
- .waitFor({ state: 'hidden', timeout: 15000 })
311
- .then(() => true)
312
- .catch(() => false);
341
+ // The first Escape only closes the MultiSelect popover when it is open,
342
+ // so press it once more if the dialog is still up.
343
+ let closed = false;
344
+ for (let press = 0; press < 2 && !closed; press++) {
345
+ await this.page.keyboard.press('Escape');
346
+ closed = await this.assignMappingModal
347
+ .waitFor({ state: 'hidden', timeout: press === 0 ? 5000 : 15000 })
348
+ .then(() => true)
349
+ .catch(() => false);
350
+ }
313
351
  if (!closed) {
314
352
  await this.page.reload({ waitUntil: 'domcontentloaded' });
315
353
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1490",
3
+ "version": "0.0.1492",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",