@camunda/e2e-test-suite 0.0.1409 → 0.0.1410

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.
@@ -97,14 +97,35 @@ class Authorization {
97
97
  await this.createAuthorizationOwnerOption(authorization.ownerId).click({
98
98
  timeout: 30000,
99
99
  });
100
- await this.createAuthorizationResourceTypeDropdown.click();
101
- await this.createAuthorizationResourceTypeOption(authorization.resourceType).click({ timeout: 30000, force: true });
102
- await this.createAuthorizationResourceIdField.fill(authorization.resourceId);
103
- for (const permission of authorization.accessPermissions) {
104
- await this.createAuthorizationAccessPermission(permission).click({
105
- force: true,
106
- });
107
- }
100
+ // The modal pre-fills the resource type from the active tab, but that can
101
+ // land after it opens, and a forced option click lands on whichever item
102
+ // Downshift has scrolled under the pointer (e.g. MAPPING_RULE instead of
103
+ // COMPONENT). Only open the dropdown when the type is wrong, and confirm
104
+ // the selection via the button's title before moving on.
105
+ await (0, test_1.expect)(async () => {
106
+ const selectedResourceType = await this.createAuthorizationResourceTypeDropdown.getAttribute('title');
107
+ if (selectedResourceType !== authorization.resourceType) {
108
+ await this.createAuthorizationResourceTypeDropdown.click();
109
+ await this.createAuthorizationResourceTypeOption(authorization.resourceType).click({ timeout: 10000 });
110
+ }
111
+ await (0, test_1.expect)(this.createAuthorizationResourceTypeDropdown).toHaveAttribute('title', authorization.resourceType, { timeout: 5000 });
112
+ }).toPass({ timeout: 60000, intervals: [1000, 2000, 5000] });
113
+ // Every resource type change resets Resource ID and the permissions
114
+ // (AddModal's useEffect on resourceType), so a fill made before that
115
+ // effect runs is silently wiped and the submit is rejected with
116
+ // "Resource ID is required". Re-apply until the values stick.
117
+ await (0, test_1.expect)(async () => {
118
+ await this.createAuthorizationResourceIdField.fill(authorization.resourceId);
119
+ for (const permission of authorization.accessPermissions) {
120
+ await this.createAuthorizationAccessPermission(permission).check({
121
+ force: true,
122
+ });
123
+ }
124
+ await (0, test_1.expect)(this.createAuthorizationResourceIdField).toHaveValue(authorization.resourceId, { timeout: 2000 });
125
+ for (const permission of authorization.accessPermissions) {
126
+ await (0, test_1.expect)(this.createAuthorizationAccessPermission(permission)).toBeChecked({ timeout: 2000 });
127
+ }
128
+ }).toPass({ timeout: 60000, intervals: [1000, 2000, 5000] });
108
129
  // Submitting POSTs to the orchestration cluster's Identity API, which
109
130
  // answers 503 while the cluster is still settling. Carbon then leaves the
110
131
  // modal open with the form still filled, so the only thing the old
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1409",
3
+ "version": "0.0.1410",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",