@camunda/e2e-test-suite 0.0.1525 → 0.0.1527

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.
@@ -26,6 +26,7 @@ declare class Authorization {
26
26
  resourceId: string;
27
27
  accessPermissions: string[];
28
28
  }): Promise<void>;
29
+ private fillAuthorizationForm;
29
30
  deleteAuthorization(resourceId: string, resourceType: string): Promise<void>;
30
31
  }
31
32
  export { Authorization };
@@ -92,6 +92,29 @@ class Authorization {
92
92
  });
93
93
  await this.createAuthorizationResourceTypeDropdown.click();
94
94
  await this.createAuthorizationResourceTypeOption(authorization.resourceType).click({ timeout: 30000 });
95
+ // AddModal resets Resource ID and the permission checkboxes in a
96
+ // useEffect whenever the resource type changes. On a slow cluster that
97
+ // reset can land after the form is filled, leaving "Resource ID is
98
+ // required" and the modal open; a 502 from the create call also keeps it
99
+ // open. Re-fill (idempotent) and re-submit until the modal closes.
100
+ await (0, test_1.expect)(async () => {
101
+ if (await this.createAuthorizationModal.isVisible()) {
102
+ await this.fillAuthorizationForm(authorization);
103
+ await this.createAuthorizationSubmitButton.click();
104
+ }
105
+ await (0, test_1.expect)(this.createAuthorizationModal).not.toBeVisible({
106
+ timeout: 10000,
107
+ });
108
+ }).toPass({ timeout: 90000 });
109
+ await this.selectResourceTypeTab(authorization.resourceType).click();
110
+ const item = this.page.getByRole('row').filter({
111
+ hasText: `${authorization.ownerId}${authorization.resourceId}`,
112
+ });
113
+ await this.tableFilter.click();
114
+ await this.tableFilter.fill(authorization.resourceType);
115
+ await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(this.page, item, authorization.resourceType, 5000, false, 10, this.selectResourceTypeTab(authorization.resourceType));
116
+ }
117
+ async fillAuthorizationForm(authorization) {
95
118
  await this.createAuthorizationResourceIdField.fill(authorization.resourceId);
96
119
  for (const permission of authorization.accessPermissions) {
97
120
  await (0, sleep_1.sleep)(200);
@@ -119,17 +142,10 @@ class Authorization {
119
142
  await (0, test_1.expect)(permissionInput).toBeChecked({ timeout: 3000 });
120
143
  }
121
144
  }
122
- await this.createAuthorizationSubmitButton.click();
123
- await (0, test_1.expect)(this.createAuthorizationModal).not.toBeVisible({
124
- timeout: 10000,
125
- });
126
- await this.selectResourceTypeTab(authorization.resourceType).click();
127
- const item = this.page.getByRole('row').filter({
128
- hasText: `${authorization.ownerId}${authorization.resourceId}`,
129
- });
130
- await this.tableFilter.click();
131
- await this.tableFilter.fill(authorization.resourceType);
132
- await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(this.page, item, authorization.resourceType, 5000, false, 10, this.selectResourceTypeTab(authorization.resourceType));
145
+ await (0, test_1.expect)(this.createAuthorizationResourceIdField).toHaveValue(authorization.resourceId);
146
+ for (const permission of authorization.accessPermissions) {
147
+ await (0, test_1.expect)(this.createAuthorizationModal.locator(`input[id="${permission}"]`)).toBeChecked();
148
+ }
133
149
  }
134
150
  async deleteAuthorization(resourceId, resourceType) {
135
151
  await this.deleteAuthorizationButton(resourceId).click();
@@ -126,10 +126,16 @@ class OCIdentityRolesPage {
126
126
  async createRole(role) {
127
127
  await this.createRoleButton.click();
128
128
  await (0, test_1.expect)(this.createRoleModal).toBeVisible();
129
- await this.createIdField.fill(role.id);
130
- await this.createNameField.fill(role.name);
131
- await this.createRoleModalCreateButton.click();
132
- await (0, test_1.expect)(this.createRoleModal).not.toBeVisible();
129
+ // A 502 from POST /v2/roles leaves the modal open with an inline error;
130
+ // re-submit until it closes instead of failing on the first blip.
131
+ await (0, test_1.expect)(async () => {
132
+ if (await this.createRoleModal.isVisible()) {
133
+ await this.createIdField.fill(role.id);
134
+ await this.createNameField.fill(role.name);
135
+ await this.createRoleModalCreateButton.click();
136
+ }
137
+ await (0, test_1.expect)(this.createRoleModal).not.toBeVisible({ timeout: 10000 });
138
+ }).toPass({ timeout: 60000 });
133
139
  // A freshly created role sorts to the end of a table that paginates at 10
134
140
  // rows, so on a cluster that already holds ten roles it lands on page 2.
135
141
  // Polling page 1 can never see it - page through instead.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1525",
3
+ "version": "0.0.1527",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",