@camunda/e2e-test-suite 0.0.200 → 0.0.201
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.
|
@@ -62,9 +62,7 @@ class Authorization {
|
|
|
62
62
|
this.createAuthorizationModal.getByRole('textbox', {
|
|
63
63
|
name: 'Resource ID',
|
|
64
64
|
});
|
|
65
|
-
this.createAuthorizationAccessPermission = (name) => this.createAuthorizationModal.
|
|
66
|
-
name,
|
|
67
|
-
});
|
|
65
|
+
this.createAuthorizationAccessPermission = (name) => this.createAuthorizationModal.locator(`.cds--checkbox-wrapper label[for="${name}"]`);
|
|
68
66
|
this.createAuthorizationSubmitButton =
|
|
69
67
|
this.createAuthorizationModal.getByRole('button', {
|
|
70
68
|
name: 'Create authorization',
|
|
@@ -97,15 +95,34 @@ class Authorization {
|
|
|
97
95
|
await this.createAuthorizationResourceIdField.fill(authorization.resourceId);
|
|
98
96
|
for (const permission of authorization.accessPermissions) {
|
|
99
97
|
await (0, sleep_1.sleep)(200);
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
98
|
+
const permissionLabel = this.createAuthorizationAccessPermission(permission);
|
|
99
|
+
const permissionInput = this.createAuthorizationModal.locator(`input[id="${permission}"]`);
|
|
100
|
+
await (0, test_1.expect)(permissionLabel).toBeVisible();
|
|
101
|
+
if (!(await permissionInput.isChecked())) {
|
|
102
|
+
await permissionLabel.scrollIntoViewIfNeeded();
|
|
103
|
+
await (0, sleep_1.sleep)(300);
|
|
104
|
+
let clickAttempts = 0;
|
|
105
|
+
const maxAttempts = 3;
|
|
106
|
+
while (!(await permissionInput.isChecked()) &&
|
|
107
|
+
clickAttempts < maxAttempts) {
|
|
108
|
+
clickAttempts++;
|
|
109
|
+
await permissionLabel.click({ force: true });
|
|
110
|
+
await (0, sleep_1.sleep)(500);
|
|
111
|
+
if (await permissionInput.isChecked()) {
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
if (clickAttempts < maxAttempts) {
|
|
115
|
+
await permissionLabel.click();
|
|
116
|
+
await (0, sleep_1.sleep)(300);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
await (0, test_1.expect)(permissionInput).toBeChecked({ timeout: 3000 });
|
|
105
120
|
}
|
|
106
121
|
}
|
|
107
122
|
await this.createAuthorizationSubmitButton.click();
|
|
108
|
-
await (0, test_1.expect)(this.createAuthorizationModal).not.toBeVisible(
|
|
123
|
+
await (0, test_1.expect)(this.createAuthorizationModal).not.toBeVisible({
|
|
124
|
+
timeout: 10000,
|
|
125
|
+
});
|
|
109
126
|
await this.selectResourceTypeTab(authorization.resourceType).click();
|
|
110
127
|
const item = this.page.getByRole('row').filter({
|
|
111
128
|
hasText: `${authorization.ownerId}${authorization.resourceId}`,
|