@camunda/e2e-test-suite 0.0.1015 → 0.0.1016
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.
- package/dist/pages/8.7/FormJsPage.d.ts +2 -0
- package/dist/pages/8.7/FormJsPage.js +74 -1
- package/dist/pages/8.7/ModelerCreatePage.d.ts +2 -1
- package/dist/pages/8.7/ModelerCreatePage.js +176 -37
- package/dist/pages/8.7/ModelerHomePage.d.ts +12 -0
- package/dist/pages/8.7/ModelerHomePage.js +152 -7
- package/dist/pages/8.7/ProcessApplicationPage.d.ts +30 -0
- package/dist/pages/8.7/ProcessApplicationPage.js +260 -0
- package/dist/pages/8.7/UtilitiesPage.js +8 -0
- package/dist/tests/8.7/idp-user-flows.spec.js +3 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Page, Locator } from '@playwright/test';
|
|
2
2
|
declare class FormJsPage {
|
|
3
3
|
private page;
|
|
4
|
+
private processApplicationPage;
|
|
4
5
|
readonly aiFormGeneratorButton: Locator;
|
|
5
6
|
readonly formRequestInput: Locator;
|
|
6
7
|
readonly generateFormButton: Locator;
|
|
@@ -31,6 +32,7 @@ declare class FormJsPage {
|
|
|
31
32
|
selectCluster(clusterName: string): Promise<void>;
|
|
32
33
|
clickDeployButton(): Promise<void>;
|
|
33
34
|
clickDeploySubButton(): Promise<void>;
|
|
35
|
+
selectOnlyThisResource(): Promise<void>;
|
|
34
36
|
deployForm(clusterName: string): Promise<void>;
|
|
35
37
|
}
|
|
36
38
|
export { FormJsPage };
|
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FormJsPage = void 0;
|
|
4
4
|
const test_1 = require("@playwright/test");
|
|
5
5
|
const sleep_1 = require("../../utils/sleep");
|
|
6
|
+
const ProcessApplicationPage_1 = require("./ProcessApplicationPage");
|
|
6
7
|
class FormJsPage {
|
|
7
8
|
page;
|
|
9
|
+
processApplicationPage;
|
|
8
10
|
aiFormGeneratorButton;
|
|
9
11
|
formRequestInput;
|
|
10
12
|
generateFormButton;
|
|
@@ -23,6 +25,7 @@ class FormJsPage {
|
|
|
23
25
|
deploySuccessNotification;
|
|
24
26
|
constructor(page) {
|
|
25
27
|
this.page = page;
|
|
28
|
+
this.processApplicationPage = new ProcessApplicationPage_1.ProcessApplicationPage(page);
|
|
26
29
|
this.aiFormGeneratorButton = page.getByRole('button', {
|
|
27
30
|
name: 'AI Form Generator',
|
|
28
31
|
});
|
|
@@ -44,9 +47,12 @@ class FormJsPage {
|
|
|
44
47
|
this.deployButton = page
|
|
45
48
|
.locator('[data-test="action-bar"]')
|
|
46
49
|
.getByRole('button', { name: 'Deploy', exact: true });
|
|
50
|
+
// Inside a process application hub titles this modal for the application
|
|
51
|
+
// rather than for the form, so 'Deploy form' never matches and the dialog
|
|
52
|
+
// reads as absent. pages/SM-8.10 filters on 'Deploy' for the same reason.
|
|
47
53
|
this.dialog = page
|
|
48
54
|
.locator('.cds--modal-container[role="dialog"]')
|
|
49
|
-
.filter({ hasText: 'Deploy
|
|
55
|
+
.filter({ hasText: 'Deploy' });
|
|
50
56
|
this.deploySubButton = this.dialog.getByRole('button', {
|
|
51
57
|
name: 'Deploy',
|
|
52
58
|
exact: true,
|
|
@@ -99,6 +105,46 @@ class FormJsPage {
|
|
|
99
105
|
async selectCluster(clusterName) {
|
|
100
106
|
await (0, test_1.expect)(this.dialog).toBeVisible({ timeout: 30000 });
|
|
101
107
|
const healthCheckTimeout = 30000;
|
|
108
|
+
// Inside a process application the deploy dialog renders
|
|
109
|
+
// ProcessAppClusterSelection, not the per-deploy ClusterSelection toggle
|
|
110
|
+
// list: it shows only clusters assigned to one of the application's stages
|
|
111
|
+
// and auto-selects the first, so there is no label to click. Confirm the
|
|
112
|
+
// intended cluster is the one on offer instead.
|
|
113
|
+
//
|
|
114
|
+
// The unconfigured case is called out explicitly: without this the symptom
|
|
115
|
+
// is the cluster toggle never appearing, retried until the test times out,
|
|
116
|
+
// which says nothing about the actual cause.
|
|
117
|
+
const notConfigured = this.dialog.getByText('Clusters not configured for stages');
|
|
118
|
+
if (await notConfigured.isVisible().catch(() => false)) {
|
|
119
|
+
throw new Error(`Process application has no cluster assigned to any stage, so "${clusterName}" cannot be deployed to. ` +
|
|
120
|
+
'ProcessApplicationPage.ensureStageCluster() should have bound it before the deploy dialog was opened.');
|
|
121
|
+
}
|
|
122
|
+
const legacyClusterToggle = this.dialog.locator('label').filter({
|
|
123
|
+
hasText: new RegExp(`^${clusterName}`),
|
|
124
|
+
});
|
|
125
|
+
const isLegacyDialog = await legacyClusterToggle
|
|
126
|
+
.first()
|
|
127
|
+
.isVisible()
|
|
128
|
+
.catch(() => false);
|
|
129
|
+
if (!isLegacyDialog) {
|
|
130
|
+
const offered = await this.dialog
|
|
131
|
+
.getByText(clusterName, { exact: false })
|
|
132
|
+
.first()
|
|
133
|
+
.waitFor({ state: 'visible', timeout: 30000 })
|
|
134
|
+
.then(() => true)
|
|
135
|
+
.catch(() => false);
|
|
136
|
+
if (!offered) {
|
|
137
|
+
// Forget the binding before failing. The dialog lists exactly the
|
|
138
|
+
// clusters this application's stages point at, so a missing cluster
|
|
139
|
+
// means the binding did not take -- and no amount of reopening the
|
|
140
|
+
// dialog will make it appear. Clearing the record lets the caller's
|
|
141
|
+
// next attempt rebind instead of re-checking an unchanged dialog.
|
|
142
|
+
this.processApplicationPage.forgetStageCluster();
|
|
143
|
+
throw new Error(`The deploy dialog does not offer "${clusterName}": its stage ` +
|
|
144
|
+
'binding did not take. It will be rebound on the next attempt.');
|
|
145
|
+
}
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
102
148
|
const healthyRegex = new RegExp(`${clusterName}[\\s\\S]*?HealthydevManage`);
|
|
103
149
|
const cluster = this.dialog.locator(`[title="${clusterName}"]`);
|
|
104
150
|
await (0, test_1.expect)(cluster).toBeVisible({ timeout: 30000 });
|
|
@@ -117,12 +163,39 @@ class FormJsPage {
|
|
|
117
163
|
async clickDeploySubButton() {
|
|
118
164
|
await this.deploySubButton.click({ timeout: 60000 });
|
|
119
165
|
}
|
|
166
|
+
// Since camunda/camunda-hub#25831 a form lives inside a process application,
|
|
167
|
+
// and Hub then scopes Deploy to the WHOLE application by default -- it calls
|
|
168
|
+
// deployProcessApplication, not deployFile, so the "Form deployed!" toast
|
|
169
|
+
// never fires (hub's own form-deploy-action.spec.sm.tsx asserts exactly that
|
|
170
|
+
// default). Narrowing the scope keeps this a form-deploy test instead of
|
|
171
|
+
// silently turning it into a process-application deploy. The combobox only
|
|
172
|
+
// exists inside a container, hence the boolean probe.
|
|
173
|
+
async selectOnlyThisResource() {
|
|
174
|
+
const scopeSelect = this.dialog.getByRole('combobox', {
|
|
175
|
+
name: 'Resources to deploy',
|
|
176
|
+
});
|
|
177
|
+
const hasScopeSelect = await scopeSelect
|
|
178
|
+
.waitFor({ state: 'visible', timeout: 10000 })
|
|
179
|
+
.then(() => true)
|
|
180
|
+
.catch(() => false);
|
|
181
|
+
if (!hasScopeSelect) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
await scopeSelect.click();
|
|
185
|
+
await this.dialog
|
|
186
|
+
.getByRole('option', { name: 'Only this resource' })
|
|
187
|
+
.or(this.dialog.getByText('Only this resource', { exact: true }))
|
|
188
|
+
.first()
|
|
189
|
+
.click({ timeout: 30000 });
|
|
190
|
+
}
|
|
120
191
|
async deployForm(clusterName) {
|
|
192
|
+
await this.processApplicationPage.ensureStageCluster(clusterName);
|
|
121
193
|
await this.clickDeployButton();
|
|
122
194
|
await (0, test_1.expect)(this.dialog).toBeVisible({
|
|
123
195
|
timeout: 30000,
|
|
124
196
|
});
|
|
125
197
|
await this.selectCluster(clusterName);
|
|
198
|
+
await this.selectOnlyThisResource();
|
|
126
199
|
await this.clickDeploySubButton();
|
|
127
200
|
await (0, test_1.expect)(this.deploySuccessNotification).toBeVisible({ timeout: 30000 });
|
|
128
201
|
await (0, test_1.expect)(this.deploySuccessNotification).not.toBeVisible({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Page, Locator } from '@playwright/test';
|
|
2
2
|
declare class ModelerCreatePage {
|
|
3
3
|
private page;
|
|
4
|
+
private processApplicationPage;
|
|
4
5
|
readonly generalPanel: Locator;
|
|
5
6
|
private deployDiagramDialog;
|
|
6
7
|
readonly processIdInput: Locator;
|
|
@@ -216,7 +217,7 @@ declare class ModelerCreatePage {
|
|
|
216
217
|
private suppressTestModeAnnouncement;
|
|
217
218
|
switchToPlay(): Promise<void>;
|
|
218
219
|
completePlayConfiguration(clusterName: string): Promise<void>;
|
|
219
|
-
selectCluster(clusterName: string): Promise<void>;
|
|
220
|
+
selectCluster(clusterName: string, healthCheckTimeout?: number): Promise<void>;
|
|
220
221
|
embedForm(formName: string): Promise<void>;
|
|
221
222
|
fillStartEventVariablesForDocHandling(zeebeUrl: string, zeebeClientId: string, zeebeClientSecret: string): Promise<void>;
|
|
222
223
|
fillZeebeClientId(clientId: string): Promise<void>;
|
|
@@ -4,8 +4,10 @@ exports.ModelerCreatePage = void 0;
|
|
|
4
4
|
const test_1 = require("@playwright/test");
|
|
5
5
|
const sleep_1 = require("../../utils/sleep");
|
|
6
6
|
const ConnectorMarketplacePage_1 = require("./ConnectorMarketplacePage");
|
|
7
|
+
const ProcessApplicationPage_1 = require("./ProcessApplicationPage");
|
|
7
8
|
class ModelerCreatePage {
|
|
8
9
|
page;
|
|
10
|
+
processApplicationPage;
|
|
9
11
|
generalPanel;
|
|
10
12
|
deployDiagramDialog;
|
|
11
13
|
processIdInput;
|
|
@@ -109,6 +111,7 @@ class ModelerCreatePage {
|
|
|
109
111
|
diagramNameBreadcrumb;
|
|
110
112
|
constructor(page) {
|
|
111
113
|
this.page = page;
|
|
114
|
+
this.processApplicationPage = new ProcessApplicationPage_1.ProcessApplicationPage(page);
|
|
112
115
|
this.generalPanel = page.locator('[data-group-id="group-general"]');
|
|
113
116
|
this.processIdInput = page.getByLabel('ID', { exact: true });
|
|
114
117
|
this.startEventElement = page.locator('.djs-hit').first();
|
|
@@ -220,8 +223,12 @@ class ModelerCreatePage {
|
|
|
220
223
|
this.rbaEnabledDeployedDialog = page.getByRole('dialog', {
|
|
221
224
|
name: 'Process successfully deployed',
|
|
222
225
|
});
|
|
226
|
+
// Since camunda/camunda-hub#25831 a diagram deploys as part of its process
|
|
227
|
+
// application and hub titles the modal for the application, not for the
|
|
228
|
+
// single resource, so an exact 'Deploy diagram' name no longer matches.
|
|
229
|
+
// Match on the verb -- pages/SM-8.10 already leaves this unfiltered.
|
|
223
230
|
this.deployDiagramDialog = page.getByRole('dialog', {
|
|
224
|
-
name:
|
|
231
|
+
name: /^Deploy/,
|
|
225
232
|
});
|
|
226
233
|
this.appendGatewayButton = page.getByRole('button', {
|
|
227
234
|
name: 'Append gateway',
|
|
@@ -472,6 +479,7 @@ class ModelerCreatePage {
|
|
|
472
479
|
await this.deployMenuItem.click({ timeout: 60000 });
|
|
473
480
|
}
|
|
474
481
|
async deployDiagram(clusterName) {
|
|
482
|
+
await this.processApplicationPage.ensureStageCluster(clusterName);
|
|
475
483
|
await this.clickDeployButtonWithRetry();
|
|
476
484
|
await (0, test_1.expect)(this.deployDiagramDialog).toBeVisible({
|
|
477
485
|
timeout: 30000,
|
|
@@ -521,24 +529,29 @@ class ModelerCreatePage {
|
|
|
521
529
|
await this.deployAndRunSubButton.click({ timeout: 30000 });
|
|
522
530
|
}
|
|
523
531
|
async runProcessInstance(clusterName, variables = '', formVariables = {}, textToVisible = '') {
|
|
532
|
+
await this.processApplicationPage.ensureStageCluster(clusterName);
|
|
524
533
|
await this.clickDeployAndRunMainButton();
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
//
|
|
529
|
-
|
|
530
|
-
.
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
534
|
+
// Routed through selectCluster so this path gets the same
|
|
535
|
+
// legacy-toggle-vs-ProcessAppClusterSelection branch as every other deploy:
|
|
536
|
+
// inside a process application there is no cluster toggle to click. Keeps
|
|
537
|
+
// this path's own 120s health wait rather than selectCluster's 30s default.
|
|
538
|
+
try {
|
|
539
|
+
await this.selectCluster(clusterName, 120000);
|
|
540
|
+
}
|
|
541
|
+
catch (error) {
|
|
542
|
+
// selectCluster clears the stage binding when the dialog does not offer
|
|
543
|
+
// the cluster, so ensureStageCluster rebinds here and reports that it
|
|
544
|
+
// navigated. Any other failure leaves the binding in place, it returns
|
|
545
|
+
// false, and the original error stands -- there is nothing to redo.
|
|
546
|
+
// Unlike the 8.8+ flows this one has no surrounding retry loop, hence
|
|
547
|
+
// the one explicit second attempt.
|
|
548
|
+
const rebound = await this.processApplicationPage.ensureStageCluster(clusterName);
|
|
549
|
+
if (!rebound) {
|
|
550
|
+
throw error;
|
|
551
|
+
}
|
|
552
|
+
await this.clickDeployAndRunMainButton();
|
|
553
|
+
await this.selectCluster(clusterName, 120000);
|
|
554
|
+
}
|
|
542
555
|
if (variables.length > 0) {
|
|
543
556
|
await (0, test_1.expect)(this.variableInput).toBeVisible({
|
|
544
557
|
timeout: 60000,
|
|
@@ -633,8 +646,45 @@ class ModelerCreatePage {
|
|
|
633
646
|
}
|
|
634
647
|
}
|
|
635
648
|
}
|
|
649
|
+
// Opening the breadcrumb menu leaves the pointer on the breadcrumb button,
|
|
650
|
+
// and hub renders that button's truncated-name tooltip on top of the menu,
|
|
651
|
+
// where it swallows the click on "Rename" -- playwright reports
|
|
652
|
+
// `<div role="tooltip">…</div> intercepts pointer events`. Since
|
|
653
|
+
// camunda/camunda-hub#25831 the breadcrumb carries an extra
|
|
654
|
+
// process-application crumb, so the name truncates, and the tooltip renders,
|
|
655
|
+
// as the rule rather than the exception. Park the pointer away from the
|
|
656
|
+
// breadcrumb and let the tooltip unmount before clicking; reopen the menu if
|
|
657
|
+
// a previous attempt closed it.
|
|
636
658
|
async clickEditDiagramNameButton() {
|
|
637
|
-
|
|
659
|
+
const openTooltip = this.page.locator('[role="tooltip"][aria-hidden="false"]');
|
|
660
|
+
await (0, test_1.expect)(async () => {
|
|
661
|
+
const menuOpen = await this.renameDiagramNameButton
|
|
662
|
+
.isVisible()
|
|
663
|
+
.catch(() => false);
|
|
664
|
+
if (!menuOpen) {
|
|
665
|
+
await this.clickDiagramBreadcrumb();
|
|
666
|
+
}
|
|
667
|
+
// Park the pointer so the breadcrumb's own tooltip gets a chance to
|
|
668
|
+
// unmount -- best effort, because it is not reliably hover-driven, and
|
|
669
|
+
// requiring it to go turned an interceptable click into a hard failure.
|
|
670
|
+
await this.page.mouse.move(0, 0);
|
|
671
|
+
await openTooltip
|
|
672
|
+
.first()
|
|
673
|
+
.waitFor({ state: 'hidden', timeout: 2000 })
|
|
674
|
+
.catch(() => false);
|
|
675
|
+
try {
|
|
676
|
+
await this.renameDiagramNameButton.click({ timeout: 10000 });
|
|
677
|
+
}
|
|
678
|
+
catch {
|
|
679
|
+
// The tooltip renders over the menu and swallows the click (playwright
|
|
680
|
+
// reports `<div role="tooltip">…</div> intercepts pointer events`).
|
|
681
|
+
// Dispatching on the element bypasses hit-testing, which no amount of
|
|
682
|
+
// waiting achieves when the tooltip never unmounts. Not a swallowed
|
|
683
|
+
// failure: the assertion below is what decides whether this worked.
|
|
684
|
+
await this.renameDiagramNameButton.dispatchEvent('click');
|
|
685
|
+
}
|
|
686
|
+
await (0, test_1.expect)(this.diagramNameInput).toBeVisible({ timeout: 10000 });
|
|
687
|
+
}).toPass({ timeout: 60000, intervals: [1000, 2000, 5000] });
|
|
638
688
|
}
|
|
639
689
|
async enterDiagramName(name) {
|
|
640
690
|
// The inline name field stays in the DOM after the rename action closes,
|
|
@@ -1137,6 +1187,16 @@ class ModelerCreatePage {
|
|
|
1137
1187
|
await this.playTab.click();
|
|
1138
1188
|
}
|
|
1139
1189
|
async completePlayConfiguration(clusterName) {
|
|
1190
|
+
// Play is a tab on the diagram page, not its own URL, so the stage-cluster
|
|
1191
|
+
// detour's goto() lands back on the Modeler tab and every Play locator
|
|
1192
|
+
// below would then look for a panel that is no longer rendered. Re-enter
|
|
1193
|
+
// Play when the detour actually navigated. Binding cannot simply move
|
|
1194
|
+
// before switchToPlay(): this is the first point in the flow that knows
|
|
1195
|
+
// which cluster the test plays on.
|
|
1196
|
+
const reboundStageCluster = await this.processApplicationPage.ensureStageCluster(clusterName);
|
|
1197
|
+
if (reboundStageCluster) {
|
|
1198
|
+
await this.switchToPlay();
|
|
1199
|
+
}
|
|
1140
1200
|
const timeout = 30000;
|
|
1141
1201
|
// New flow (8.10+): "Setup environment" panel with three steps:
|
|
1142
1202
|
// 1. Connect cluster → "Configure environment" modal → select cluster → Save
|
|
@@ -1160,17 +1220,37 @@ class ModelerCreatePage {
|
|
|
1160
1220
|
name: /^Configure (test case|scenario)$/,
|
|
1161
1221
|
}))
|
|
1162
1222
|
.first();
|
|
1163
|
-
//
|
|
1164
|
-
//
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1223
|
+
// Play settles into exactly ONE of three states, and which one is not
|
|
1224
|
+
// knowable up front, so race them instead of timing out on each in turn:
|
|
1225
|
+
// the setup overlay, the legacy Continue button, or the configure-test
|
|
1226
|
+
// panel (meaning setup is already done for this diagram).
|
|
1227
|
+
//
|
|
1228
|
+
// Waiting only for the first two and reading "neither" as "already ready"
|
|
1229
|
+
// was wrong once the diagram moved inside a process application.
|
|
1230
|
+
// ConfigurationOverlay renders null until isDeploymentStateValidated, and
|
|
1231
|
+
// it sets that flag synchronously ONLY when processApplicationId is
|
|
1232
|
+
// undefined -- exactly what a project-root diagram used to give it. With
|
|
1233
|
+
// the diagram in a process application the id is defined, so the overlay
|
|
1234
|
+
// must first await checkExistingDeployment(). The old 15s probe raced that
|
|
1235
|
+
// async call, concluded "already ready" and returned while the overlay was
|
|
1236
|
+
// still about to appear. ConfigureTestPanel returns null for as long as the
|
|
1237
|
+
// overlay is up, so the Start button never existed and
|
|
1238
|
+
// clickStartInstanceButton burned its entire retry budget looking for it.
|
|
1239
|
+
const configurationOverlay = this.page.locator('[data-test="play-configuration-overlay"]');
|
|
1240
|
+
const configureTestPanel = this.page.getByTestId('configure-test-panel');
|
|
1241
|
+
await (0, test_1.expect)(configurationOverlay
|
|
1242
|
+
.or(this.continueToPlayButton)
|
|
1243
|
+
.or(configureTestPanel)
|
|
1244
|
+
.first()).toBeVisible({ timeout: 90000 });
|
|
1245
|
+
if (await configureTestPanel.isVisible()) {
|
|
1246
|
+
// Already past setup for this diagram -- nothing to drive.
|
|
1171
1247
|
return;
|
|
1172
1248
|
}
|
|
1173
|
-
|
|
1249
|
+
// Keyed on the overlay itself, not on its Deploy button: when
|
|
1250
|
+
// checkExistingDeployment finds a deployment the overlay opens with the
|
|
1251
|
+
// deploy step already complete, so there is no Deploy button to see and
|
|
1252
|
+
// keying on it would fall through to the legacy Continue flow.
|
|
1253
|
+
const isNewFlow = await configurationOverlay.isVisible();
|
|
1174
1254
|
if (isNewFlow) {
|
|
1175
1255
|
// Step 1: connect cluster if not yet connected (modal with cluster dropdown)
|
|
1176
1256
|
const connectClusterButton = this.page.getByRole('button', {
|
|
@@ -1209,13 +1289,33 @@ class ModelerCreatePage {
|
|
|
1209
1289
|
.getByRole('button', { name: 'Save' })
|
|
1210
1290
|
.click({ timeout });
|
|
1211
1291
|
}
|
|
1212
|
-
// Step 2: deploy
|
|
1213
|
-
//
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1292
|
+
// Step 2: deploy, unless the overlay already opened with the
|
|
1293
|
+
// deploy step complete. checkExistingDeployment only runs when
|
|
1294
|
+
// processApplicationId is defined, which it now is, so re-entering
|
|
1295
|
+
// Play on an already-deployed process application legitimately
|
|
1296
|
+
// has nothing to deploy and renders no Deploy button at all.
|
|
1297
|
+
const alreadyDeployed = await configureScenarioButton
|
|
1298
|
+
.isVisible({ timeout: 3000 })
|
|
1299
|
+
.catch(() => false);
|
|
1300
|
+
if (!alreadyDeployed) {
|
|
1301
|
+
// Step 2: deploy — wait for enabled; button stays disabled until the cluster
|
|
1302
|
+
// connection is confirmed by the backend after the Save in step 1.
|
|
1303
|
+
await (0, test_1.expect)(setupDeployButton).toBeEnabled({ timeout: 60000 });
|
|
1304
|
+
await setupDeployButton.click({ timeout });
|
|
1305
|
+
await (0, test_1.expect)(this.page.getByText('Process has been successfully deployed')).toBeVisible({ timeout: 90000 });
|
|
1306
|
+
}
|
|
1307
|
+
// Step 3: leave the overlay, and confirm we actually left it. The
|
|
1308
|
+
// button only calls hideConfigurationOverlay(); the overlay's own
|
|
1309
|
+
// cluster-change effect can then fire resetDeployment and bring it
|
|
1310
|
+
// straight back, and ConfigureTestPanel stays null while it is up.
|
|
1311
|
+
// Assert the panel really rendered, and re-drive the click if the
|
|
1312
|
+
// overlay returned.
|
|
1313
|
+
await (0, test_1.expect)(async () => {
|
|
1314
|
+
if (await configurationOverlay.isVisible()) {
|
|
1315
|
+
await configureScenarioButton.click({ timeout });
|
|
1316
|
+
}
|
|
1317
|
+
await (0, test_1.expect)(configureTestPanel).toBeVisible({ timeout: 15000 });
|
|
1318
|
+
}).toPass({ timeout: 90000 });
|
|
1219
1319
|
return;
|
|
1220
1320
|
}
|
|
1221
1321
|
// Legacy flow: select cluster via dialog, then click Continue.
|
|
@@ -1238,9 +1338,48 @@ class ModelerCreatePage {
|
|
|
1238
1338
|
}
|
|
1239
1339
|
}
|
|
1240
1340
|
}
|
|
1241
|
-
async selectCluster(clusterName) {
|
|
1341
|
+
async selectCluster(clusterName, healthCheckTimeout = 30000) {
|
|
1242
1342
|
await (0, test_1.expect)(this.dialog).toBeVisible({ timeout: 30000 });
|
|
1243
|
-
|
|
1343
|
+
// Inside a process application the deploy dialog renders
|
|
1344
|
+
// ProcessAppClusterSelection, not the per-deploy ClusterSelection toggle
|
|
1345
|
+
// list: it shows only clusters assigned to one of the application's stages
|
|
1346
|
+
// and auto-selects the first, so there is no label to click. Confirm the
|
|
1347
|
+
// intended cluster is the one on offer instead.
|
|
1348
|
+
//
|
|
1349
|
+
// The unconfigured case is called out explicitly: without this the symptom
|
|
1350
|
+
// is the cluster toggle never appearing, retried until the test times out,
|
|
1351
|
+
// which says nothing about the actual cause.
|
|
1352
|
+
const notConfigured = this.dialog.getByText('Clusters not configured for stages');
|
|
1353
|
+
if (await notConfigured.isVisible().catch(() => false)) {
|
|
1354
|
+
throw new Error(`Process application has no cluster assigned to any stage, so "${clusterName}" cannot be deployed to. ` +
|
|
1355
|
+
'ProcessApplicationPage.ensureStageCluster() should have bound it before the deploy dialog was opened.');
|
|
1356
|
+
}
|
|
1357
|
+
const legacyClusterToggle = this.dialog.locator('label').filter({
|
|
1358
|
+
hasText: new RegExp(`^${clusterName}`),
|
|
1359
|
+
});
|
|
1360
|
+
const isLegacyDialog = await legacyClusterToggle
|
|
1361
|
+
.first()
|
|
1362
|
+
.isVisible()
|
|
1363
|
+
.catch(() => false);
|
|
1364
|
+
if (!isLegacyDialog) {
|
|
1365
|
+
const offered = await this.dialog
|
|
1366
|
+
.getByText(clusterName, { exact: false })
|
|
1367
|
+
.first()
|
|
1368
|
+
.waitFor({ state: 'visible', timeout: 30000 })
|
|
1369
|
+
.then(() => true)
|
|
1370
|
+
.catch(() => false);
|
|
1371
|
+
if (!offered) {
|
|
1372
|
+
// Forget the binding before failing. The dialog lists exactly the
|
|
1373
|
+
// clusters this application's stages point at, so a missing cluster
|
|
1374
|
+
// means the binding did not take -- and no amount of reopening the
|
|
1375
|
+
// dialog will make it appear. Clearing the record lets the caller's
|
|
1376
|
+
// next attempt rebind instead of re-checking an unchanged dialog.
|
|
1377
|
+
this.processApplicationPage.forgetStageCluster();
|
|
1378
|
+
throw new Error(`The deploy dialog does not offer "${clusterName}": its stage ` +
|
|
1379
|
+
'binding did not take. It will be rebound on the next attempt.');
|
|
1380
|
+
}
|
|
1381
|
+
return;
|
|
1382
|
+
}
|
|
1244
1383
|
const healthyRegex = new RegExp(`${clusterName}.*?HealthydevManage`);
|
|
1245
1384
|
const clusterLabel = this.dialog
|
|
1246
1385
|
.locator('label')
|
|
@@ -3,6 +3,9 @@ import { LoginPage } from './LoginPage';
|
|
|
3
3
|
declare class ModelerHomePage {
|
|
4
4
|
private defaultFolderName;
|
|
5
5
|
private page;
|
|
6
|
+
private processApplicationPage;
|
|
7
|
+
private processApplicationUrl?;
|
|
8
|
+
private processApplicationName?;
|
|
6
9
|
readonly modelerPageBanner: Locator;
|
|
7
10
|
readonly createNewProjectButton: Locator;
|
|
8
11
|
readonly projectNameInput: Locator;
|
|
@@ -15,6 +18,7 @@ declare class ModelerHomePage {
|
|
|
15
18
|
readonly idpApplicationNameInput: Locator;
|
|
16
19
|
readonly createIdpApplicationButton: Locator;
|
|
17
20
|
readonly projectBreadcrumb: Locator;
|
|
21
|
+
readonly workspaceBreadcrumb: Locator;
|
|
18
22
|
readonly openOrganizationsButton: Locator;
|
|
19
23
|
readonly optionsButton: Locator;
|
|
20
24
|
readonly manageButton: Locator;
|
|
@@ -41,12 +45,20 @@ declare class ModelerHomePage {
|
|
|
41
45
|
getProjectNames(name: string): Promise<string[]>;
|
|
42
46
|
clickProcessDiagram(name: string): Promise<void>;
|
|
43
47
|
clickDiagramTypeDropdown(): Promise<void>;
|
|
48
|
+
clickWorkspaceDiagramTypeDropdown(): Promise<void>;
|
|
44
49
|
clickBpmnTemplateOption(): Promise<void>;
|
|
45
50
|
clickIdpApplicationTemplateOption(): Promise<void>;
|
|
46
51
|
clickFormOption(): Promise<void>;
|
|
47
52
|
enterFormName(name: string): Promise<void>;
|
|
48
53
|
openFormRenameEditor(): Promise<void>;
|
|
49
54
|
clickProjectBreadcrumb(): Promise<void>;
|
|
55
|
+
clickWorkspaceBreadcrumb(): Promise<void>;
|
|
56
|
+
enterResourceContainer(name?: string): Promise<void>;
|
|
57
|
+
private clickCreateProcessApplication;
|
|
58
|
+
private ensureInResourceContainer;
|
|
59
|
+
returnToResourceContainer(): Promise<void>;
|
|
60
|
+
startBlankBpmnDiagram(): Promise<void>;
|
|
61
|
+
private becameVisible;
|
|
50
62
|
clickHomeBreadcrumb(): Promise<void>;
|
|
51
63
|
clickOpenOrganizationsButton(): Promise<void>;
|
|
52
64
|
clickCrossComponentProjectFolder(): Promise<void>;
|
|
@@ -4,10 +4,25 @@ exports.ModelerHomePage = 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 randomName_1 = require("../../utils/randomName");
|
|
8
|
+
const ProcessApplicationPage_1 = require("./ProcessApplicationPage");
|
|
7
9
|
const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
|
|
8
10
|
class ModelerHomePage {
|
|
9
11
|
defaultFolderName = 'Cross Component Test Project';
|
|
10
12
|
page;
|
|
13
|
+
// Since camunda/camunda-hub#25831 files and folders cannot sit at a
|
|
14
|
+
// workspace ("project" in today's UI) root -- only process applications and
|
|
15
|
+
// IDP applications can. The container is therefore entered lazily, at the
|
|
16
|
+
// point a resource is created, and remembered for the lifetime of this page
|
|
17
|
+
// object (one instance per test, see fixtures/8.7.ts). Specs that only
|
|
18
|
+
// need the workspace itself -- collaborators, IDP applications -- never
|
|
19
|
+
// trigger the hop.
|
|
20
|
+
processApplicationPage;
|
|
21
|
+
// Load-bearing: hub renders no process-application breadcrumb on a diagram
|
|
22
|
+
// page at container root, so the remembered URL -- not a breadcrumb click --
|
|
23
|
+
// is how we get back. Hub's own Playwright suite does the same.
|
|
24
|
+
processApplicationUrl;
|
|
25
|
+
processApplicationName;
|
|
11
26
|
modelerPageBanner;
|
|
12
27
|
createNewProjectButton;
|
|
13
28
|
projectNameInput;
|
|
@@ -20,6 +35,7 @@ class ModelerHomePage {
|
|
|
20
35
|
idpApplicationNameInput;
|
|
21
36
|
createIdpApplicationButton;
|
|
22
37
|
projectBreadcrumb;
|
|
38
|
+
workspaceBreadcrumb;
|
|
23
39
|
openOrganizationsButton;
|
|
24
40
|
optionsButton;
|
|
25
41
|
manageButton;
|
|
@@ -35,6 +51,7 @@ class ModelerHomePage {
|
|
|
35
51
|
renameFormMenuItem;
|
|
36
52
|
constructor(page) {
|
|
37
53
|
this.page = page;
|
|
54
|
+
this.processApplicationPage = new ProcessApplicationPage_1.ProcessApplicationPage(page);
|
|
38
55
|
this.modelerPageBanner = page.getByRole('banner', {
|
|
39
56
|
name: 'Camunda Modeler',
|
|
40
57
|
});
|
|
@@ -52,16 +69,23 @@ class ModelerHomePage {
|
|
|
52
69
|
name: 'Choose BPMN template',
|
|
53
70
|
});
|
|
54
71
|
this.diagramTypeDropdown = page.locator('[data-test="diagram-dropdown"]');
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
this.
|
|
59
|
-
|
|
60
|
-
.getByText('Form');
|
|
72
|
+
// Matched on the test id alone: hub's design-system variant of the create
|
|
73
|
+
// menu renders "BPMN diagram" (lowercase d), so a text filter breaks the
|
|
74
|
+
// day that variant ships.
|
|
75
|
+
this.bpmnTemplateOption = page.locator('[data-test="create-bpmn-diagram"]');
|
|
76
|
+
this.formTemplateOption = page.locator('[data-test="create-form"]');
|
|
61
77
|
this.idpTemplateOption = page
|
|
62
78
|
.locator('[data-test="create-idp-application"]')
|
|
63
79
|
.getByText('IDP Application');
|
|
64
80
|
this.projectBreadcrumb = page.locator('[data-test="breadcrumb-project"]');
|
|
81
|
+
// Kept separate from projectBreadcrumb, which now means "the container my
|
|
82
|
+
// resources live in". When hub's workspaces terminology flag flips,
|
|
83
|
+
// breadcrumb-project comes to denote the process application, so the
|
|
84
|
+
// workspace level needs its own name from the start.
|
|
85
|
+
this.workspaceBreadcrumb = page
|
|
86
|
+
.locator('[data-test="breadcrumb-project"]')
|
|
87
|
+
.or(page.locator('[data-test="breadcrumb-workspace"]'))
|
|
88
|
+
.first();
|
|
65
89
|
this.homeBreadcrumb = page.locator('[data-test="breadcrumb-home"]');
|
|
66
90
|
this.openOrganizationsButton = page.getByLabel('Open Organizations');
|
|
67
91
|
this.manageButton = page.getByRole('menuitem', { name: 'Manage' });
|
|
@@ -154,12 +178,32 @@ class ModelerHomePage {
|
|
|
154
178
|
.map((el) => el.textContent || '')
|
|
155
179
|
.filter((text) => text !== ''));
|
|
156
180
|
}
|
|
181
|
+
// Opens a resource where this test put it. Several specs leave Modeler
|
|
182
|
+
// entirely (to Operate, to Optimize) and come back via
|
|
183
|
+
// clickCrossComponentProjectFolder(), which lands at workspace root -- the
|
|
184
|
+
// resource is one level down, so re-enter the container first.
|
|
157
185
|
async clickProcessDiagram(name) {
|
|
186
|
+
await this.ensureInResourceContainer();
|
|
158
187
|
const process = this.rows.filter({ hasText: name }).getByTitle(name).first();
|
|
159
188
|
await (0, test_1.expect)(process).toBeVisible({ timeout: 90000 });
|
|
160
189
|
await process.click();
|
|
161
190
|
}
|
|
191
|
+
// Opens the create menu inside this test's process application. The menu at
|
|
192
|
+
// workspace root no longer offers BPMN, Form or Upload -- those resources
|
|
193
|
+
// cannot live there -- so the container is entered first. Callers are
|
|
194
|
+
// unchanged, which is why the existing spec call sites need no edit.
|
|
162
195
|
async clickDiagramTypeDropdown() {
|
|
196
|
+
await this.enterResourceContainer();
|
|
197
|
+
const dropdown = this.processApplicationPage.createNewDropdown;
|
|
198
|
+
await (0, test_1.expect)(dropdown).toBeVisible({
|
|
199
|
+
timeout: 60000,
|
|
200
|
+
});
|
|
201
|
+
await dropdown.click({ timeout: 120000 });
|
|
202
|
+
}
|
|
203
|
+
// Opens the create menu at workspace root, which is the only place process
|
|
204
|
+
// applications and IDP applications can be created. Everything else has to
|
|
205
|
+
// go through clickDiagramTypeDropdown().
|
|
206
|
+
async clickWorkspaceDiagramTypeDropdown() {
|
|
163
207
|
await (0, test_1.expect)(this.diagramTypeDropdown).toBeVisible({
|
|
164
208
|
timeout: 60000,
|
|
165
209
|
});
|
|
@@ -222,8 +266,109 @@ class ModelerHomePage {
|
|
|
222
266
|
await this.formBreadcrumbButton.click({ timeout: 60000 });
|
|
223
267
|
await this.renameFormMenuItem.click({ timeout: 30000 });
|
|
224
268
|
}
|
|
269
|
+
// Kept under its original name because it is what the existing call sites
|
|
270
|
+
// already mean: "go back to where my resources live". That is now the
|
|
271
|
+
// process application, not the workspace root.
|
|
225
272
|
async clickProjectBreadcrumb() {
|
|
226
|
-
await this.
|
|
273
|
+
await this.returnToResourceContainer();
|
|
274
|
+
}
|
|
275
|
+
// The workspace ("project") level itself, for the surfaces that genuinely
|
|
276
|
+
// live there -- collaborators, IDP applications, published element
|
|
277
|
+
// templates.
|
|
278
|
+
async clickWorkspaceBreadcrumb() {
|
|
279
|
+
await this.workspaceBreadcrumb.click({ timeout: 60000 });
|
|
280
|
+
}
|
|
281
|
+
// Creates, once per test, the process application that holds this test's
|
|
282
|
+
// resources, and leaves the browser inside it. Idempotent: called again while
|
|
283
|
+
// already in the container it is a no-op, so a spec that creates several
|
|
284
|
+
// resources in a row pays for the container once.
|
|
285
|
+
//
|
|
286
|
+
// One container per test rather than one shared with the seeded workspace:
|
|
287
|
+
// deploying is process-application-wide, so a shared container would let one
|
|
288
|
+
// spec's deploy pick up every other spec's half-modelled diagram.
|
|
289
|
+
async enterResourceContainer(name) {
|
|
290
|
+
if (this.processApplicationUrl) {
|
|
291
|
+
const stillInside = await this.becameVisible(this.processApplicationPage.breadcrumb, 5000);
|
|
292
|
+
if (!stillInside) {
|
|
293
|
+
await this.returnToResourceContainer();
|
|
294
|
+
}
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
this.processApplicationName =
|
|
298
|
+
name ??
|
|
299
|
+
(await (0, randomName_1.randomNameAgregator)('Cross Component Process Application'));
|
|
300
|
+
console.log(`Creating process application ${this.processApplicationName} inside ${this.defaultFolderName}`);
|
|
301
|
+
await this.clickCreateProcessApplication();
|
|
302
|
+
await this.processApplicationPage.nameNewProcessApplication(this.processApplicationName);
|
|
303
|
+
this.processApplicationUrl = this.page.url();
|
|
304
|
+
// Remember the container; its stage cluster is bound on the first deploy,
|
|
305
|
+
// by ProcessApplicationPage.ensureStageCluster, which -- unlike this point
|
|
306
|
+
// in the flow -- knows which cluster the test is going to deploy to.
|
|
307
|
+
this.processApplicationPage.rememberResourceContainer(this.processApplicationUrl);
|
|
308
|
+
}
|
|
309
|
+
// Which control creates a process application depends on the hub version
|
|
310
|
+
// under test. Since camunda/camunda-hub#25831 it is a plain primary button on
|
|
311
|
+
// the workspace root, and the "Create new" menu explicitly hides the item
|
|
312
|
+
// (hideProcessApplication) because a process application is no longer just
|
|
313
|
+
// another resource. Before that change the menu item was the only way in.
|
|
314
|
+
// Race both entry points so neither version pays a full timeout, then use
|
|
315
|
+
// whichever one rendered.
|
|
316
|
+
async clickCreateProcessApplication() {
|
|
317
|
+
const button = this.processApplicationPage.createProcessApplicationButton;
|
|
318
|
+
const rootLoaded = await this.becameVisible(button.or(this.diagramTypeDropdown).first(), 60000);
|
|
319
|
+
if (!rootLoaded) {
|
|
320
|
+
await this.page.reload();
|
|
321
|
+
}
|
|
322
|
+
// Short: the joint probe above already settled which branch rendered, and
|
|
323
|
+
// hub renders exactly one of them (EntityTable renders the toolbar's create
|
|
324
|
+
// menu OR the empty state, never both), so this only confirms which.
|
|
325
|
+
if (await this.becameVisible(button, 5000)) {
|
|
326
|
+
await this.processApplicationPage.clickCreateProcessApplicationButton();
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
await this.clickWorkspaceDiagramTypeDropdown();
|
|
330
|
+
await this.processApplicationPage.clickCreateProcessApplicationOption();
|
|
331
|
+
}
|
|
332
|
+
// Re-enters this test's container if it already has one, without creating
|
|
333
|
+
// one: opening an existing resource must not have the side effect of
|
|
334
|
+
// creating a container for a spec that never asked for it.
|
|
335
|
+
async ensureInResourceContainer() {
|
|
336
|
+
if (!this.processApplicationUrl) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
await this.enterResourceContainer();
|
|
340
|
+
}
|
|
341
|
+
// Navigates back to this test's process application by the remembered URL
|
|
342
|
+
// rather than by a breadcrumb click: hub renders no process-application
|
|
343
|
+
// breadcrumb on a diagram page at container root, and the breadcrumb that
|
|
344
|
+
// does exist on the container page doubles as its rename control. Hub's own
|
|
345
|
+
// Playwright suite navigates back the same way.
|
|
346
|
+
async returnToResourceContainer() {
|
|
347
|
+
if (!this.processApplicationUrl) {
|
|
348
|
+
await this.clickWorkspaceBreadcrumb();
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
await this.page.goto(this.processApplicationUrl, {
|
|
352
|
+
waitUntil: 'domcontentloaded',
|
|
353
|
+
});
|
|
354
|
+
await this.processApplicationPage.waitForProcessApplication();
|
|
355
|
+
await this.dismissOverlays();
|
|
356
|
+
}
|
|
357
|
+
// Single seam for "give me an empty BPMN diagram in this test's container".
|
|
358
|
+
// A process application always ships an auto-created main process; this adds
|
|
359
|
+
// a new diagram rather than adopting that one, so every existing modelling
|
|
360
|
+
// assertion keeps its current subject.
|
|
361
|
+
async startBlankBpmnDiagram() {
|
|
362
|
+
await this.clickDiagramTypeDropdown();
|
|
363
|
+
await this.clickBpmnTemplateOption();
|
|
364
|
+
}
|
|
365
|
+
// Boolean visibility probe. waitFor rather than isVisible, which resolves
|
|
366
|
+
// immediately and would report a false negative on a still-rendering page.
|
|
367
|
+
async becameVisible(locator, timeout) {
|
|
368
|
+
return locator
|
|
369
|
+
.waitFor({ state: 'visible', timeout })
|
|
370
|
+
.then(() => true)
|
|
371
|
+
.catch(() => false);
|
|
227
372
|
}
|
|
228
373
|
async clickHomeBreadcrumb() {
|
|
229
374
|
try {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Locator, Page } from '@playwright/test';
|
|
2
|
+
declare class ProcessApplicationPage {
|
|
3
|
+
private page;
|
|
4
|
+
readonly createProcessApplicationButton: Locator;
|
|
5
|
+
readonly createProcessApplicationOption: Locator;
|
|
6
|
+
readonly creationDialog: Locator;
|
|
7
|
+
readonly nameInput: Locator;
|
|
8
|
+
readonly submitButton: Locator;
|
|
9
|
+
readonly cancelButton: Locator;
|
|
10
|
+
readonly breadcrumb: Locator;
|
|
11
|
+
readonly folderExplorer: Locator;
|
|
12
|
+
readonly createNewDropdown: Locator;
|
|
13
|
+
readonly inlineNameInput: Locator;
|
|
14
|
+
readonly defineStagesDialog: Locator;
|
|
15
|
+
readonly developmentClusterSelect: Locator;
|
|
16
|
+
readonly defineStagesSaveButton: Locator;
|
|
17
|
+
constructor(page: Page);
|
|
18
|
+
private pageReady;
|
|
19
|
+
waitForProcessApplication(timeout?: number): Promise<void>;
|
|
20
|
+
clickCreateProcessApplicationButton(): Promise<void>;
|
|
21
|
+
clickCreateProcessApplicationOption(): Promise<void>;
|
|
22
|
+
nameNewProcessApplication(name: string): Promise<void>;
|
|
23
|
+
defineDevelopmentStage(clusterName?: string): Promise<void>;
|
|
24
|
+
rememberResourceContainer(url: string): void;
|
|
25
|
+
forgetStageCluster(): void;
|
|
26
|
+
ensureStageCluster(clusterName: string): Promise<boolean>;
|
|
27
|
+
private openStageDefinition;
|
|
28
|
+
openByName(name: string): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export { ProcessApplicationPage };
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProcessApplicationPage = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
const submitModalWithRetry_1 = require("../../utils/assertionHelpers/submitModalWithRetry");
|
|
6
|
+
// Which process application holds the current test's resources, and which
|
|
7
|
+
// cluster its development stage currently points at. Keyed by the Playwright
|
|
8
|
+
// Page because the object that creates the container (ModelerHomePage) and the
|
|
9
|
+
// objects that later need a specific cluster inside it (ModelerCreatePage,
|
|
10
|
+
// FormJsPage) hold separate ProcessApplicationPage instances but share one page.
|
|
11
|
+
const resourceContainers = new WeakMap();
|
|
12
|
+
// Since camunda/camunda-hub#25831 a process application is a first-class
|
|
13
|
+
// container rather than a folder, and a workspace root ("project" in today's
|
|
14
|
+
// UI) holds nothing but process applications and IDP applications. Every file
|
|
15
|
+
// and folder this suite creates therefore has to live inside a process
|
|
16
|
+
// application. This page object owns that container's surface only; entering
|
|
17
|
+
// and leaving it is driven from ModelerHomePage so the ~150 existing spec call
|
|
18
|
+
// sites keep working unchanged.
|
|
19
|
+
class ProcessApplicationPage {
|
|
20
|
+
page;
|
|
21
|
+
// Empty workspace root: a plain primary button rendered next to the "Create
|
|
22
|
+
// new" menu (hub's EmptyStateActionButtons).
|
|
23
|
+
createProcessApplicationButton;
|
|
24
|
+
// Non-empty root: the item inside the "Create new" menu. Hub passes
|
|
25
|
+
// hideProcessApplication at workspace level, so this is the fallback rather
|
|
26
|
+
// than the primary path -- its own unit test asserts the item is absent
|
|
27
|
+
// there. Kept because the Hub PR is still moving this surface.
|
|
28
|
+
createProcessApplicationOption;
|
|
29
|
+
creationDialog;
|
|
30
|
+
nameInput;
|
|
31
|
+
submitButton;
|
|
32
|
+
cancelButton;
|
|
33
|
+
breadcrumb;
|
|
34
|
+
folderExplorer;
|
|
35
|
+
createNewDropdown;
|
|
36
|
+
inlineNameInput;
|
|
37
|
+
// "Define stages" dialog, reached from the process application's "Connected
|
|
38
|
+
// clusters" card (or its /connected-clusters deep link). Assigning a cluster
|
|
39
|
+
// to a stage here is what makes it deployable: DeployModal renders
|
|
40
|
+
// ProcessAppClusterSelection for a process application, and that filters the
|
|
41
|
+
// cluster list through getProcessAppClustersByStage -- so a process
|
|
42
|
+
// application with no stage assigned offers no cluster at all.
|
|
43
|
+
defineStagesDialog;
|
|
44
|
+
developmentClusterSelect;
|
|
45
|
+
defineStagesSaveButton;
|
|
46
|
+
constructor(page) {
|
|
47
|
+
this.page = page;
|
|
48
|
+
// .first() defensively only: hub renders exactly one of these today, in the
|
|
49
|
+
// workspace-root empty state. A future second placement should not turn
|
|
50
|
+
// every PA-creating test into a strict-mode violation.
|
|
51
|
+
this.createProcessApplicationButton = page
|
|
52
|
+
.getByRole('button', { name: 'Create process application' })
|
|
53
|
+
.first();
|
|
54
|
+
this.createProcessApplicationOption = page.locator('[data-test="create-process-application"]');
|
|
55
|
+
this.creationDialog = page.getByRole('dialog', {
|
|
56
|
+
name: 'Create a process application',
|
|
57
|
+
});
|
|
58
|
+
// Deliberately scoped to the dialog: ModelerCreatePage owns an unscoped
|
|
59
|
+
// getByLabel('Name', {exact: true}) for the properties panel, which would
|
|
60
|
+
// resolve to two elements while the creation modal is open.
|
|
61
|
+
this.nameInput = this.creationDialog.getByLabel('Name', { exact: true });
|
|
62
|
+
this.submitButton = this.creationDialog.getByRole('button', {
|
|
63
|
+
name: 'Create',
|
|
64
|
+
exact: true,
|
|
65
|
+
});
|
|
66
|
+
this.cancelButton = this.creationDialog.getByRole('button', {
|
|
67
|
+
name: 'Cancel',
|
|
68
|
+
exact: true,
|
|
69
|
+
});
|
|
70
|
+
this.breadcrumb = page.locator('[data-test="breadcrumb-process-application-menu"]');
|
|
71
|
+
this.folderExplorer = page.getByRole('region', { name: 'Folder explorer' });
|
|
72
|
+
// The process application page renders more than one diagram-dropdown
|
|
73
|
+
// (hub's own unit tests reach for it with getAllByTestId), so the dropdown
|
|
74
|
+
// has to be resolved inside the folder explorer rather than page-wide.
|
|
75
|
+
this.createNewDropdown = this.folderExplorer
|
|
76
|
+
.locator('[data-test="diagram-dropdown"]')
|
|
77
|
+
.first();
|
|
78
|
+
this.inlineNameInput = page.locator('[data-test="editable-input"]');
|
|
79
|
+
this.defineStagesDialog = page
|
|
80
|
+
.getByRole('dialog')
|
|
81
|
+
.filter({ hasText: 'Define stages' });
|
|
82
|
+
// Carbon Dropdown / design-system Select both keep this id.
|
|
83
|
+
this.developmentClusterSelect = this.defineStagesDialog.locator('#dropdown-development-cluster');
|
|
84
|
+
this.defineStagesSaveButton = this.defineStagesDialog.getByRole('button', {
|
|
85
|
+
name: 'Save',
|
|
86
|
+
exact: true,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
// Either the folder explorer or the breadcrumb proves we are on the process
|
|
90
|
+
// application page; .first() because both are present once it has rendered.
|
|
91
|
+
pageReady() {
|
|
92
|
+
return this.folderExplorer.or(this.breadcrumb).first();
|
|
93
|
+
}
|
|
94
|
+
async waitForProcessApplication(timeout = 90000) {
|
|
95
|
+
await (0, test_1.expect)(this.pageReady()).toBeVisible({ timeout });
|
|
96
|
+
}
|
|
97
|
+
async clickCreateProcessApplicationButton() {
|
|
98
|
+
await (0, test_1.expect)(this.createProcessApplicationButton).toBeVisible({
|
|
99
|
+
timeout: 60000,
|
|
100
|
+
});
|
|
101
|
+
await this.createProcessApplicationButton.click({ timeout: 60000 });
|
|
102
|
+
}
|
|
103
|
+
async clickCreateProcessApplicationOption() {
|
|
104
|
+
await (0, test_1.expect)(this.createProcessApplicationOption).toBeVisible({
|
|
105
|
+
timeout: 60000,
|
|
106
|
+
});
|
|
107
|
+
await this.createProcessApplicationOption.click({ timeout: 60000 });
|
|
108
|
+
}
|
|
109
|
+
// Hub creates a process application through a modal today. It used an inline
|
|
110
|
+
// editable title before, and #27593 is still moving this surface, so the
|
|
111
|
+
// inline path is kept as a fallback — this is the one method that has to
|
|
112
|
+
// change if naming moves back inline.
|
|
113
|
+
async nameNewProcessApplication(name) {
|
|
114
|
+
const isModal = await this.creationDialog
|
|
115
|
+
.waitFor({ state: 'visible', timeout: 15000 })
|
|
116
|
+
.then(() => true)
|
|
117
|
+
.catch(() => false);
|
|
118
|
+
if (isModal) {
|
|
119
|
+
await this.nameInput.click({ timeout: 30000 });
|
|
120
|
+
await this.nameInput.fill(name);
|
|
121
|
+
await (0, test_1.expect)(this.nameInput).toHaveValue(name, { timeout: 10000 });
|
|
122
|
+
await (0, submitModalWithRetry_1.submitModalWithRetry)(this.submitButton, this.creationDialog);
|
|
123
|
+
await this.waitForProcessApplication();
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
await (0, test_1.expect)(this.inlineNameInput).toBeVisible({ timeout: 30000 });
|
|
127
|
+
await this.inlineNameInput.click({ timeout: 60000 });
|
|
128
|
+
await this.inlineNameInput.fill(name);
|
|
129
|
+
await this.inlineNameInput.press('Enter');
|
|
130
|
+
await this.waitForProcessApplication();
|
|
131
|
+
}
|
|
132
|
+
// Assigns a cluster to this process application's development stage.
|
|
133
|
+
//
|
|
134
|
+
// Deploying from inside a process application goes through
|
|
135
|
+
// ProcessAppClusterSelection, which only lists clusters the application has
|
|
136
|
+
// assigned to a stage, and does not auto-select anything when that list is
|
|
137
|
+
// empty. A freshly created process application has no stages, so the deploy
|
|
138
|
+
// dialog shows "Clusters not configured for stages" and offers nothing to
|
|
139
|
+
// pick -- which is why the old per-deploy cluster toggle was nowhere to be
|
|
140
|
+
// found. Assign the stage once, at creation, and the deploy dialog then
|
|
141
|
+
// auto-selects it.
|
|
142
|
+
//
|
|
143
|
+
// clusterName is matched as a prefix because the dropdown renders each
|
|
144
|
+
// cluster as "<name> <generation>". Without it, the first real cluster is
|
|
145
|
+
// taken -- callers that care assert the name in the deploy dialog anyway.
|
|
146
|
+
async defineDevelopmentStage(clusterName) {
|
|
147
|
+
await (0, test_1.expect)(this.defineStagesDialog).toBeVisible({ timeout: 60000 });
|
|
148
|
+
await this.developmentClusterSelect.click({ timeout: 30000 });
|
|
149
|
+
// Escape before interpolating: a cluster name can carry regex
|
|
150
|
+
// metacharacters -- "Test Cluster (v2)" is the common case -- which would
|
|
151
|
+
// otherwise mis-match or throw. Same treatment as
|
|
152
|
+
// utils/modelerCluster.selectModelerCluster.
|
|
153
|
+
const escapedClusterName = clusterName?.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
154
|
+
const option = clusterName
|
|
155
|
+
? this.defineStagesDialog
|
|
156
|
+
.getByRole('option', { name: new RegExp(`^${escapedClusterName}`) })
|
|
157
|
+
.first()
|
|
158
|
+
: this.defineStagesDialog
|
|
159
|
+
.getByRole('option')
|
|
160
|
+
.filter({ hasNotText: 'Select a development cluster' })
|
|
161
|
+
.first();
|
|
162
|
+
await option.click({ timeout: 30000 });
|
|
163
|
+
await this.defineStagesSaveButton.click({ timeout: 30000 });
|
|
164
|
+
await (0, test_1.expect)(this.defineStagesDialog).toBeHidden({ timeout: 60000 });
|
|
165
|
+
}
|
|
166
|
+
rememberResourceContainer(url) {
|
|
167
|
+
resourceContainers.set(this.page, { url });
|
|
168
|
+
}
|
|
169
|
+
// Drops the recorded development-stage binding so the next ensureStageCluster
|
|
170
|
+
// call binds again. Called when the deploy dialog turns out not to offer the
|
|
171
|
+
// cluster we believe we bound: the dialog offers exactly what the
|
|
172
|
+
// application's stages point at, so if the cluster is missing the binding
|
|
173
|
+
// did not take, and reopening the dialog can never change that. Without
|
|
174
|
+
// this, a caller's retries all re-check a state nothing is changing.
|
|
175
|
+
forgetStageCluster() {
|
|
176
|
+
const container = resourceContainers.get(this.page);
|
|
177
|
+
if (container) {
|
|
178
|
+
container.developmentCluster = undefined;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
// A process application deploys to the clusters bound to its stages, and
|
|
182
|
+
// nothing else: inside a container DeployModal renders
|
|
183
|
+
// ProcessAppClusterSelection, which lists only those and auto-selects the
|
|
184
|
+
// first. Which cluster a test wants is known only once a deploy flow names
|
|
185
|
+
// it, so the binding happens here, on demand -- leave the diagram, bind the
|
|
186
|
+
// cluster to the development stage, come back. Repeat calls for the same
|
|
187
|
+
// cluster cost nothing, and a test deploying to a second cluster rebinds.
|
|
188
|
+
// Returns whether it navigated: the caller may have been on a view that a
|
|
189
|
+
// reload does not restore -- Play is a tab click, not a URL -- and has to
|
|
190
|
+
// re-enter it.
|
|
191
|
+
async ensureStageCluster(clusterName) {
|
|
192
|
+
const container = resourceContainers.get(this.page);
|
|
193
|
+
if (!container || container.developmentCluster === clusterName) {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
const returnTo = this.page.url();
|
|
197
|
+
const paUrl = container.url.replace(/[?#].*$/, '').replace(/\/$/, '');
|
|
198
|
+
// Retried as a whole, re-entering the page on every attempt. This binding
|
|
199
|
+
// is a one-shot precondition for every deploy the test goes on to make,
|
|
200
|
+
// and unlike the deploy itself it sits outside runProcessInstance's retry
|
|
201
|
+
// loop -- so a single transient miss (the session bounced to /login, the
|
|
202
|
+
// cluster list not yet arrived when the dropdown opened) failed the test
|
|
203
|
+
// outright instead of being absorbed the way every other modal in this
|
|
204
|
+
// suite is. Re-navigating is the recovery; waiting longer on a page that
|
|
205
|
+
// has already gone wrong is not, which is why the inner timeouts stay
|
|
206
|
+
// short. A genuinely unbindable cluster still fails, with the same error.
|
|
207
|
+
await (0, test_1.expect)(async () => {
|
|
208
|
+
await this.page.goto(`${paUrl}/connected-clusters`, {
|
|
209
|
+
waitUntil: 'domcontentloaded',
|
|
210
|
+
});
|
|
211
|
+
await this.openStageDefinition();
|
|
212
|
+
await this.defineDevelopmentStage(clusterName);
|
|
213
|
+
}).toPass({ timeout: 240000, intervals: [1000, 2000, 5000] });
|
|
214
|
+
container.developmentCluster = clusterName;
|
|
215
|
+
await this.page.goto(returnTo, { waitUntil: 'domcontentloaded' });
|
|
216
|
+
return true;
|
|
217
|
+
}
|
|
218
|
+
// The /connected-clusters deep link opens the Define stages dialog by itself
|
|
219
|
+
// while the application has no stage bound. Once one is bound -- a test that
|
|
220
|
+
// deploys to a second cluster -- it has to be reopened from the page, so try
|
|
221
|
+
// the affordances hub offers before failing with exactly what was looked for.
|
|
222
|
+
// Worth the noise: an unbound cluster otherwise surfaces as a deploy dialog
|
|
223
|
+
// that silently offers nothing, which says nothing about its own cause.
|
|
224
|
+
async openStageDefinition() {
|
|
225
|
+
const opened = await this.defineStagesDialog
|
|
226
|
+
.waitFor({ state: 'visible', timeout: 15000 })
|
|
227
|
+
.then(() => true)
|
|
228
|
+
.catch(() => false);
|
|
229
|
+
if (opened) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
// Page-scoped .first(): hub renders one such control on this page, and a
|
|
233
|
+
// second placement must not turn every rebinding test into a strict-mode
|
|
234
|
+
// violation.
|
|
235
|
+
const reopen = this.page
|
|
236
|
+
.getByRole('button', { name: /define stages|edit stages|configure/i })
|
|
237
|
+
.first();
|
|
238
|
+
const canReopen = await reopen
|
|
239
|
+
.waitFor({ state: 'visible', timeout: 10000 })
|
|
240
|
+
.then(() => true)
|
|
241
|
+
.catch(() => false);
|
|
242
|
+
if (!canReopen) {
|
|
243
|
+
throw new Error('Could not open the "Define stages" dialog on /connected-clusters: it ' +
|
|
244
|
+
'did not open by itself and no "Define stages" / "Edit stages" / ' +
|
|
245
|
+
'"Configure" control was found.');
|
|
246
|
+
}
|
|
247
|
+
await reopen.click({ timeout: 30000 });
|
|
248
|
+
}
|
|
249
|
+
async openByName(name) {
|
|
250
|
+
const processApplication = this.page
|
|
251
|
+
.getByRole('row')
|
|
252
|
+
.filter({ hasText: name })
|
|
253
|
+
.getByTitle(name)
|
|
254
|
+
.first();
|
|
255
|
+
await (0, test_1.expect)(processApplication).toBeVisible({ timeout: 90000 });
|
|
256
|
+
await processApplication.click({ timeout: 60000 });
|
|
257
|
+
await this.waitForProcessApplication();
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
exports.ProcessApplicationPage = ProcessApplicationPage;
|
|
@@ -449,6 +449,14 @@ async function modelAndRunConnectorsTimerEventDiagram(modelerCreatePage, modeler
|
|
|
449
449
|
timeout: 60000,
|
|
450
450
|
});
|
|
451
451
|
await connectorMarketplacePage.downloadConnectorToProject();
|
|
452
|
+
// Both lookups are container-relative: clickProjectBreadcrumb() returns to
|
|
453
|
+
// this test's process application, which is where the uploaded diagram
|
|
454
|
+
// lives. The downloaded element template is the open question -- hub
|
|
455
|
+
// publishes element templates to the workspace, but the marketplace download
|
|
456
|
+
// is initiated from inside the container, so it should land there. If a
|
|
457
|
+
// trace shows the template at workspace root instead, this call becomes
|
|
458
|
+
// clickWorkspaceBreadcrumb() followed by returnToResourceContainer() before
|
|
459
|
+
// the diagram is reopened.
|
|
452
460
|
await modelerHomePage.clickProjectBreadcrumb();
|
|
453
461
|
await modelerHomePage.clickProcessDiagram('REST Outbound Connector');
|
|
454
462
|
await connectorTemplatePage.publishConnector();
|
|
@@ -98,7 +98,9 @@ _8_7_1.test.describe('IDP User Flow Tests', () => {
|
|
|
98
98
|
await modelerHomePage.clickCrossComponentProjectFolder();
|
|
99
99
|
});
|
|
100
100
|
await _8_7_1.test.step('Add an IDP application to the project', async () => {
|
|
101
|
-
|
|
101
|
+
// Workspace-level menu: an IDP application can only be created at
|
|
102
|
+
// workspace root, never inside a process application.
|
|
103
|
+
await modelerHomePage.clickWorkspaceDiagramTypeDropdown();
|
|
102
104
|
await modelerHomePage.clickIdpApplicationTemplateOption();
|
|
103
105
|
await modelerHomePage.enterIdpApplicationName(idpApplicationName);
|
|
104
106
|
await modelerHomePage.selectCluster(clusterName);
|