@camunda/e2e-test-suite 0.0.1694 → 0.0.1696

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.
Files changed (54) hide show
  1. package/dist/fixtures/SM-8.10.d.ts +1 -0
  2. package/dist/fixtures/SM-8.10.js +36 -0
  3. package/dist/fixtures/SM-8.11.d.ts +1 -0
  4. package/dist/fixtures/SM-8.11.js +36 -0
  5. package/dist/fixtures/SM-8.8.d.ts +1 -0
  6. package/dist/fixtures/SM-8.8.js +36 -0
  7. package/dist/fixtures/SM-8.9.d.ts +1 -0
  8. package/dist/fixtures/SM-8.9.js +36 -0
  9. package/dist/pages/8.11/ClusterDetailsPage.d.ts +8 -1
  10. package/dist/pages/8.11/ClusterDetailsPage.js +32 -5
  11. package/dist/pages/8.11/ClusterPage.d.ts +42 -2
  12. package/dist/pages/8.11/ClusterPage.js +228 -31
  13. package/dist/pages/SM-8.10/KeycloakUtils.js +1 -0
  14. package/dist/pages/SM-8.10/ManagementIdentityPage.d.ts +1 -0
  15. package/dist/pages/SM-8.10/ManagementIdentityPage.js +9 -0
  16. package/dist/pages/SM-8.10/OCIdentityClusterVariablesPage.d.ts +5 -5
  17. package/dist/pages/SM-8.10/OCIdentityClusterVariablesPage.js +22 -12
  18. package/dist/pages/SM-8.10/OperateHomePage.js +4 -2
  19. package/dist/pages/SM-8.10/TaskPanelPage.d.ts +1 -1
  20. package/dist/pages/SM-8.10/TaskPanelPage.js +6 -5
  21. package/dist/pages/SM-8.11/KeycloakUtils.js +1 -0
  22. package/dist/pages/SM-8.11/ManagementIdentityPage.d.ts +1 -0
  23. package/dist/pages/SM-8.11/ManagementIdentityPage.js +9 -0
  24. package/dist/pages/SM-8.11/OCIdentityClusterVariablesPage.d.ts +5 -5
  25. package/dist/pages/SM-8.11/OCIdentityClusterVariablesPage.js +22 -12
  26. package/dist/pages/SM-8.11/OperateHomePage.js +4 -2
  27. package/dist/pages/SM-8.11/TaskPanelPage.d.ts +1 -1
  28. package/dist/pages/SM-8.11/TaskPanelPage.js +6 -5
  29. package/dist/pages/SM-8.9/OCIdentityClusterVariablesPage.js +3 -1
  30. package/dist/resources/cluster_variables/cluster_variable_tenant_json_readonly.bpmn +4 -4
  31. package/dist/resources/cluster_variables/cluster_variable_tenant_string_readonly.bpmn +4 -4
  32. package/dist/tests/8.10/optimize-api-tests.spec.js +78 -41
  33. package/dist/tests/8.10/optimize-collections-api.spec.js +4 -2
  34. package/dist/tests/8.10/optimize-sharing-alerts-export-api.spec.js +10 -5
  35. package/dist/tests/8.10/optimize-sharing-alerts-export-ui.spec.js +6 -3
  36. package/dist/tests/8.11/console-cluster-duplication-api-clients.spec.d.ts +1 -0
  37. package/dist/tests/8.11/console-cluster-duplication-api-clients.spec.js +154 -0
  38. package/dist/tests/8.11/console-cluster-duplication.spec.d.ts +1 -0
  39. package/dist/tests/8.11/console-cluster-duplication.spec.js +460 -0
  40. package/dist/tests/SM-8.10/cluster-variables-tenant.spec.d.ts +1 -0
  41. package/dist/tests/SM-8.10/cluster-variables-tenant.spec.js +198 -0
  42. package/dist/tests/SM-8.10/optimize-api-tests.spec.d.ts +1 -0
  43. package/dist/tests/SM-8.10/optimize-api-tests.spec.js +468 -0
  44. package/dist/tests/SM-8.11/cluster-variables-tenant.spec.d.ts +1 -0
  45. package/dist/tests/SM-8.11/cluster-variables-tenant.spec.js +198 -0
  46. package/dist/tests/SM-8.11/optimize-api-tests.spec.d.ts +1 -0
  47. package/dist/tests/SM-8.11/optimize-api-tests.spec.js +468 -0
  48. package/dist/tests/SM-8.9/cluster-variables-tenant.spec.js +2 -2
  49. package/dist/utils/apiHelpers.d.ts +4 -0
  50. package/dist/utils/apiHelpers.js +29 -4
  51. package/package.json +1 -1
  52. package/playwright.config.ts +104 -0
  53. package/resources/cluster_variables/cluster_variable_tenant_json_readonly.bpmn +4 -4
  54. package/resources/cluster_variables/cluster_variable_tenant_string_readonly.bpmn +4 -4
