@camunda/e2e-test-suite 0.0.685 → 0.0.686

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.
@@ -14,6 +14,7 @@ declare class IdentityHomePage {
14
14
  constructor(page: Page);
15
15
  private selectAllCheckboxes;
16
16
  private hasWritePermission;
17
+ private confirmWritePermissionAssigned;
17
18
  private assignPermissions;
18
19
  assignPermissionToTasklistAPI(): Promise<void>;
19
20
  assignPermissionToOperateAPI(): Promise<void>;
@@ -51,18 +51,40 @@ class IdentityHomePage {
51
51
  return this.page
52
52
  .getByRole('cell')
53
53
  .filter({ hasText: /^write/ })
54
- .isVisible();
54
+ .first()
55
+ .isVisible()
56
+ .catch(() => false);
57
+ }
58
+ // The Identity backend persists the assigned permission even when the Add
59
+ // request returns a transient 404 and the dialog fails to close on its own.
60
+ // The permission then shows up in the table after a short propagation delay,
61
+ // so confirm against the table state (across reloads) rather than relying on
62
+ // the dialog closing.
63
+ async confirmWritePermissionAssigned() {
64
+ for (let i = 0; i < 4; i++) {
65
+ await this.dialog
66
+ .waitFor({ state: 'hidden', timeout: 5000 })
67
+ .catch(() => undefined);
68
+ await this.page.reload();
69
+ await (0, sleep_1.sleep)(2000);
70
+ await this.accessToAPIsTab.click();
71
+ await (0, sleep_1.sleep)(2000);
72
+ if (await this.hasWritePermission()) {
73
+ return true;
74
+ }
75
+ }
76
+ return false;
55
77
  }
56
78
  async assignPermissions(appCell, apiName) {
57
79
  await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, appCell);
58
80
  await appCell.click();
59
81
  await this.accessToAPIsTab.click();
60
82
  await (0, sleep_1.sleep)(2000);
61
- if (await this.hasWritePermission()) {
62
- console.log(`Permissions already assigned to ${apiName}`);
63
- return;
64
- }
65
83
  for (let attempt = 1; attempt <= 3; attempt++) {
84
+ if (await this.hasWritePermission()) {
85
+ console.log(`Permissions already assigned to ${apiName}`);
86
+ return;
87
+ }
66
88
  await this.assignPermissionsButton.click();
67
89
  await this.selectOptionFromDropdown(apiName);
68
90
  await (0, test_1.expect)(this.dialog).toBeVisible();
@@ -73,18 +95,14 @@ class IdentityHomePage {
73
95
  await (0, sleep_1.sleep)(1000);
74
96
  await (0, test_1.expect)(this.addButton).toBeVisible();
75
97
  await this.addButton.click();
76
- try {
77
- await this.dialog.waitFor({ state: 'hidden', timeout: 5000 });
78
- await (0, sleep_1.sleep)(3000);
98
+ if (await this.confirmWritePermissionAssigned()) {
99
+ console.log(`Permissions assigned to ${apiName}`);
79
100
  return;
80
101
  }
81
- catch {
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);
87
- }
102
+ console.log(`Add not confirmed for ${apiName} on attempt ${attempt}, retrying...`);
103
+ }
104
+ if (await this.hasWritePermission()) {
105
+ return;
88
106
  }
89
107
  throw new Error(`Failed to assign permissions for ${apiName} after 3 attempts`);
90
108
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.685",
3
+ "version": "0.0.686",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",