@camunda/e2e-test-suite 0.0.1068 → 0.0.1069

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.
@@ -43,6 +43,7 @@ declare class OCIdentityRolesPage {
43
43
  }): Promise<void>;
44
44
  private isRolesListOpen;
45
45
  private openRolesList;
46
+ private recoverToRolesList;
46
47
  clickAdminRole(): Promise<void>;
47
48
  assignUserToRole(userId: string): Promise<void>;
48
49
  clickAssignUserButton(): Promise<void>;
@@ -6,7 +6,7 @@ const UtilitiesPage_1 = require("../SM-8.10/UtilitiesPage");
6
6
  const expectLocatorWithPagination_1 = require("../../utils/assertionHelpers/expectLocatorWithPagination");
7
7
  const findLocatorWithPagination_1 = require("../../utils/assertionHelpers/findLocatorWithPagination");
8
8
  const submitModalWithRetry_1 = require("../../utils/assertionHelpers/submitModalWithRetry");
9
- const sleep_1 = require("../../utils/sleep");
9
+ const SEARCH_MAPPING_RULE_LABEL = /^(Search by mapping rule ID|searchByMappingRuleId)$/;
10
10
  class OCIdentityRolesPage {
11
11
  page;
12
12
  selectResourceTypeTab;
@@ -53,11 +53,14 @@ class OCIdentityRolesPage {
53
53
  // (role="combobox"), not the searchbox the pre design-system modal
54
54
  // rendered; the Mapping rules list page keeps a page-level searchbox with
55
55
  // the same accessible name, so scope this to the dialog and accept either
56
- // role.
56
+ // role. The modal's field resolves its placeholder through the
57
+ // `entitySelection` i18n namespace, which carries no `searchByMappingRuleId`
58
+ // entry, so it is labelled with the raw key instead of the translated
59
+ // string the list page renders - match either form.
57
60
  this.mappingSearchBox = this.assignMappingModal
58
- .getByRole('combobox', { name: 'Search by mapping rule ID' })
61
+ .getByRole('combobox', { name: SEARCH_MAPPING_RULE_LABEL })
59
62
  .or(this.assignMappingModal.getByRole('searchbox', {
60
- name: 'Search by mapping rule ID',
63
+ name: SEARCH_MAPPING_RULE_LABEL,
61
64
  }))
62
65
  .first();
63
66
  this.createRoleButton = page.getByRole('button', {
@@ -145,8 +148,7 @@ class OCIdentityRolesPage {
145
148
  .catch(() => false);
146
149
  if (gotNotFound) {
147
150
  console.warn(`Attempt ${attempt + 1}: Role detail page returned 404 for "${roleId}", retrying...`);
148
- await this.page.goBack();
149
- await (0, sleep_1.sleep)(3000);
151
+ await this.recoverToRolesList();
150
152
  continue;
151
153
  }
152
154
  await this.clickMappingRulesTab();
@@ -157,9 +159,13 @@ class OCIdentityRolesPage {
157
159
  await (0, test_1.expect)(this.assignMappingModal).toBeVisible({ timeout: 60000 });
158
160
  // The design-system search input is a cmdk combobox that only issues
159
161
  // its server-side query on real keystrokes, so type the id in rather
160
- // than setting the value in one shot.
161
- await this.mappingSearchBox.click();
162
- await this.mappingSearchBox.pressSequentially(mappingId);
162
+ // than setting the value in one shot. Budgeted like every other step
163
+ // here rather than inheriting the 10s actionTimeout: the field mounts
164
+ // with the dialog it was just asserted visible in.
165
+ await this.mappingSearchBox.click({ timeout: 60000 });
166
+ await this.mappingSearchBox.pressSequentially(mappingId, {
167
+ timeout: 60000,
168
+ });
163
169
  await this.assignMappingRuleOption(mappingId).click({ timeout: 30000 });
164
170
  await this.assignMappingModalAssignRuleButton.click();
165
171
  return;
@@ -167,8 +173,7 @@ class OCIdentityRolesPage {
167
173
  catch (error) {
168
174
  if (attempt < maxRetries - 1) {
169
175
  console.warn(`Attempt ${attempt + 1} failed to assign mapping rule to role "${roleId}". Retrying...`);
170
- await this.page.goBack();
171
- await (0, sleep_1.sleep)(2000);
176
+ await this.recoverToRolesList();
172
177
  }
173
178
  else {
174
179
  throw error;
@@ -249,6 +254,28 @@ class OCIdentityRolesPage {
249
254
  await this.rolesNavTab.click({ timeout });
250
255
  await (0, test_1.expect)(this.createRoleButton.first()).toBeVisible({ timeout });
251
256
  }
257
+ // `page.goBack()` is one history entry, and the role detail page's tab routes
258
+ // are entries of their own, so backing out of a failed assign-mapping step
259
+ // landed on the same role's Users tab - where the next attempt's roles-table
260
+ // lookup could only time out. Re-enter the list through the nav instead, and
261
+ // dismiss the dialog first: an open design-system dialog sets
262
+ // `pointer-events: none` on the body, which makes the nav link unclickable.
263
+ async recoverToRolesList() {
264
+ const modalOpen = await this.assignMappingModal
265
+ .isVisible()
266
+ .catch(() => false);
267
+ if (modalOpen) {
268
+ await this.page.keyboard.press('Escape');
269
+ const closed = await this.assignMappingModal
270
+ .waitFor({ state: 'hidden', timeout: 15000 })
271
+ .then(() => true)
272
+ .catch(() => false);
273
+ if (!closed) {
274
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
275
+ }
276
+ }
277
+ await this.openRolesList(60000);
278
+ }
252
279
  async clickAdminRole() {
253
280
  // The roles table is fetched after the Roles tab click, and other specs in
254
281
  // the nightly add roles that can push `admin` onto a later page, so a bare
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1068",
3
+ "version": "0.0.1069",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",