@@ -4,6 +4,7 @@ exports.ClusterPage = void 0;
4
4
  const test_1 = require("@playwright/test");
5
5
  const sleep_1 = require("../../utils/sleep");
6
6
  const clickLocatorWithRetry_1 = require("../../utils/assertionHelpers/clickLocatorWithRetry");
7
+ const findLocatorWithPagination_1 = require("../../utils/assertionHelpers/findLocatorWithPagination");
7
8
  class ClusterPage {
8
9
  page;
9
10
  defaultClusterType = 'G3-Dev';
@@ -29,6 +30,7 @@ class ClusterPage {
29
30
  clusterVersionOption;
30
31
  generationSearchInput;
31
32
  g3DevClusterType;
33
+ clusterRegion;
32
34
  alphaTab;
33
35
  devTab;
34
36
  stableTab;
@@ -131,7 +133,12 @@ class ClusterPage {
131
133
  // deleteCluster needs it -- while everything that means "the one cluster
132
134
  // under test" goes through this single row, so a duplicate can no longer
133
135
  // turn an ordinary visibility check into a strict-mode violation.
134
- this.clusterRow = (clusterName) => this.cluster(clusterName).first();
136
+ // createCluster's pre-clean leaves same-named rows in "Deleting" for
137
+ // minutes, and they can sort above the new cluster; that row never shows
138
+ // Creating/Healthy, so it must not be picked as the cluster under test.
139
+ this.clusterRow = (clusterName) => this.cluster(clusterName)
140
+ .filter({ hasNotText: /Deleting/ })
141
+ .first();
135
142
  this.clusterHealthiness = (clusterName) => this.clusterRow(clusterName).getByText(`Healthy`, {
136
143
  exact: true,
137
144
  });
@@ -141,6 +148,7 @@ class ClusterPage {
141
148
  });
142
149
  this.dialog = page.getByRole('dialog');
143
150
  this.clusterVersion = (clusterName, versionText) => this.clusterRow(clusterName).getByText(versionText, { exact: false });
151
+ this.clusterRegion = (clusterName, regionText) => this.clusterRow(clusterName).getByText(regionText, { exact: false });
144
152
  }
145
153
  async clickClusterBanner() {
146
154
  // Camunda Hub has no `banner` landmark; "Clusters" instead lives in its
@@ -201,35 +209,118 @@ class ClusterPage {
201
209
  }
202
210
  }
203
211
  async deleteCluster(name) {
204
- await this.page.waitForTimeout(1000);
205
- const clusterInstance = this.cluster(name).first();
206
- if ((await clusterInstance.count()) <= 0) {
212
+ // A full reload in the Hub shell bounces through /login, the identity
213
+ // provider and /login-callback (~35s) before the SPA pushes its returnUrl
214
+ // back to /clusters. Counting rows mid-bounce throws "Execution context
215
+ // was destroyed", so wait for the clusters page to have settled first.
216
+ await this.page.waitForURL((url) => /\/clusters\/?$/.test(url.pathname), {
217
+ timeout: 120000,
218
+ });
219
+ await (0, test_1.expect)(this.createNewClusterButton).toBeVisible({ timeout: 60000 });
220
+ // Hub's clusters data table renders skeleton rows (no links) while it
221
+ // fetches, and the "Create new cluster" button is visible before the data
222
+ // arrives. Counting matching rows at that point always returned 0, so the
223
+ // pre-clean was skipped and every run left one more same-named cluster
224
+ // behind until the org ran out of G3-Dev reservations (the type tile then
225
+ // renders disabled). Wait for the first loaded row before counting.
226
+ await this.clustersList
227
+ .getByRole('link')
228
+ .first()
229
+ .waitFor({ timeout: 30000 })
230
+ .catch(() => false);
231
+ // Rows whose deletion is already in progress keep the name until the
232
+ // backend removes them; exclude them so the loop does not revisit them.
233
+ const deletableRows = () => this.clustersList
234
+ .filter({
235
+ has: this.page.getByRole('link', { name, exact: true }),
236
+ })
237
+ .filter({ hasNotText: /Deleting/ });
238
+ // The table only renders one page, so a matching row on a later page
239
+ // counts as 0 here. Walk forward through the pages before concluding the
240
+ // cluster is absent; rows on pages already walked cannot gain a match,
241
+ // because deleting a row only pulls later rows back onto the current page.
242
+ const hasDeletableRow = async () => (await deletableRows().count()) > 0 ||
243
+ (0, findLocatorWithPagination_1.findLocatorWithPagination)(this.page, deletableRows().first(), {
244
+ timeout: 60000,
245
+ });
246
+ if (!(await hasDeletableRow())) {
207
247
  console.log(`No clusters found with name ${name}, skipping deletion.`);
208
248
  return;
209
249
  }
210
- await clusterInstance.waitFor({ timeout: 10000 });
211
- let deleteButtons = this.cluster(name).getByRole('button', {
212
- name: 'Delete',
213
- });
214
- while ((await deleteButtons.count()) > 0) {
215
- const deleteButton = deleteButtons.nth(0);
216
- if (await deleteButton.isVisible()) {
217
- try {
218
- await deleteButton.click({ force: true, timeout: 60000 });
219
- }
220
- catch (error) {
221
- await this.clickClusterBanner();
222
- await (0, test_1.expect)(deleteButton).toBeVisible({ timeout: 60000 });
223
- await deleteButton.click({ force: true, timeout: 60000 });
224
- }
225
- await this.confirmClusterDeletion();
226
- // Refresh the list of delete buttons
227
- deleteButtons = this.cluster(name).getByRole('button', {
228
- name: 'Delete',
250
+ // Legacy Console rendered a per-row "Delete" button; Hub's design-system
251
+ // data table instead puts it in the row's "Row actions" kebab menu.
252
+ const deleteMenuItem = this.page.getByRole('menuitem', { name: /^Delete/ });
253
+ const confirmInput = this.confirmDeleteInput.or(this.dialog.getByRole('textbox'));
254
+ const maxDeletions = 50;
255
+ for (let i = 0; i < maxDeletions; i++) {
256
+ if (!(await hasDeletableRow()))
257
+ break;
258
+ const row = deletableRows().first();
259
+ const rowAction = row
260
+ .getByRole('button', { name: 'Delete' })
261
+ .or(row.getByRole('button', { name: 'Row actions', exact: true }));
262
+ try {
263
+ await (0, test_1.expect)(rowAction).toBeVisible({ timeout: 10000 });
264
+ }
265
+ catch {
266
+ // A cluster in a transient state (e.g. just created by a concurrent
267
+ // setup worker) may have its row present before the action renders.
268
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
269
+ await this.clustersList.getByRole('link').first().waitFor({
270
+ timeout: 30000,
229
271
  });
272
+ continue;
273
+ }
274
+ // Rows share the cluster name, so remember this row's unique link (it
275
+ // carries the cluster id) to recognise when this cluster is gone.
276
+ const clusterHref = await row
277
+ .getByRole('link', { name, exact: true })
278
+ .getAttribute('href');
279
+ await rowAction.click({ timeout: 60000 });
280
+ // isVisible() does not wait, so a kebab menu that opens a moment after
281
+ // the click was missed and the confirm dialog never appeared. Wait for
282
+ // either the menu item (Hub) or the dialog (legacy per-row button).
283
+ await (0, test_1.expect)(deleteMenuItem.or(this.dialog)).toBeVisible({
284
+ timeout: 30000,
285
+ });
286
+ if (await deleteMenuItem.isVisible()) {
287
+ // Radix renders the menu at `translate(0, -200%)` until it has
288
+ // positioned it against the trigger (@radix-ui/react-popper). When
289
+ // that never happens the item is visible but outside the viewport, and
290
+ // a pointer click retried for the full 30s without landing. Enter on
291
+ // the item is the same selection: Radix's MenuItem turns it into a
292
+ // click.
293
+ await deleteMenuItem.press('Enter', { timeout: 30000 });
230
294
  }
295
+ await (0, test_1.expect)(this.dialog).toBeVisible({ timeout: 60000 });
296
+ await (0, test_1.expect)(confirmInput.first()).toBeVisible({ timeout: 60000 });
297
+ await confirmInput.first().fill('DELETE', { timeout: 60000 });
298
+ await this.dangerDeleteButton.last().click({ timeout: 60000 });
299
+ // When a concurrent worker already deleted this same cluster, the modal
300
+ // stays open with "We're having trouble deleting the cluster". Close it;
301
+ // the row check below still fails if the cluster was not removed.
302
+ const deleteError = this.dialog.getByText("We're having trouble deleting the cluster");
303
+ // The alert only renders once the delete request fails, so wait for the
304
+ // modal to either close or show it rather than probing once.
305
+ await (0, test_1.expect)(async () => {
306
+ const closed = !(await this.dialog.isVisible());
307
+ (0, test_1.expect)(closed || (await deleteError.isVisible())).toBe(true);
308
+ }).toPass({ timeout: 60000 });
309
+ if (await deleteError.isVisible()) {
310
+ await this.dialog.getByRole('button', { name: 'Cancel' }).click();
311
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
312
+ await this.clustersList.getByRole('link').first().waitFor({
313
+ timeout: 120000,
314
+ });
315
+ }
316
+ await (0, test_1.expect)(this.dialog).not.toBeVisible({ timeout: 60000 });
317
+ // Wait until the deleted row is gone or flagged as deleting. The table
318
+ // is paginated, so the row count alone does not drop: the next page's
319
+ // rows slide in to fill the gap.
320
+ await (0, test_1.expect)(this.clustersList
321
+ .filter({ has: this.page.locator(`a[href="${clusterHref}"]`) })
322
+ .filter({ hasNotText: /Deleting/ })).toHaveCount(0, { timeout: 60000 });
231
323
  }
232
- await this.page.waitForTimeout(500);
233
324
  }
234
325
  async clickClusterTab() {
235
326
  await Promise.race([
@@ -248,11 +339,74 @@ class ClusterPage {
248
339
  },
249
340
  });
250
341
  }
342
+ /**
343
+ * No recovery between attempts, deliberately.
344
+ *
345
+ * clickLocatorWithRetry used to run clickClusterBanner() here, which
346
+ * navigates to the cluster list. That cannot help on either form this is
347
+ * reached from, because the retry loop retries only the click and never
348
+ * reopens the form it navigated away from:
349
+ *
350
+ * - the duplication form is reached from a cluster's overflow menu, so
351
+ * the list is a different page and the input is gone (DUP-01, run
352
+ * 41840910661);
353
+ * - createCluster() opens the create form once before awaiting this, so
354
+ * the list is a different page there too (DUP-02, run 41988552631).
355
+ *
356
+ * Both failed as "Failed to click locator getByPlaceholder('Enter a name
357
+ * for the cluster') after 3 attempts": one recoverable slow render, then
358
+ * two attempts that could not succeed. Retrying in place costs the same
359
+ * time and can actually find the input.
360
+ */
251
361
  async clickClusterNameInput() {
252
- await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.clusterNameInput, {
253
- postAction: async () => {
362
+ await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.clusterNameInput);
363
+ }
364
+ /**
365
+ * Runs `open` until the cluster form's name input is on screen and stays
366
+ * there. A Console refetch can re-render the page right after the form
367
+ * opens and drop it again (DUP-02/DUP-06, run 44125578620: the snapshot
368
+ * shows the clusters list, no form), and clicking the input in place
369
+ * cannot bring the form back, so the opener itself is retried.
370
+ */
371
+ async openClusterForm(open) {
372
+ const maxOpens = 4;
373
+ for (let attempt = 1; attempt <= maxOpens; attempt++) {
374
+ await open();
375
+ const shown = await this.clusterNameInput
376
+ .waitFor({ state: 'visible', timeout: 30000 })
377
+ .then(() => true, () => false);
378
+ const vanished = shown &&
379
+ (await this.clusterNameInput
380
+ .waitFor({ state: 'hidden', timeout: 5000 })
381
+ .then(() => true, () => false));
382
+ if (shown && !vanished) {
383
+ return;
384
+ }
385
+ console.warn(`openClusterForm: cluster name input ${shown ? 'closed on its own' : 'never appeared'} (open ${attempt}/${maxOpens}); reopening`);
386
+ }
387
+ throw new Error(`Cluster form did not stay open after ${maxOpens} opens`);
388
+ }
389
+ /**
390
+ * Opens the duplication form of `sourceClusterName` from its details page.
391
+ * When the details page is gone (the form dropped back to the list), it is
392
+ * reached again first; `onDetailsPage` runs once it has loaded.
393
+ */
394
+ async openDuplicateClusterForm(sourceClusterName, onDetailsPage = async () => { }) {
395
+ const clusterOperations = this.page.getByRole('button', {
396
+ name: 'cluster operations',
397
+ });
398
+ const duplicateAction = this.page
399
+ .getByRole('menuitem', { name: /duplicate/i })
400
+ .or(this.page.getByRole('button', { name: /duplicate/i }));
401
+ await this.openClusterForm(async () => {
402
+ if (!(await clusterOperations.isVisible())) {
254
403
  await this.clickClusterBanner();
255
- },
404
+ await this.clickClusterLink(sourceClusterName);
405
+ await onDetailsPage();
406
+ }
407
+ await clusterOperations.click({ timeout: 30000 });
408
+ await (0, test_1.expect)(duplicateAction).toBeVisible({ timeout: 30000 });
409
+ await duplicateAction.click();
256
410
  });
257
411
  }
258
412
  // The Console's "Select cloud provider" radiogroup now names its options
@@ -283,18 +437,19 @@ class ClusterPage {
283
437
  console.warn(`⚠️ Could not extract cluster info for "${clusterName}": ${error}`);
284
438
  }
285
439
  }
286
- async createCluster(name, region = 'GCP', tasklistV1Api) {
440
+ async createCluster(name, region = 'GCP', tasklistV1Api, subRegion) {
287
441
  await this.clickClusterTab();
288
442
  await this.deleteCluster(name);
289
- await this.clickCreateNewClusterButton();
443
+ await this.openClusterForm(() => this.clickCreateNewClusterButton());
290
444
  await this.clickClusterNameInput();
291
445
  await this.fillClusterNameInput(name);
292
446
  await this.clickClusterType();
293
447
  await this.cloudProviderOption(region).click();
294
- await this.selectSubRegion(region);
448
+ await this.selectSubRegion(region, subRegion);
295
449
  await this.clickClusterOption();
296
450
  await this.determineTasklistAPI(tasklistV1Api);
297
451
  await this.clickCreateClusterButton();
452
+ await this.assertClusterFormSubmitted(name);
298
453
  await this.logClusterCreationInfo(name);
299
454
  await this.clickClustersBreadcrumb(name);
300
455
  }
@@ -319,6 +474,26 @@ class ClusterPage {
319
474
  async clickCreateClusterButton() {
320
475
  await this.createClusterButton.click();
321
476
  }
477
+ /**
478
+ * Fails at the submit when the create form is still open a minute later,
479
+ * with the form's own error text, instead of letting clickClustersBreadcrumb
480
+ * wait out 90s for a row that was never created.
481
+ */
482
+ async assertClusterFormSubmitted(name) {
483
+ const closed = await this.clusterNameInput
484
+ .waitFor({ state: 'hidden', timeout: 60000 })
485
+ .then(() => true, () => false);
486
+ if (closed) {
487
+ return;
488
+ }
489
+ const formErrors = await this.page
490
+ .getByRole('alert')
491
+ .or(this.page.locator('.cds--form-requirement'))
492
+ .allInnerTexts()
493
+ .catch(() => []);
494
+ const detail = formErrors.map((text) => text.trim()).filter(Boolean);
495
+ throw new Error(`Create cluster form for "${name}" was still open 60s after submit: ${detail.length > 0 ? detail.join(' | ') : 'no form error shown'}`);
496
+ }
322
497
  async clickClustersBreadcrumb(clusterName) {
323
498
  // Scope the status check to the cluster's own row instead of matching the
324
499
  // status text anywhere on the page: a page-wide `getByText` regex also
@@ -618,7 +793,29 @@ class ClusterPage {
618
793
  async clickQAGenerationsTab() {
619
794
  await this.qaGenerationsTab.click();
620
795
  }
621
- async selectSubRegion(region) {
796
+ async selectSubRegion(region, subRegion) {
797
+ // An explicit sub-region makes the choice reproducible. The default below
798
+ // picks at random, which is right for a test that only needs *a* cluster
799
+ // but wrong for one that has to know which region the cluster is in --
800
+ // console-cluster-duplication asserts that an overridden region beat the
801
+ // carried-over one, and a random source region can collide with the
802
+ // override and make that assertion vacuous.
803
+ if (subRegion) {
804
+ const known = {
805
+ Belgium: this.belgiumRegion,
806
+ Finland: this.finlandRegion,
807
+ London: this.londonRegion,
808
+ Ohio: this.ohioRegion,
809
+ };
810
+ const locator = known[subRegion];
811
+ if (!locator) {
812
+ throw new Error(`Unknown sub-region "${subRegion}". Known: ${Object.keys(known).join(', ')}`);
813
+ }
814
+ console.log(`Selected region: ${subRegion}`);
815
+ await (0, test_1.expect)(locator).toBeVisible({ timeout: 20000 });
816
+ await locator.click();
817
+ return;
818
+ }
622
819
  if (region === 'GCP') {
623
820
  if (process.env.IS_PROD == 'true') {
624
821
  await (0, test_1.expect)(this.londonRegion).toBeVisible({ timeout: 20000 });
@@ -85,6 +85,7 @@ const createIdentityUser = async (navigationPage, managementIdentity, username)
85
85
  await managementIdentity.clickIdentityCheckbox();
86
86
  await managementIdentity.clickOrchestrationCheckbox();
87
87
  await managementIdentity.clickAddButton();
88
+ await managementIdentity.waitForRolesAssigned();
88
89
  };
89
90
  const createOCUser = async (navigationPage, ocIdentityHomePage, ocIdentityRolesPage, username) => {
90
91
  await navigationPage.goToOCAdmin();
@@ -31,6 +31,7 @@ declare class ManagementIdentityPage {
31
31
  clickConfirmDeleteButton(): Promise<void>;
32
32
  clickAssignRolesButton(): Promise<void>;
33
33
  clickAddButton(): Promise<void>;
34
+ waitForRolesAssigned(): Promise<void>;
34
35
  clickOptimizeCheckbox(): Promise<void>;
35
36
  clickModelerCheckbox(): Promise<void>;
36
37
  clickIdentityCheckbox(): Promise<void>;
@@ -145,6 +145,15 @@ class ManagementIdentityPage {
145
145
  async clickAddButton() {
146
146
  await this.addButton.click();
147
147
  }
148
+ // The role-assignment POSTs are only guaranteed to land once the assigned
149
+ // roles table shows them. Navigating away earlier aborts them on Firefox,
150
+ // where they go through a context.route() rather than Identity's service
151
+ // worker, and the user is then left without ManagementIdentity access.
152
+ async waitForRolesAssigned() {
153
+ await (0, test_1.expect)(this.page
154
+ .getByRole('table')
155
+ .getByText('Provides full access to Management Identity')).toBeVisible({ timeout: 60000 });
156
+ }
148
157
  async clickOptimizeCheckbox() {
149
158
  await this.optimizeCheckbox.click();
150
159
  }
@@ -2,13 +2,13 @@ import { Page, Locator } from '@playwright/test';
2
2
  export declare class OCIdentityClusterVariablesPage {
3
3
  private page;
4
4
  readonly variablesList: Locator;
5
- readonly editVariableButton: (variableName: string) => Locator;
5
+ readonly editVariableButton: (variableName: string, scope?: string) => Locator;
6
6
  readonly editVariableModal: Locator;
7
7
  readonly variableValueField: Locator;
8
8
  readonly saveVariableButton: Locator;
9
9
  readonly closeEditVariableModal: Locator;
10
10
  readonly cancelButton: Locator;
11
- readonly variableRow: (variableName: string) => Locator;
11
+ readonly variableRow: (variableName: string, scope?: string) => Locator;
12
12
  readonly monacoEditor: Locator;
13
13
  readonly monacoEditorTextArea: Locator;
14
14
  readonly monacoSuggestWidget: Locator;
@@ -16,7 +16,7 @@ export declare class OCIdentityClusterVariablesPage {
16
16
  readonly editMenuItem: Locator;
17
17
  readonly editModalHeading: Locator;
18
18
  constructor(page: Page);
19
- editVariable(variableName: string, newValue: string): Promise<void>;
20
- assertVariableExists(variableName: string): Promise<void>;
21
- assertVariableValue(variableName: string, expectedValue: string): Promise<void>;
19
+ editVariable(variableName: string, newValue: string, scope?: string): Promise<void>;
20
+ assertVariableExists(variableName: string, scope?: string): Promise<void>;
21
+ assertVariableValue(variableName: string, expectedValue: string, scope?: string): Promise<void>;
22
22
  }
@@ -29,13 +29,21 @@ class OCIdentityClusterVariablesPage {
29
29
  // ListV2 and still render Carbon, so the locators that differ between the
30
30
  // two DOMs accept either.
31
31
  this.variablesList = page.locator('table.cds--data-table, table[data-slot="table"]');
32
- this.variableRow = (variableName) => this.variablesList
33
- .locator('tbody')
34
- .getByRole('row')
35
- .filter({ hasText: variableName });
32
+ this.variableRow = (variableName, scope) => {
33
+ const rows = this.variablesList
34
+ .locator('tbody')
35
+ .getByRole('row')
36
+ .filter({ hasText: variableName });
37
+ if (!scope) {
38
+ return rows;
39
+ }
40
+ return rows.filter({
41
+ has: page.getByRole('cell', { name: `Tenant: ${scope}`, exact: true }),
42
+ });
43
+ };
36
44
  // Carbon's OverflowMenu labels its trigger "Options"; the design-system
37
45
  // DataTable labels it "Row actions".
38
- this.editVariableButton = (variableName) => this.variableRow(variableName).getByRole('button', {
46
+ this.editVariableButton = (variableName, scope) => this.variableRow(variableName, scope).getByRole('button', {
39
47
  name: /^(Options|Row actions)$/,
40
48
  });
41
49
  this.editVariableModal = page.getByRole('dialog', {
@@ -69,11 +77,13 @@ class OCIdentityClusterVariablesPage {
69
77
  exact: true,
70
78
  });
71
79
  }
72
- async editVariable(variableName, newValue) {
73
- await this.editVariableButton(variableName).click();
80
+ async editVariable(variableName, newValue, scope) {
81
+ await this.editVariableButton(variableName, scope).click();
74
82
  await (0, test_1.expect)(this.editMenuItem).toBeVisible();
75
83
  await this.editMenuItem.click();
76
- await (0, test_1.expect)(this.variableValueField).toBeVisible();
84
+ // Firefox renders Monaco's input as a zero-height textarea, which
85
+ // Playwright reports as hidden; the editor itself is asserted visible below.
86
+ await (0, test_1.expect)(this.variableValueField).toBeAttached();
77
87
  await (0, test_1.expect)(this.monacoEditor).toBeVisible();
78
88
  // Monaco editor doesn't respond reliably to clear()/fill() on the
79
89
  // hidden textarea. Use keyboard shortcuts to select-all and replace,
@@ -109,11 +119,11 @@ class OCIdentityClusterVariablesPage {
109
119
  await (0, test_1.expect)(this.successMessage).toBeVisible();
110
120
  await (0, test_1.expect)(this.editVariableModal).toBeHidden();
111
121
  }
112
- async assertVariableExists(variableName) {
113
- await (0, test_1.expect)(this.variableRow(variableName)).toBeVisible();
122
+ async assertVariableExists(variableName, scope) {
123
+ await (0, test_1.expect)(this.variableRow(variableName, scope)).toBeVisible();
114
124
  }
115
- async assertVariableValue(variableName, expectedValue) {
116
- const row = this.variableRow(variableName);
125
+ async assertVariableValue(variableName, expectedValue, scope) {
126
+ const row = this.variableRow(variableName, scope);
117
127
  await (0, test_1.expect)(row).toContainText(expectedValue);
118
128
  }
119
129
  }
@@ -118,7 +118,8 @@ class OperateHomePage {
118
118
  // Pass only the OPENING quote: Monaco auto-closes it. Supplying both ends
119
119
  // yields `"updatedValue""` -- invalid JSON, and Apply rejects it exactly
120
120
  // like the per-character version did. Same recipe as
121
- // pages/c8Run-8.10/OperateHomePage.ts.
121
+ // pages/c8Run-8.10/OperateHomePage.ts. Firefox's textarea input does not
122
+ // auto-close, so it gets the closing quote explicitly.
122
123
  //
123
124
  // Select with Home + Shift+End rather than ControlOrMeta+A: headless
124
125
  // Chromium on macOS does not apply Meta+A as select-all inside Monaco's
@@ -127,7 +128,8 @@ class OperateHomePage {
127
128
  // every platform.
128
129
  await this.page.keyboard.press('Home');
129
130
  await this.page.keyboard.press('Shift+End');
130
- await this.page.keyboard.insertText(`"${newValue}`);
131
+ const isFirefox = this.page.context().browser()?.browserType().name() === 'firefox';
132
+ await this.page.keyboard.insertText(`"${newValue}${isFirefox ? '"' : ''}`);
131
133
  }
132
134
  async clickSaveVariableButton() {
133
135
  await this.applyButton.click();
@@ -14,7 +14,7 @@ declare class TaskPanelPage {
14
14
  readonly licenseKeyTagNonProduction: Locator;
15
15
  readonly licenseKeyTagProduction: Locator;
16
16
  constructor(page: Page);
17
- openTask(name: string, assignButton?: boolean): Promise<void>;
17
+ openTask(name: string, assignButton?: boolean, fallbackName?: string): Promise<void>;
18
18
  filterBy(option: 'All open' | 'Unassigned' | 'Assigned to me' | 'Completed'): Promise<void>;
19
19
  private openFilterControls;
20
20
  private static appliedFilterUrl;
@@ -79,17 +79,18 @@ class TaskPanelPage {
79
79
  exact: true,
80
80
  });
81
81
  }
82
- async openTask(name, assignButton = true) {
82
+ async openTask(name, assignButton = true, fallbackName) {
83
83
  const maxAttempts = 10;
84
+ const taskByName = this.availableTasks.getByText(name, { exact: true });
85
+ const taskLocator = fallbackName
86
+ ? taskByName.or(this.availableTasks.getByText(fallbackName, { exact: true }))
87
+ : taskByName;
84
88
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
85
89
  try {
86
90
  // Removed waitForLoadState('networkidle') — Tasklist polls
87
91
  // continuously, so networkidle never fires; the click below
88
92
  // already has a 4s timeout that auto-waits for the locator.
89
- await this.availableTasks
90
- .getByText(name, { exact: true })
91
- .nth(0)
92
- .click({ timeout: constants_1._1_SECOND_IN_MS * 4 });
93
+ await taskLocator.nth(0).click({ timeout: constants_1._1_SECOND_IN_MS * 4 });
93
94
  if (assignButton) {
94
95
  await (0, test_1.expect)(this.assignToMeButton).toBeVisible({
95
96
  timeout: constants_1._1_SECOND_IN_MS * 10,
@@ -85,6 +85,7 @@ const createIdentityUser = async (navigationPage, managementIdentity, username)
85
85
  await managementIdentity.clickIdentityCheckbox();
86
86
  await managementIdentity.clickOrchestrationCheckbox();
87
87
  await managementIdentity.clickAddButton();
88
+ await managementIdentity.waitForRolesAssigned();
88
89
  };
89
90
  const createOCUser = async (navigationPage, ocIdentityHomePage, ocIdentityRolesPage, username) => {
90
91
  await navigationPage.goToOCAdmin();
@@ -32,6 +32,7 @@ declare class ManagementIdentityPage {
32
32
  removeAssignedRole(accessToDelete: string | string[], reopenUserRoles: () => Promise<void>): Promise<void>;
33
33
  clickAssignRolesButton(): Promise<void>;
34
34
  clickAddButton(): Promise<void>;
35
+ waitForRolesAssigned(): Promise<void>;
35
36
  clickOptimizeCheckbox(): Promise<void>;
36
37
  clickModelerCheckbox(): Promise<void>;
37
38
  clickIdentityCheckbox(): Promise<void>;
@@ -191,6 +191,15 @@ class ManagementIdentityPage {
191
191
  async clickAddButton() {
192
192
  await this.addButton.click();
193
193
  }
194
+ // The role-assignment POSTs are only guaranteed to land once the assigned
195
+ // roles table shows them. Navigating away earlier aborts them on Firefox,
196
+ // where they go through a context.route() rather than Identity's service
197
+ // worker, and the user is then left without ManagementIdentity access.
198
+ async waitForRolesAssigned() {
199
+ await (0, test_1.expect)(this.page
200
+ .getByRole('table')
201
+ .getByText('Provides full access to Management Identity')).toBeVisible({ timeout: 60000 });
202
+ }
194
203
  async clickOptimizeCheckbox() {
195
204
  await this.optimizeCheckbox.click();
196
205
  }
@@ -2,13 +2,13 @@ import { Page, Locator } from '@playwright/test';
2
2
  export declare class OCIdentityClusterVariablesPage {
3
3
  private page;
4
4
  readonly variablesList: Locator;
5
- readonly editVariableButton: (variableName: string) => Locator;
5
+ readonly editVariableButton: (variableName: string, scope?: string) => Locator;
6
6
  readonly editVariableModal: Locator;
7
7
  readonly variableValueField: Locator;
8
8
  readonly saveVariableButton: Locator;
9
9
  readonly closeEditVariableModal: Locator;
10
10
  readonly cancelButton: Locator;
11
- readonly variableRow: (variableName: string) => Locator;
11
+ readonly variableRow: (variableName: string, scope?: string) => Locator;
12
12
  readonly monacoEditor: Locator;
13
13
  readonly monacoEditorTextArea: Locator;
14
14
  readonly monacoSuggestWidget: Locator;
@@ -16,7 +16,7 @@ export declare class OCIdentityClusterVariablesPage {
16
16
  readonly editMenuItem: Locator;
17
17
  readonly editModalHeading: Locator;
18
18
  constructor(page: Page);
19
- editVariable(variableName: string, newValue: string): Promise<void>;
20
- assertVariableExists(variableName: string): Promise<void>;
21
- assertVariableValue(variableName: string, expectedValue: string): Promise<void>;
19
+ editVariable(variableName: string, newValue: string, scope?: string): Promise<void>;
20
+ assertVariableExists(variableName: string, scope?: string): Promise<void>;
21
+ assertVariableValue(variableName: string, expectedValue: string, scope?: string): Promise<void>;
22
22
  }
@@ -29,13 +29,21 @@ class OCIdentityClusterVariablesPage {
29
29
  // ListV2 and still render Carbon, so the locators that differ between the
30
30
  // two DOMs accept either.
31
31
  this.variablesList = page.locator('table.cds--data-table, table[data-slot="table"]');
32
- this.variableRow = (variableName) => this.variablesList
33
- .locator('tbody')
34
- .getByRole('row')
35
- .filter({ hasText: variableName });
32
+ this.variableRow = (variableName, scope) => {
33
+ const rows = this.variablesList
34
+ .locator('tbody')
35
+ .getByRole('row')
36
+ .filter({ hasText: variableName });
37
+ if (!scope) {
38
+ return rows;
39
+ }
40
+ return rows.filter({
41
+ has: page.getByRole('cell', { name: `Tenant: ${scope}`, exact: true }),
42
+ });
43
+ };
36
44
  // Carbon's OverflowMenu labels its trigger "Options"; the design-system
37
45
  // DataTable labels it "Row actions".
38
- this.editVariableButton = (variableName) => this.variableRow(variableName).getByRole('button', {
46
+ this.editVariableButton = (variableName, scope) => this.variableRow(variableName, scope).getByRole('button', {
39
47
  name: /^(Options|Row actions)$/,
40
48
  });
41
49
  this.editVariableModal = page.getByRole('dialog', {
@@ -69,11 +77,13 @@ class OCIdentityClusterVariablesPage {
69
77
  exact: true,
70
78
  });
71
79
  }
72
- async editVariable(variableName, newValue) {
73
- await this.editVariableButton(variableName).click();
80
+ async editVariable(variableName, newValue, scope) {
81
+ await this.editVariableButton(variableName, scope).click();
74
82
  await (0, test_1.expect)(this.editMenuItem).toBeVisible();
75
83
  await this.editMenuItem.click();
76
- await (0, test_1.expect)(this.variableValueField).toBeVisible();
84
+ // Firefox renders Monaco's input as a zero-height textarea, which
85
+ // Playwright reports as hidden; the editor itself is asserted visible below.
86
+ await (0, test_1.expect)(this.variableValueField).toBeAttached();
77
87
  await (0, test_1.expect)(this.monacoEditor).toBeVisible();
78
88
  // Monaco editor doesn't respond reliably to clear()/fill() on the
79
89
  // hidden textarea. Use keyboard shortcuts to select-all and replace,
@@ -109,11 +119,11 @@ class OCIdentityClusterVariablesPage {
109
119
  await (0, test_1.expect)(this.successMessage).toBeVisible();
110
120
  await (0, test_1.expect)(this.editVariableModal).toBeHidden();
111
121
  }
112
- async assertVariableExists(variableName) {
113
- await (0, test_1.expect)(this.variableRow(variableName)).toBeVisible();
122
+ async assertVariableExists(variableName, scope) {
123
+ await (0, test_1.expect)(this.variableRow(variableName, scope)).toBeVisible();
114
124
  }
115
- async assertVariableValue(variableName, expectedValue) {
116
- const row = this.variableRow(variableName);
125
+ async assertVariableValue(variableName, expectedValue, scope) {
126
+ const row = this.variableRow(variableName, scope);
117
127
  await (0, test_1.expect)(row).toContainText(expectedValue);
118
128
  }
119
129
  }