@camunda/e2e-test-suite 0.0.1245 → 0.0.1247

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.
@@ -18,6 +18,7 @@ declare class ModelerHomePage {
18
18
  readonly workspaceDescriptionInput: Locator;
19
19
  readonly workspaceWizardSubmit: Locator;
20
20
  readonly workspaceMembersHeading: Locator;
21
+ readonly workspaceEnvironmentsHeading: Locator;
21
22
  readonly projectNameInput: Locator;
22
23
  readonly workspaceWizardNameInput: Locator;
23
24
  readonly workspaceWizardSubmitButton: Locator;
@@ -63,6 +64,7 @@ declare class ModelerHomePage {
63
64
  private ensureWorkspaceOpen;
64
65
  private gotoWorkspacesOverview;
65
66
  private createWorkspace;
67
+ private submitWorkspaceWizard;
66
68
  private openWorkspaceTile;
67
69
  private openOrCreateLegacyFolder;
68
70
  private dismissModals;
@@ -46,6 +46,7 @@ class ModelerHomePage {
46
46
  workspaceDescriptionInput;
47
47
  workspaceWizardSubmit;
48
48
  workspaceMembersHeading;
49
+ workspaceEnvironmentsHeading;
49
50
  projectNameInput;
50
51
  workspaceWizardNameInput;
51
52
  workspaceWizardSubmitButton;
@@ -78,10 +79,13 @@ class ModelerHomePage {
78
79
  constructor(page) {
79
80
  this.page = page;
80
81
  this.processApplicationPage = new ProcessApplicationPage_1.ProcessApplicationPage(page);
81
- // Matches both Modeler shells -- see NavigationPage.modelerPageBanner for
82
- // why the Design System branch excludes the /login href.
82
+ // Matches every Modeler shell -- see NavigationPage.modelerPageBanner for
83
+ // why the Design System branch excludes the /login href and why both the
84
+ // pre-rebrand "Camunda Modeler home" and post-rebrand "Camunda Hub home"
85
+ // aria-labels are matched.
83
86
  this.modelerPageBanner = page
84
- .getByRole('link', { name: 'Camunda Modeler home' })
87
+ .getByRole('link', { name: 'Camunda Hub home' })
88
+ .or(page.getByRole('link', { name: 'Camunda Modeler home' }))
85
89
  .and(page.locator(':not([href$="/login"])'))
86
90
  .or(page.locator('a').filter({ hasText: 'Camunda logoModeler' }))
87
91
  .first();
@@ -220,6 +224,9 @@ class ModelerHomePage {
220
224
  this.workspaceMembersHeading = page.getByRole('heading', {
221
225
  name: /workspace members/i,
222
226
  });
227
+ this.workspaceEnvironmentsHeading = page.getByRole('heading', {
228
+ name: /assign environments/i,
229
+ });
223
230
  }
224
231
  async clickCreateNewProjectButton() {
225
232
  await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.createNewProjectButton, {
@@ -439,14 +446,11 @@ class ModelerHomePage {
439
446
  });
440
447
  }
441
448
  // Walks the create-workspace wizard (`/workspaces/create`): fill the general
442
- // step, advance to the members step, and submit with the creator only (the
443
- // creator is pre-added as Workspace Admin, satisfying the "at least one admin"
444
- // guard). On success the hub routes the role-holding creator straight to the
445
- // new workspace's projects listing, not back to the `/workspaces` overview. The
446
- // single primary button relabels itself "Next" -> "Create workspace" between
447
- // steps; match its stable data-test hook where present and fall back to the
448
- // step-appropriate accessible name (the wizard route does not render the
449
- // overview's own "Create workspace" button, so the name is unambiguous here).
449
+ // step, advance through any optional steps, and submit with the creator only
450
+ // (the creator is pre-added as Workspace Admin, satisfying the "at least one
451
+ // admin" guard). On success the hub routes the role-holding creator straight
452
+ // to the new workspace's projects listing, not back to the `/workspaces`
453
+ // overview, so gate on that landing (singular or plural route).
450
454
  async createWorkspace(name) {
451
455
  await (0, test_1.expect)(this.createWorkspaceButton).toBeVisible({ timeout: 60000 });
452
456
  await this.createWorkspaceButton.click({ timeout: 60000 });
@@ -455,20 +459,7 @@ class ModelerHomePage {
455
459
  await this.workspaceDescriptionInput
456
460
  .fill('Created by the cross-component E2E suite.')
457
461
  .catch(() => { });
458
- // Step 1 (General) -> members step.
459
- await this.workspaceWizardSubmit
460
- .or(this.page.getByRole('button', { name: 'Next', exact: true }))
461
- .first()
462
- .click({ timeout: 30000 });
463
- await (0, test_1.expect)(this.workspaceMembersHeading).toBeVisible({ timeout: 60000 });
464
- // Members step -> create.
465
- await this.workspaceWizardSubmit
466
- .or(this.page.getByRole('button', { name: 'Create workspace', exact: true }))
467
- .first()
468
- .click({ timeout: 30000 });
469
- // submit-workspace routes a role-holding creator to the new workspace's
470
- // projects listing (`/workspace(s)/{id}/projects`), not the `/workspaces`
471
- // overview, so gate on that landing (singular or plural route).
462
+ await this.submitWorkspaceWizard();
472
463
  await this.page.waitForURL(/\/workspaces?\/[^/]+\/projects/, {
473
464
  timeout: 120000,
474
465
  });
@@ -476,6 +467,45 @@ class ModelerHomePage {
476
467
  this.workspaceProjectsUrl = this.page.url();
477
468
  await this.clickMessageBanner();
478
469
  }
470
+ // Advances the create-workspace wizard from the (already filled) General step
471
+ // to workspace creation. The wizard renders a variable number of steps:
472
+ // General is always present, while Members and Environments each render only
473
+ // for an org admin with the feature enabled (see camunda-hub
474
+ // CreateWorkspace.tsx / buildSteps). Its single primary submit button
475
+ // (`data-test=workspace-wizard-submit`) reads "Next" on every step except the
476
+ // last, where it reads "Create workspace". Advance while it reads "Next" —
477
+ // gating each click on the currently visible step section being replaced so a
478
+ // fast re-read cannot click the same "Next" twice — then submit to create.
479
+ // Only one step section renders at a time, so the visible-section list doubles
480
+ // as a per-step marker.
481
+ async submitWorkspaceWizard() {
482
+ const submit = this.workspaceWizardSubmit.first();
483
+ const stepSections = [
484
+ this.workspaceNameInput,
485
+ this.workspaceMembersHeading,
486
+ this.workspaceEnvironmentsHeading,
487
+ ];
488
+ const createsWorkspace = async () => /create workspace/i.test(((await submit.textContent()) ?? '').trim());
489
+ for (let step = 0; step < stepSections.length; step++) {
490
+ await (0, test_1.expect)(submit).toBeEnabled({ timeout: 60000 });
491
+ if (await createsWorkspace()) {
492
+ break;
493
+ }
494
+ let current;
495
+ for (const section of stepSections) {
496
+ if (await section.isVisible().catch(() => false)) {
497
+ current = section;
498
+ break;
499
+ }
500
+ }
501
+ await submit.click({ timeout: 30000 });
502
+ if (current) {
503
+ await current.waitFor({ state: 'hidden', timeout: 60000 });
504
+ }
505
+ }
506
+ await (0, test_1.expect)(submit).toHaveText(/create workspace/i, { timeout: 60000 });
507
+ await submit.click({ timeout: 30000 });
508
+ }
479
509
  // Opens the shared Workspace's tile and waits until its projects listing has
480
510
  // loaded, remembering that URL for later returns via clickWorkspaceBreadcrumb.
481
511
  async openWorkspaceTile() {
@@ -41,15 +41,17 @@ class NavigationPage {
41
41
  .or(page.getByRole('link', { name: 'Camunda Operate', exact: true }))
42
42
  .first();
43
43
  // Web Modeler renders the Design System nav shell (NavShellDs) whenever
44
- // `design-system-enabled` is on -- its home link is
45
- // aria-label="Camunda Modeler home" wrapping an aria-hidden logo, so the
46
- // legacy shell's "Camunda logoModeler" text no longer exists. The
47
- // unauthenticated shell reuses that aria-label pointing at /login, and
44
+ // `design-system-enabled` is on. Its home link was
45
+ // aria-label="Camunda Modeler home"; the Camunda Hub rebrand renamed it to
46
+ // aria-label="Camunda Hub home" (still an aria-hidden logo, href .../modeler/),
47
+ // so the legacy shell's "Camunda logoModeler" text no longer exists. The
48
+ // unauthenticated shell reuses the same aria-label pointing at /login, and
48
49
  // waitForBanner() gates only on visibility, so exclude that href here:
49
50
  // callers use this banner as the logged-in gate.
50
- // Match either shell so the banner resolves with the flag on or off.
51
+ // Match every shell so the banner resolves flag on or off, pre- or post-rebrand.
51
52
  this.modelerPageBanner = page
52
- .getByRole('link', { name: 'Camunda Modeler home' })
53
+ .getByRole('link', { name: 'Camunda Hub home' })
54
+ .or(page.getByRole('link', { name: 'Camunda Modeler home' }))
53
55
  .and(page.locator(':not([href$="/login"])'))
54
56
  .or(page.locator('a').filter({ hasText: 'Camunda logoModeler' }))
55
57
  .first();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1245",
3
+ "version": "0.0.1247",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",