@camunda/e2e-test-suite 0.0.407 → 0.0.409
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.
|
@@ -2,6 +2,8 @@ import { Page, Locator } from '@playwright/test';
|
|
|
2
2
|
declare class KeycloakAdminPage {
|
|
3
3
|
private page;
|
|
4
4
|
readonly keycloakBanner: Locator;
|
|
5
|
+
readonly addUserButton: Locator;
|
|
6
|
+
readonly credentialsTab: Locator;
|
|
5
7
|
constructor(page: Page);
|
|
6
8
|
toBeVisible(): Promise<void>;
|
|
7
9
|
switchToCamundaPlatform(): Promise<void>;
|
|
@@ -6,9 +6,13 @@ const sleep_1 = require("../../utils/sleep");
|
|
|
6
6
|
class KeycloakAdminPage {
|
|
7
7
|
page;
|
|
8
8
|
keycloakBanner;
|
|
9
|
+
addUserButton;
|
|
10
|
+
credentialsTab;
|
|
9
11
|
constructor(page) {
|
|
10
12
|
this.page = page;
|
|
11
13
|
this.keycloakBanner = page.locator('#kc-main-content-page-container');
|
|
14
|
+
this.addUserButton = page.getByTestId('add-user');
|
|
15
|
+
this.credentialsTab = page.getByTestId('credentials');
|
|
12
16
|
}
|
|
13
17
|
async toBeVisible() {
|
|
14
18
|
await (0, test_1.expect)(this.keycloakBanner).toBeVisible({ timeout: 10000 });
|
|
@@ -34,7 +38,8 @@ class KeycloakAdminPage {
|
|
|
34
38
|
await this.page.click('a[id="nav-item-users"]');
|
|
35
39
|
}
|
|
36
40
|
async clickAddUser() {
|
|
37
|
-
await this.
|
|
41
|
+
await (0, test_1.expect)(this.addUserButton).toBeVisible({ timeout: 30000 });
|
|
42
|
+
await this.addUserButton.click();
|
|
38
43
|
}
|
|
39
44
|
async fillUser(username) {
|
|
40
45
|
await this.page.getByTestId('username').fill(username);
|
|
@@ -48,7 +53,8 @@ class KeycloakAdminPage {
|
|
|
48
53
|
await this.page.getByTestId('user-creation-save').click();
|
|
49
54
|
}
|
|
50
55
|
async fillPassword(password) {
|
|
51
|
-
await this.
|
|
56
|
+
await (0, test_1.expect)(this.credentialsTab).toBeVisible({ timeout: 30000 });
|
|
57
|
+
await this.credentialsTab.click();
|
|
52
58
|
await this.page.getByTestId('no-credentials-empty-action').click();
|
|
53
59
|
await this.page.getByTestId('passwordField').fill(password);
|
|
54
60
|
await this.page.getByTestId('passwordConfirmationField').fill(password);
|
|
@@ -28,6 +28,7 @@ declare class OCIdentityRolesPage {
|
|
|
28
28
|
readonly assignClientsButton: Locator;
|
|
29
29
|
readonly clientIdTextBox: Locator;
|
|
30
30
|
readonly assignClientIdSubButton: Locator;
|
|
31
|
+
readonly notFoundText: Locator;
|
|
31
32
|
constructor(page: Page);
|
|
32
33
|
clickMappingRulesTab(): Promise<void>;
|
|
33
34
|
clickRole(roleID: string): Promise<void>;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OCIdentityRolesPage = void 0;
|
|
4
4
|
const test_1 = require("@playwright/test");
|
|
5
5
|
const UtilitiesPage_1 = require("../SM-8.10/UtilitiesPage");
|
|
6
|
+
const sleep_1 = require("../../utils/sleep");
|
|
6
7
|
class OCIdentityRolesPage {
|
|
7
8
|
page;
|
|
8
9
|
selectResourceTypeTab;
|
|
@@ -32,9 +33,11 @@ class OCIdentityRolesPage {
|
|
|
32
33
|
assignClientsButton;
|
|
33
34
|
clientIdTextBox;
|
|
34
35
|
assignClientIdSubButton;
|
|
36
|
+
notFoundText;
|
|
35
37
|
constructor(page) {
|
|
36
38
|
this.page = page;
|
|
37
39
|
this.rolesList = page.getByRole('table');
|
|
40
|
+
this.notFoundText = page.getByText('404 not found');
|
|
38
41
|
this.selectResourceTypeTab = (resourceType) => page.getByRole('tab', { name: resourceType });
|
|
39
42
|
this.assignMappingRuleButton = page.getByRole('button', {
|
|
40
43
|
name: /^(Assign mapping rule|assignMapping)$/,
|
|
@@ -104,16 +107,43 @@ class OCIdentityRolesPage {
|
|
|
104
107
|
await this.roleCell(roleID).first().click();
|
|
105
108
|
}
|
|
106
109
|
async assignMappingRuleToRole(roleId, mappingId) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
const maxRetries = 3;
|
|
111
|
+
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
112
|
+
await this.clickRole(roleId);
|
|
113
|
+
// After clicking the role, the detail page may show a 404 if the role
|
|
114
|
+
// was just created and the backend hasn't fully provisioned it yet.
|
|
115
|
+
const gotNotFound = await this.notFoundText
|
|
116
|
+
.isVisible({ timeout: 3000 })
|
|
117
|
+
.catch(() => false);
|
|
118
|
+
if (gotNotFound) {
|
|
119
|
+
console.warn(`Attempt ${attempt + 1}: Role detail page returned 404 for "${roleId}", retrying...`);
|
|
120
|
+
await this.page.goBack();
|
|
121
|
+
await (0, sleep_1.sleep)(3000);
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
try {
|
|
125
|
+
await this.clickMappingRulesTab();
|
|
126
|
+
await (0, test_1.expect)(this.assignMappingRuleButton).toBeVisible({
|
|
127
|
+
timeout: 60000,
|
|
128
|
+
});
|
|
129
|
+
await this.assignMappingRuleButton.click({ timeout: 60000 });
|
|
130
|
+
await (0, test_1.expect)(this.assignMappingModal).toBeVisible({ timeout: 60000 });
|
|
131
|
+
await this.mappingSearchBox.fill(mappingId);
|
|
132
|
+
await this.assignMappingModalSearchResult.getByText(mappingId).click();
|
|
133
|
+
await this.assignMappingModalAssignRuleButton.click();
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
if (attempt < maxRetries - 1) {
|
|
138
|
+
console.warn(`Attempt ${attempt + 1} failed to assign mapping rule to role "${roleId}". Retrying...`);
|
|
139
|
+
await this.page.goBack();
|
|
140
|
+
await (0, sleep_1.sleep)(2000);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
throw error;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
117
147
|
}
|
|
118
148
|
async createRole(role) {
|
|
119
149
|
await this.createRoleButton.click();
|