@camunda/e2e-test-suite 0.0.1298 → 0.0.1300

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.
@@ -796,13 +796,39 @@ class ModelerHomePage {
796
796
  }
797
797
  if ((await scopeFilter.innerText()).includes('All workspaces'))
798
798
  return;
799
- await scopeFilter.click({ timeout: 10000 });
800
- await this.page
801
- .getByRole('option', { name: 'All workspaces' })
802
- .click({ timeout: 10000 });
803
- await (0, test_1.expect)(scopeFilter).toContainText('All workspaces', {
804
- timeout: 10000,
799
+ const allWorkspacesOption = this.page.getByRole('option', {
800
+ name: 'All workspaces',
805
801
  });
802
+ // Without the empty state's button the dropdown is unavoidable, and Radix
803
+ // renders its options in an animated popover that unmounts whenever the
804
+ // workspaces list re-renders under it. A single open-then-click races two
805
+ // ways: "element is not stable" while the popover animates in, and
806
+ // "element was detached from the DOM" when the list refetches beneath an
807
+ // open one. A click that lands on a popover mid-unmount also leaves the
808
+ // filter's own label untouched, so the click alone does not prove the
809
+ // scope committed. Retry the open, the click and the label check together,
810
+ // reopening the popover only when the previous attempt left it closed.
811
+ const maxAttempts = 3;
812
+ let lastError;
813
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
814
+ try {
815
+ if (!(await this.becameVisible(allWorkspacesOption, 1000))) {
816
+ await scopeFilter.click({ timeout: 10000 });
817
+ await (0, test_1.expect)(allWorkspacesOption).toBeVisible({ timeout: 10000 });
818
+ }
819
+ await allWorkspacesOption.click({ timeout: 10000 });
820
+ await (0, test_1.expect)(scopeFilter).toContainText('All workspaces', {
821
+ timeout: 10000,
822
+ });
823
+ return;
824
+ }
825
+ catch (error) {
826
+ lastError = error;
827
+ console.warn(`showAllWorkspaces: attempt ${attempt} of ${maxAttempts} did not ` +
828
+ `commit the "All workspaces" scope. Error: ${error}`);
829
+ }
830
+ }
831
+ throw lastError;
806
832
  }
