@camunda/e2e-test-suite 0.0.1538 → 0.0.1539

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.
@@ -22,6 +22,7 @@ declare class AppsPage {
22
22
  private expandHubClusterGroup;
23
23
  private clickHubClusterApp;
24
24
  private hubAppLink;
25
+ goBackToHub(): Promise<void>;
25
26
  isHubClusterAppPresent(clusterName: string, appName: string): Promise<boolean>;
26
27
  clickModeler(): Promise<void>;
27
28
  clickTasklist(clusterName: string): Promise<void>;
@@ -292,12 +292,31 @@ class AppsPage {
292
292
  }))
293
293
  .first();
294
294
  }
295
+ // Returns to the Hub shell after a cluster app was opened.
296
+ // clickHubClusterApp follows the app's href in the CURRENT tab (Hub marks
297
+ // these links target="_blank"), so a caller that opened Operate/Tasklist to
298
+ // check its permission gate is left on operate.*/tasklist.* and has to come
299
+ // back deliberately. goBack() restores the exact Hub route; when the app's
300
+ // own redirects have already replaced that history entry it can land
301
+ // off-Hub, so fall back to the Hub root -- a relative goto() resolves
302
+ // against baseURL, which is Hub. Mirrors pages/8.9/AppsPage.ts
303
+ // goBackToHub().
304
+ async goBackToHub() {
305
+ await this.page.goBack();
306
+ if (!new URL(this.page.url()).hostname.startsWith('hub.')) {
307
+ await this.page.goto('/', { waitUntil: 'domcontentloaded' });
308
+ }
309
+ }
295
310
  // Checks whether an app link is present inside the requested cluster's Hub
296
- // sidebar group, without clicking it. Unlike clickHubClusterApp, absence is
297
- // an expected, valid outcome here -- this is how callers assert per-cluster
298
- // app authorization (e.g. an Analyst-role user should not see Operate),
299
- // which on Hub renders as the link never appearing in the expanded group
300
- // rather than a disabled control -- so this never throws on a miss.
311
+ // sidebar group, without clicking it. Absence is an expected, valid outcome
312
+ // here (unlike clickHubClusterApp), so this never throws on a miss. Note it
313
+ // is NOT an authorization check: camunda-hub's
314
+ // use-organization-environment-sidebar-model.ts states outright that "there
315
+ // is no role gate here" -- the org environment listing is filtered
316
+ // server-side by workspace visibility only, so every environment the viewer
317
+ // can see lists every one of its applications regardless of the viewer's
318
+ // Operate/Tasklist/Optimize permission. A caller proving "this role has no
319
+ // access" must open the app and assert its forbidden page instead.
301
320
  async isHubClusterAppPresent(clusterName, appName) {
302
321
  try {
303
322
  await this.expandHubClusterGroup(clusterName);
@@ -53,8 +53,11 @@ declare class ConsoleOrganizationPage {
53
53
  checkReadPermissionCheckbox(): Promise<void>;
54
54
  checkStartInstancePermissionCheckbox(): Promise<void>;
55
55
  clickUsersTab(): Promise<void>;
56
- clickOptionsButton(): Promise<void>;
57
- clickEditUserMenuItem(): Promise<void>;
56
+ filterTableToUser(username: string): Promise<void>;
57
+ private userRow;
58
+ private rowActionsTrigger;
59
+ clickOptionsButton(username?: string): Promise<void>;
60
+ clickEditUserMenuItem(username?: string): Promise<void>;
58
61
  clickOperationsEngineerCheckbox(): Promise<void>;
59
62
  checkDeveloperCheckbox(): Promise<void>;
60
63
  uncheckDeveloperCheckbox(): Promise<void>;
@@ -243,22 +243,90 @@ class ConsoleOrganizationPage {
243
243
  },
244
244
  });
245
245
  }
