@camunda/e2e-test-suite 0.0.675 → 0.0.676
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.
|
@@ -13,6 +13,7 @@ declare class IdentityHomePage {
|
|
|
13
13
|
readonly select: Locator;
|
|
14
14
|
constructor(page: Page);
|
|
15
15
|
private selectAllCheckboxes;
|
|
16
|
+
private hasWritePermission;
|
|
16
17
|
private assignPermissions;
|
|
17
18
|
assignPermissionToTasklistAPI(): Promise<void>;
|
|
18
19
|
assignPermissionToOperateAPI(): Promise<void>;
|
|
@@ -47,45 +47,46 @@ class IdentityHomePage {
|
|
|
47
47
|
return false;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
+
async hasWritePermission() {
|
|
51
|
+
return this.page
|
|
52
|
+
.getByRole('cell')
|
|
53
|
+
.filter({ hasText: /^write/ })
|
|
54
|
+
.isVisible();
|
|
55
|
+
}
|
|
50
56
|
async assignPermissions(appCell, apiName) {
|
|
51
57
|
await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, appCell);
|
|
52
58
|
await appCell.click();
|
|
53
59
|
await this.accessToAPIsTab.click();
|
|
54
60
|
await (0, sleep_1.sleep)(2000);
|
|
55
|
-
if (await this.
|
|
56
|
-
.getByRole('cell')
|
|
57
|
-
.filter({ hasText: /^write/ })
|
|
58
|
-
.isVisible()) {
|
|
61
|
+
if (await this.hasWritePermission()) {
|
|
59
62
|
console.log(`Permissions already assigned to ${apiName}`);
|
|
60
63
|
return;
|
|
61
64
|
}
|
|
62
|
-
await this.assignPermissionsButton.click();
|
|
63
|
-
await this.selectOptionFromDropdown(apiName);
|
|
64
|
-
await (0, test_1.expect)(this.dialog).toBeVisible();
|
|
65
|
-
const checked = await this.selectAllCheckboxes(apiName);
|
|
66
|
-
if (!checked) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
await (0, sleep_1.sleep)(1000);
|
|
70
|
-
// Retry clicking Add until the dialog closes — the button can be
|
|
71
|
-
// present but unresponsive if the form hasn't registered the
|
|
72
|
-
// checkbox state yet (seen in docker compose: dialog stays open).
|
|
73
65
|
for (let attempt = 1; attempt <= 3; attempt++) {
|
|
66
|
+
await this.assignPermissionsButton.click();
|
|
67
|
+
await this.selectOptionFromDropdown(apiName);
|
|
68
|
+
await (0, test_1.expect)(this.dialog).toBeVisible();
|
|
69
|
+
const checked = await this.selectAllCheckboxes(apiName);
|
|
70
|
+
if (!checked) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
await (0, sleep_1.sleep)(1000);
|
|
74
|
+
await (0, test_1.expect)(this.addButton).toBeVisible();
|
|
74
75
|
await this.addButton.click();
|
|
75
76
|
try {
|
|
76
77
|
await this.dialog.waitFor({ state: 'hidden', timeout: 5000 });
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
await (0, sleep_1.sleep)(3000);
|
|
79
|
+
return;
|
|
79
80
|
}
|
|
80
81
|
catch {
|
|
81
|
-
console.log(`
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
await (0, sleep_1.sleep)(
|
|
82
|
+
console.log(`Add failed for ${apiName} on attempt ${attempt}, reloading...`);
|
|
83
|
+
await this.page.reload();
|
|
84
|
+
await (0, sleep_1.sleep)(2000);
|
|
85
|
+
await this.accessToAPIsTab.click();
|
|
86
|
+
await (0, sleep_1.sleep)(2000);
|
|
86
87
|
}
|
|
87
88
|
}
|
|
88
|
-
|
|
89
|
+
throw new Error(`Failed to assign permissions for ${apiName} after 3 attempts`);
|
|
89
90
|
}
|
|
90
91
|
async assignPermissionToTasklistAPI() {
|
|
91
92
|
await this.assignPermissions(this.tasklistCell, 'Tasklist API');
|