807
833
  async becameVisible(locator, timeout) {
808
834
  return locator
@@ -53,23 +53,6 @@ export declare const usersApiUnavailable: string | false;
53
53
  */
54
54
  export declare const unauthenticatedAccessAllowed: string | false;
55
55
  export declare const enforcementPrincipalUnavailable: string | false;
56
- /**
57
- * What `PUT /{roles,groups,tenants}/{id}/users/{username}` does when the
58
- * username belongs to nobody.
59
- *
60
- * The engine guards membership with
61
- * `case USER -> !localUserEnabled || userState.getUser(entityId).isPresent()`
62
- * (`RoleAddEntityProcessor`, `GroupAddEntityProcessor`,
63
- * `TenantAddEntityProcessor` in camunda/camunda). With local users disabled
64
- * the left side short-circuits, so the membership is written against the bare
65
- * username and the command is accepted.
66
- *
67
- * That is deliberate — in OIDC mode the cluster has no registry to check a
68
- * username against, and refusing would make it impossible to grant a role to
69
- * an identity-provider user before their first sign-in. So the two modes
70
- * genuinely differ, and the assertion has to follow the mode rather than pick
71
- * one and call the other a bug.
72
- */
73
56
  export declare const absentUserMembership: {
74
57
  status: number;
75
58
  reason: string;
@@ -127,28 +127,56 @@ exports.enforcementPrincipalUnavailable = enforcementUnavailableReason();
127
127
  * The engine guards membership with
128
128
  * `case USER -> !localUserEnabled || userState.getUser(entityId).isPresent()`
129
129
  * (`RoleAddEntityProcessor`, `GroupAddEntityProcessor`,
130
- * `TenantAddEntityProcessor` in camunda/camunda). With local users disabled
131
- * the left side short-circuits, so the membership is written against the bare
132
- * username and the command is accepted.
133
- *
134
- * That is deliberate — in OIDC mode the cluster has no registry to check a
135
- * username against, and refusing would make it impossible to grant a role to
136
- * an identity-provider user before their first sign-in. So the two modes
137
- * genuinely differ, and the assertion has to follow the mode rather than pick
138
- * one and call the other a bug.
130
+ * `TenantAddEntityProcessor` in camunda/camunda). With `localUserEnabled`
131
+ * false the left side short-circuits, so the membership is written against
132
+ * the bare username and the command is accepted.
133
+ *
134
+ * Two independent things can make it false, so this reads as three cases.
135
+ *
136
+ * OIDC: the cluster has no registry to check a username against, and
137
+ * refusing would make it impossible to grant a role to an identity-provider
138
+ * user before their first sign-in. Deliberate, and unchanged across versions.
139
+ *
140
+ * c8Run below 8.9: local users ARE served, yet the answer is still 204. The
141
+ * engine does not read the flag from configuration — it reads
142
+ * `is_camunda_users_enabled` off the command, set by
143
+ * `BrokerRequestAuthorizationConverter.convert`. Because c8Run runs with
144
+ * `camunda.security.authentication.unprotected-api: true`, the `/v2/**`
145
+ * filter chain carries no `.httpBasic(...)` and disables anonymous auth, so
146
+ * the credentials this suite sends are never parsed and every request
147
+ * arrives anonymous. On `stable/8.8` the converter returns early for an
148
+ * anonymous caller and pins the flag to false ("workaround for skip checking
149
+ * existence of user/group during migration", commit e5c3c63). PR #48803
150
+ * (`99b5130`, "fix: existence check for adding members") moved that `put`
151
+ * above the anonymous branch and shipped in 8.9, but was never backported to
152
+ * 8.8 — so on 8.8 the 404 this asserts cannot occur at all.
153
+ *
154
+ * The expectation therefore follows the deployment rather than picking one
155
+ * answer and calling the others a bug. Drop the 8.8 branch if #48803 is ever
156
+ * backported.
139
157
  */
140
- exports.absentUserMembership = config_1.apiConfig.usersApiEnabled
158
+ const MEMBERSHIP_EXISTENCE_CHECK_FROM = '8.9';
159
+ exports.absentUserMembership = !config_1.apiConfig.usersApiEnabled
141
160
  ? {
142
- status: 404,
143
- reason: 'local users are enabled, so the engine checks the username against ' +
144
- 'its user state and rejects an unknown one',
145
- }
146
- : {
147
161
  status: 204,
148
162
  reason: 'the cluster is in OIDC mode: with local users disabled the engine ' +
149
163
  'skips the existence check and stores the membership by username, so ' +
150
164
  'that a role can be granted before the user first signs in',
151
- };
165
+ }
166
+ : (0, config_1.atLeastVersion)(MEMBERSHIP_EXISTENCE_CHECK_FROM)
167
+ ? {
168
+ status: 404,
169
+ reason: 'local users are enabled, so the engine checks the username ' +
170
+ 'against its user state and rejects an unknown one',
171
+ }
172
+ : {
173
+ status: 204,
174
+ reason: 'local users are enabled, but this cluster predates 8.9: it serves ' +
175
+ '/v2 with unprotected-api, so the request arrives anonymous and ' +
176
+ 'BrokerRequestAuthorizationConverter pins is_camunda_users_enabled ' +
177
+ 'to false, which makes the engine skip the existence check — the ' +
178
+ 'fix for that (PR #48803) shipped in 8.9 and was not backported',
179
+ };
152
180
  /**
153
181
  * Statuses that mean "this cluster cannot answer the question", as opposed to
154
182
  * "something is wrong".
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1298",
3
+ "version": "0.0.1300",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",