246
- async clickOptionsButton() {
247
- const dataRow = this.rows.nth(1);
246
+ // The Users table loads the org member list once per page load and filters
247
+ // it client side -- the trace shows a single /members request per load with
248
+ // no search parameter -- so a member who joined after that fetch is simply
249
+ // not findable, and the table settles on "No results.". filterTable only
250
+ // waits for rows.nth(1), which is still satisfied by the stale pre-filter
251
+ // rows, so the caller would then drive a different user's row. Reload to
252
+ // refetch the member list until the searched user's own row is present.
253
+ async filterTableToUser(username) {
254
+ await (0, test_1.expect)(async () => {
255
+ await this.filterTable([username]);
256
+ const found = await this.userRow(username)
257
+ .waitFor({ state: 'visible', timeout: 10000 })
258
+ .then(() => true)
259
+ .catch(() => false);
260
+ if (!found) {
261
+ await this.page.reload();
262
+ await this.clickUsersTab();
263
+ throw new Error(`Users table has no row for ${username} yet`);
264
+ }
265
+ }).toPass({ timeout: 180000, intervals: [5000, 10000, 15000] });
266
+ }
267
+ // Scoped to the user's own row: the table still lists other members until
268
+ // the client-side filter settles, and an unscoped row would open -- and edit
269
+ // -- the wrong user's menu. Mirrors pages/8.9/ConsoleOrganizationPage.ts.
270
+ userRow(username) {
271
+ return this.rows.filter({ hasText: username }).first();
272
+ }
273
+ // The design-system Users table renders the row kebab with a stable
274
+ // data-slot, but its accessible name is not stable: the a11y tree captured
275
+ // at the failure moment shows the same element as an unnamed
276
+ // `button [expanded]` once its menu is open, so a name-only locator stops
277
+ // resolving in exactly the state the retry loop keeps re-entering. Match the
278
+ // data-slot first and keep the name-based variants for any org still served
279
+ // the older table.
280
+ rowActionsTrigger(row) {
281
+ return row
282
+ .locator('button[data-slot="data-table-actions-trigger"]')
283
+ .or(row.getByRole('button', { name: 'Options' }))
284
+ .or(row.getByRole('button', { name: 'Row actions' }))
285
+ .first();
286
+ }
287
+ async clickOptionsButton(username) {
288
+ const dataRow = username ? this.userRow(username) : this.rows.nth(1);
248
289
  await dataRow.hover({ timeout: 30000 }).catch(() => { });
290
+ const rowOptions = this.rowActionsTrigger(dataRow);
291
+ // A second click on an already-open trigger closes the menu again, and the
292
+ // open menu's overlay blocks the trigger anyway, so only click it closed.
293
+ const alreadyOpen = await rowOptions
294
+ .getAttribute('aria-expanded', { timeout: 10000 })
295
+ .then((value) => value === 'true')
296
+ .catch(() => false);
297
+ if (alreadyOpen) {
298
+ return;
299
+ }
300
+ if (username) {
301
+ await rowOptions.click({ timeout: 30000 });
302
+ return;
303
+ }
249
304
  // Try scoped click first; fall back to page-level with force
250
305
  try {
251
- await dataRow
252
- .getByRole('button', { name: 'Options' })
253
- .or(dataRow.getByRole('button', { name: 'Row actions' }))
254
- .click({ timeout: 30000 });
306
+ await rowOptions.click({ timeout: 30000 });
255
307
  }
256
308
  catch (_e) {
257
309
  await this.optionsButton.first().click({ force: true, timeout: 60000 });
258
310
  }
259
311
  }
260
- async clickEditUserMenuItem() {
261
- await this.editUserMenuItem.click({ timeout: 60000 });
312
+ // The row menu can close under the click when the Users table re-renders
313
+ // ("element was detached from the DOM", after which the item never returns),
314
+ // so reopen the row menu and retry rather than wait on a closed menu. Same
315
+ // recovery as pages/8.9/ConsoleOrganizationPage.ts. The item is also probed
316
+ // for enabled, not just visible: Console renders it aria-disabled when the
317
+ // viewer may not manage org users, and a pinned click would otherwise burn
318
+ // its whole timeout on an element that never becomes actionable.
319
+ async clickEditUserMenuItem(username) {
320
+ await (0, test_1.expect)(async () => {
321
+ const clickable = await this.editUserMenuItem
322
+ .waitFor({ state: 'visible', timeout: 5000 })
323
+ .then(() => this.editUserMenuItem.isEnabled())
324
+ .catch(() => false);
325
+ if (!clickable) {
326
+ await this.clickOptionsButton(username);
327
+ }
328
+ await this.editUserMenuItem.click({ timeout: 10000 });
329
+ }).toPass({ timeout: 90000, intervals: [1000, 2000, 5000] });
262
330
  }
263
331
  async clickOperationsEngineerCheckbox() {
264
332
  await this.operationsEngineerCheckbox.click();
@@ -15,6 +15,15 @@ const resetSession_1 = require("../../utils/resetSession");
15
15
  const users_1 = require("../../utils/users");
16
16
  const node_crypto_1 = require("node:crypto");
17
17
  const testUser = (0, users_1.getTestUser)('eleventhUser');
18
+ // Console's permissions rework gates org user management on the viewer's own
19
+ // org role: an `admin` gets `org.users.admin`/`org.users.owner` all-false in
20
+ // the accounts permissions payload, and the Users tab then renders "Edit
21
+ // user", "Remove" and "Add new user" aria-disabled for every row. Only "User
22
+ // Roles User Flow" edits another member's roles, so it runs as the org owner
23
+ // -- the same actor 8.9/8.10/8.11 access-user-role-management.spec.ts use for
24
+ // these flows. Every other test in this file keeps testUser.
25
+ const orgOwner = (0, users_1.getTestUser)('mainUser');
26
+ const ORG_ROLE_MANAGEMENT_TEST = 'User Roles User Flow';
18
27
  _8_7_1.test.describe.configure({ mode: 'parallel' });
19
28
  _8_7_1.test.describe('Web Modeler User Flow Tests', () => {
20
29
  const clusterName = 'Test Cluster';
@@ -23,7 +32,7 @@ _8_7_1.test.describe('Web Modeler User Flow Tests', () => {
23
32
  'Invite Existing C8 member to Web Modeler flow': '',
24
33
  };
25
34
  _8_7_1.test.beforeEach(async ({ page, loginPage }, testInfo) => {
26
- await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, (testInfo.workerIndex + 1) * 1000);
35
+ await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testInfo.title === ORG_ROLE_MANAGEMENT_TEST ? orgOwner : testUser, (testInfo.workerIndex + 1) * 1000);
27
36
  });
28
37
  _8_7_1.test.afterEach(async ({ page }, testInfo) => {
29
38
  await (0, _setup_1.captureScreenshot)(page, testInfo);
@@ -95,8 +104,7 @@ _8_7_1.test.describe('Web Modeler User Flow Tests', () => {
95
104
  });
96
105
  });
97
106
  });
98
- // Skipped due to bug #64384: https://github.com/camunda/camunda/issues/64384
99
- _8_7_1.test.skip('User Roles User Flow', async ({ page, modelerHomePage, appsPage, consoleOrganizationsPage, settingsPage, loginPage, homePage, modelerCreatePage, }) => {
107
+ (0, _8_7_1.test)('User Roles User Flow', async ({ page, modelerHomePage, appsPage, consoleOrganizationsPage, settingsPage, loginPage, homePage, modelerCreatePage, }) => {
100
108
  _8_7_1.test.slow();
101
109
  const randomString = await (0, _setup_1.generateRandomStringAsync)(3);
102
110
  const processName = 'User Roles User Flow' + randomString;
@@ -111,11 +119,9 @@ _8_7_1.test.describe('Web Modeler User Flow Tests', () => {
111
119
  await _8_7_1.test.step('Change User Roles and Assert This Updates in Web Modeler', async () => {
112
120
  await modelerHomePage.openOrganizationManagement(120000);
113
121
  await consoleOrganizationsPage.clickUsersTab();
114
- await consoleOrganizationsPage.filterTable([
115
- process.env.C8_USERNAME_TEST_3,
116
- ]);
117
- await consoleOrganizationsPage.clickOptionsButton();
118
- await consoleOrganizationsPage.clickEditUserMenuItem();
122
+ await consoleOrganizationsPage.filterTableToUser(process.env.C8_USERNAME_TEST_3);
123
+ await consoleOrganizationsPage.clickOptionsButton(process.env.C8_USERNAME_TEST_3);
124
+ await consoleOrganizationsPage.clickEditUserMenuItem(process.env.C8_USERNAME_TEST_3);
119
125
  await consoleOrganizationsPage.checkAnalystCheckbox();
120
126
  await consoleOrganizationsPage.uncheckDeveloperCheckbox();
121
127
  await consoleOrganizationsPage.clickConfirmButton();
@@ -124,10 +130,10 @@ _8_7_1.test.describe('Web Modeler User Flow Tests', () => {
124
130
  });
125
131
  await settingsPage.clickOpenSettingsButton();
126
132
  await settingsPage.clickLogoutButton();
127
- await loginPage.loginWithTestUser({
133
+ await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, {
128
134
  username: process.env.C8_USERNAME_TEST_3,
129
135
  password: process.env.C8_PASSWORD_TEST_3,
130
- });
136
+ }, 1000);
131
137
  await (0, test_1.expect)(homePage.camundaComponentsButton).toBeVisible({
132
138
  timeout: 60000,
133
139
  });
@@ -143,8 +149,30 @@ _8_7_1.test.describe('Web Modeler User Flow Tests', () => {
143
149
  // (organization-store.saas.ts CLUSTER_OPERATOR_ROLE_IDS), so the
144
150
  // just-downgraded-to-Analyst user here should no longer see it either.
145
151
  await (0, test_1.expect)(appsPage.consoleLink).not.toBeVisible();
146
- await appsPage.assertOperatePresent(clusterName, false);
147
- await appsPage.assertTasklistPresent(clusterName, false);
152
+ // Link absence is no longer a valid proxy for "this role has no access".
153
+ // Hub's Environments sidebar applies no role gate at all -- camunda-hub
154
+ // use-organization-environment-sidebar-model.ts says so in those words,
155
+ // and filters the org listing server-side by workspace visibility only
156
+ // (EnvironmentVisibilityResolver) -- so every environment the viewer can
157
+ // see lists every one of its applications. Run 40496984694's failure
158
+ // snapshot shows exactly that: the just-downgraded Analyst still has
159
+ // Operate, Tasklist and Optimize under "Test Cluster". Prove the gate
160
+ // where it now lives, on the component itself.
161
+ await appsPage.assertOperatePresent(clusterName);
162
+ await appsPage.assertTasklistPresent(clusterName);
163
+ // The denial is Operate/Tasklist rejecting the SSO callback and sending
164
+ // the user to <app>/noPermission through Auth0's /v2/logout?returnTo=...
165
+ // The URL carries it either way: where that returnTo is an allowed
166
+ // logout URL the browser lands on /noPermission, and where it is not
167
+ // (camunda-dev answers 400 invalid_request) it stays on the logout URL
168
+ // whose returnTo is /noPermission. The forbidden page's own text can
169
+ // therefore not be asserted portably.
170
+ await appsPage.clickOperate(clusterName);
171
+ await (0, test_1.expect)(page).toHaveURL(/noPermission/, { timeout: 90000 });
172
+ await appsPage.goBackToHub();
173
+ await appsPage.clickTasklist(clusterName);
174
+ await (0, test_1.expect)(page).toHaveURL(/noPermission/, { timeout: 90000 });
175
+ await appsPage.goBackToHub();
148
176
  await appsPage.clickModeler();
149
177
  await homePage.clickSkipCustomization();
150
178
  await modelerHomePage.createCrossComponentProjectFolder();
@@ -177,7 +205,7 @@ _8_7_1.test.describe('Web Modeler User Flow Tests', () => {
177
205
  });
178
206
  await settingsPage.clickOpenSettingsButton();
179
207
  await settingsPage.clickLogoutButton();
180
- await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, 1000);
208
+ await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, orgOwner, 1000);
181
209
  await (0, sleep_1.sleep)(30000);
182
210
  await appsPage.clickCamundaApps();
183
211
  await appsPage.clickModeler();
@@ -187,11 +215,9 @@ _8_7_1.test.describe('Web Modeler User Flow Tests', () => {
187
215
  await modelerHomePage.clickMessageBanner();
188
216
  await modelerHomePage.openOrganizationManagement(120000);
189
217
  await consoleOrganizationsPage.clickUsersTab();
190
- await consoleOrganizationsPage.filterTable([
191
- process.env.C8_USERNAME_TEST_3,
192
- ]);
193
- await consoleOrganizationsPage.clickOptionsButton();
194
- await consoleOrganizationsPage.clickEditUserMenuItem();
218
+ await consoleOrganizationsPage.filterTableToUser(process.env.C8_USERNAME_TEST_3);
219
+ await consoleOrganizationsPage.clickOptionsButton(process.env.C8_USERNAME_TEST_3);
220
+ await consoleOrganizationsPage.clickEditUserMenuItem(process.env.C8_USERNAME_TEST_3);
195
221
  await consoleOrganizationsPage.uncheckAnalystCheckbox();
196
222
  await consoleOrganizationsPage.checkDeveloperCheckbox();
197
223
  await consoleOrganizationsPage.clickConfirmButton();
@@ -203,10 +229,10 @@ _8_7_1.test.describe('Web Modeler User Flow Tests', () => {
203
229
  });
204
230
  await settingsPage.clickOpenSettingsButton();
205
231
  await settingsPage.clickLogoutButton();
206
- await loginPage.loginWithTestUser({
232
+ await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, {
207
233
  username: process.env.C8_USERNAME_TEST_3,
208
234
  password: process.env.C8_PASSWORD_TEST_3,
209
- });
235
+ }, 1000);
210
236
  await (0, test_1.expect)(homePage.camundaComponentsButton).toBeVisible({
211
237
  timeout: 120000,
212
238
  });
@@ -217,7 +243,14 @@ _8_7_1.test.describe('Web Modeler User Flow Tests', () => {
217
243
  });
218
244
  await appsPage.assertOperatePresent(clusterName);
219
245
  await appsPage.assertTasklistPresent(clusterName);
220
- await appsPage.assertOptimizePresent(clusterName, false);
246
+ // Same ungated Hub sidebar as above: Optimize is listed for this
247
+ // Developer too, so its former `false` expectation asserted nothing real.
248
+ // Unlike Operate and Tasklist there is no component-side gate to assert
249
+ // instead -- 8.7's Optimize ships no forbidden page (no
250
+ // "You don't have access to this component" anywhere under optimize/) --
251
+ // so Developer-vs-Optimize access is deliberately left uncovered here
252
+ // rather than asserted against a page shape nobody has verified.
253
+ await appsPage.assertOptimizePresent(clusterName);
221
254
  await appsPage.clickModeler();
222
255
  await modelerHomePage.clickCrossComponentProjectFolder();
223
256
  await modelerHomePage.clickProcessDiagram(processName);
@@ -233,7 +266,7 @@ _8_7_1.test.describe('Web Modeler User Flow Tests', () => {
233
266
  });
234
267
  await settingsPage.clickOpenSettingsButton();
235
268
  await settingsPage.clickLogoutButton();
236
- await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, 1000);
269
+ await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, orgOwner, 1000);
237
270
  await (0, sleep_1.sleep)(20000);
238
271
  await appsPage.clickCamundaApps();
239
272
  await appsPage.clickModeler();
@@ -243,11 +276,9 @@ _8_7_1.test.describe('Web Modeler User Flow Tests', () => {
243
276
  await modelerHomePage.clickMessageBanner();
244
277
  await modelerHomePage.openOrganizationManagement(60000);
245
278
  await consoleOrganizationsPage.clickUsersTab();
246
- await consoleOrganizationsPage.filterTable([
247
- process.env.C8_USERNAME_TEST_3,
248
- ]);
249
- await consoleOrganizationsPage.clickOptionsButton();
250
- await consoleOrganizationsPage.clickEditUserMenuItem();
279
+ await consoleOrganizationsPage.filterTableToUser(process.env.C8_USERNAME_TEST_3);
280
+ await consoleOrganizationsPage.clickOptionsButton(process.env.C8_USERNAME_TEST_3);
281
+ await consoleOrganizationsPage.clickEditUserMenuItem(process.env.C8_USERNAME_TEST_3);
251
282
  await consoleOrganizationsPage.checkAnalystCheckbox();
252
283
  await consoleOrganizationsPage.clickConfirmButton();
253
284
  await (0, test_1.expect)(page.getByText('Updating...')).not.toBeVisible({
@@ -258,10 +289,10 @@ _8_7_1.test.describe('Web Modeler User Flow Tests', () => {
258
289
  });
259
290
  await settingsPage.clickOpenSettingsButton();
260
291
  await settingsPage.clickLogoutButton();
261
- await loginPage.loginWithTestUser({
292
+ await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, {
262
293
  username: process.env.C8_USERNAME_TEST_3,
263
294
  password: process.env.C8_PASSWORD_TEST_3,
264
- });
295
+ }, 1000);
265
296
  await (0, test_1.expect)(homePage.camundaComponentsButton).toBeVisible({
266
297
  timeout: 120000,
267
298
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1538",
3
+ "version": "0.0.1539",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",