@camunda/e2e-test-suite 0.0.1246 → 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;
|
|
@@ -223,6 +224,9 @@ class ModelerHomePage {
|
|
|
223
224
|
this.workspaceMembersHeading = page.getByRole('heading', {
|
|
224
225
|
name: /workspace members/i,
|
|
225
226
|
});
|
|
227
|
+
this.workspaceEnvironmentsHeading = page.getByRole('heading', {
|
|
228
|
+
name: /assign environments/i,
|
|
229
|
+
});
|
|
226
230
|
}
|
|
227
231
|
async clickCreateNewProjectButton() {
|
|
228
232
|
await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.createNewProjectButton, {
|
|
@@ -442,14 +446,11 @@ class ModelerHomePage {
|
|
|
442
446
|
});
|
|
443
447
|
}
|
|
444
448
|
// Walks the create-workspace wizard (`/workspaces/create`): fill the general
|
|
445
|
-
// step, advance
|
|
446
|
-
// creator is pre-added as Workspace Admin, satisfying the "at least one
|
|
447
|
-
// guard). On success the hub routes the role-holding creator straight
|
|
448
|
-
// new workspace's projects listing, not back to the `/workspaces`
|
|
449
|
-
//
|
|
450
|
-
// steps; match its stable data-test hook where present and fall back to the
|
|
451
|
-
// step-appropriate accessible name (the wizard route does not render the
|
|
452
|
-
// 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).
|
|
453
454
|
async createWorkspace(name) {
|
|
454
455
|
await (0, test_1.expect)(this.createWorkspaceButton).toBeVisible({ timeout: 60000 });
|
|
455
456
|
await this.createWorkspaceButton.click({ timeout: 60000 });
|
|
@@ -458,20 +459,7 @@ class ModelerHomePage {
|
|
|
458
459
|
await this.workspaceDescriptionInput
|
|
459
460
|
.fill('Created by the cross-component E2E suite.')
|
|
460
461
|
.catch(() => { });
|
|
461
|
-
|
|
462
|
-
await this.workspaceWizardSubmit
|
|
463
|
-
.or(this.page.getByRole('button', { name: 'Next', exact: true }))
|
|
464
|
-
.first()
|
|
465
|
-
.click({ timeout: 30000 });
|
|
466
|
-
await (0, test_1.expect)(this.workspaceMembersHeading).toBeVisible({ timeout: 60000 });
|
|
467
|
-
// Members step -> create.
|
|
468
|
-
await this.workspaceWizardSubmit
|
|
469
|
-
.or(this.page.getByRole('button', { name: 'Create workspace', exact: true }))
|
|
470
|
-
.first()
|
|
471
|
-
.click({ timeout: 30000 });
|
|
472
|
-
// submit-workspace routes a role-holding creator to the new workspace's
|
|
473
|
-
// projects listing (`/workspace(s)/{id}/projects`), not the `/workspaces`
|
|
474
|
-
// overview, so gate on that landing (singular or plural route).
|
|
462
|
+
await this.submitWorkspaceWizard();
|
|
475
463
|
await this.page.waitForURL(/\/workspaces?\/[^/]+\/projects/, {
|
|
476
464
|
timeout: 120000,
|
|
477
465
|
});
|
|
@@ -479,6 +467,45 @@ class ModelerHomePage {
|
|
|
479
467
|
this.workspaceProjectsUrl = this.page.url();
|
|
480
468
|
await this.clickMessageBanner();
|
|
481
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
|
+
}
|
|
482
509
|
// Opens the shared Workspace's tile and waits until its projects listing has
|
|
483
510
|
// loaded, remembering that URL for later returns via clickWorkspaceBreadcrumb.
|
|
484
511
|
async openWorkspaceTile() {
|