@camunda/e2e-test-suite 0.0.1328 → 0.0.1330
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/.github/c8_versions.json +1 -0
- package/README.md +1 -0
- package/dist/fixtures/8.11.d.ts +83 -0
- package/dist/fixtures/8.11.js +203 -0
- package/dist/pages/8.11/AppsPage.d.ts +60 -0
- package/dist/pages/8.11/AppsPage.js +1060 -0
- package/dist/pages/8.11/AuditLogPage.d.ts +14 -0
- package/dist/pages/8.11/AuditLogPage.js +69 -0
- package/dist/pages/8.11/Authorization.d.ts +44 -0
- package/dist/pages/8.11/Authorization.js +409 -0
- package/dist/pages/8.11/ClientCredentialsDetailsPage.d.ts +12 -0
- package/dist/pages/8.11/ClientCredentialsDetailsPage.js +36 -0
- package/dist/pages/8.11/ClusterDetailsPage.d.ts +107 -0
- package/dist/pages/8.11/ClusterDetailsPage.js +892 -0
- package/dist/pages/8.11/ClusterPage.d.ts +96 -0
- package/dist/pages/8.11/ClusterPage.js +657 -0
- package/dist/pages/8.11/ClusterSecretsPage.d.ts +48 -0
- package/dist/pages/8.11/ClusterSecretsPage.js +406 -0
- package/dist/pages/8.11/ConnectorMarketplacePage.d.ts +29 -0
- package/dist/pages/8.11/ConnectorMarketplacePage.js +156 -0
- package/dist/pages/8.11/ConnectorSettingsPage.d.ts +39 -0
- package/dist/pages/8.11/ConnectorSettingsPage.js +150 -0
- package/dist/pages/8.11/ConnectorTemplatePage.d.ts +11 -0
- package/dist/pages/8.11/ConnectorTemplatePage.js +34 -0
- package/dist/pages/8.11/ConsoleOrganizationPage.d.ts +77 -0
- package/dist/pages/8.11/ConsoleOrganizationPage.js +457 -0
- package/dist/pages/8.11/DataFiltersPage.d.ts +30 -0
- package/dist/pages/8.11/DataFiltersPage.js +135 -0
- package/dist/pages/8.11/FormJsPage.d.ts +38 -0
- package/dist/pages/8.11/FormJsPage.js +283 -0
- package/dist/pages/8.11/HomePage.d.ts +29 -0
- package/dist/pages/8.11/HomePage.js +176 -0
- package/dist/pages/8.11/IdpCreatePage.d.ts +118 -0
- package/dist/pages/8.11/IdpCreatePage.js +514 -0
- package/dist/pages/8.11/LoginPage.d.ts +45 -0
- package/dist/pages/8.11/LoginPage.js +214 -0
- package/dist/pages/8.11/ModelerCreatePage.d.ts +256 -0
- package/dist/pages/8.11/ModelerCreatePage.js +2272 -0
- package/dist/pages/8.11/ModelerHomePage.d.ts +100 -0
- package/dist/pages/8.11/ModelerHomePage.js +1168 -0
- package/dist/pages/8.11/ModelerUserInvitePage.d.ts +29 -0
- package/dist/pages/8.11/ModelerUserInvitePage.js +136 -0
- package/dist/pages/8.11/OCIdentityAuthorizationsPage.d.ts +11 -0
- package/dist/pages/8.11/OCIdentityAuthorizationsPage.js +25 -0
- package/dist/pages/8.11/OCIdentityClusterVariablesPage.d.ts +21 -0
- package/dist/pages/8.11/OCIdentityClusterVariablesPage.js +128 -0
- package/dist/pages/8.11/OCIdentityGroupsPage.d.ts +38 -0
- package/dist/pages/8.11/OCIdentityGroupsPage.js +176 -0
- package/dist/pages/8.11/OCIdentityHomePage.d.ts +21 -0
- package/dist/pages/8.11/OCIdentityHomePage.js +111 -0
- package/dist/pages/8.11/OCIdentityMappingRulesPage.d.ts +23 -0
- package/dist/pages/8.11/OCIdentityMappingRulesPage.js +124 -0
- package/dist/pages/8.11/OCIdentityRolesPage.d.ts +43 -0
- package/dist/pages/8.11/OCIdentityRolesPage.js +236 -0
- package/dist/pages/8.11/OperateHomePage.d.ts +28 -0
- package/dist/pages/8.11/OperateHomePage.js +150 -0
- package/dist/pages/8.11/OperateProcessInstancePage.d.ts +43 -0
- package/dist/pages/8.11/OperateProcessInstancePage.js +893 -0
- package/dist/pages/8.11/OperateProcessesPage.d.ts +28 -0
- package/dist/pages/8.11/OperateProcessesPage.js +153 -0
- package/dist/pages/8.11/OptimizeCollectionsPage.d.ts +30 -0
- package/dist/pages/8.11/OptimizeCollectionsPage.js +175 -0
- package/dist/pages/8.11/OptimizeDashboardPage.d.ts +11 -0
- package/dist/pages/8.11/OptimizeDashboardPage.js +71 -0
- package/dist/pages/8.11/OptimizeHomePage.d.ts +17 -0
- package/dist/pages/8.11/OptimizeHomePage.js +171 -0
- package/dist/pages/8.11/OptimizeReportPage.d.ts +49 -0
- package/dist/pages/8.11/OptimizeReportPage.js +184 -0
- package/dist/pages/8.11/OptimizeSharePage.d.ts +16 -0
- package/dist/pages/8.11/OptimizeSharePage.js +100 -0
- package/dist/pages/8.11/PlayPage.d.ts +17 -0
- package/dist/pages/8.11/PlayPage.js +157 -0
- package/dist/pages/8.11/ProcessApplicationPage.d.ts +32 -0
- package/dist/pages/8.11/ProcessApplicationPage.js +496 -0
- package/dist/pages/8.11/SettingsPage.d.ts +10 -0
- package/dist/pages/8.11/SettingsPage.js +53 -0
- package/dist/pages/8.11/SignUpPage.d.ts +42 -0
- package/dist/pages/8.11/SignUpPage.js +134 -0
- package/dist/pages/8.11/TaskDetailsPage.d.ts +77 -0
- package/dist/pages/8.11/TaskDetailsPage.js +324 -0
- package/dist/pages/8.11/TaskPanelPage.d.ts +26 -0
- package/dist/pages/8.11/TaskPanelPage.js +245 -0
- package/dist/pages/8.11/TaskProcessesPage.d.ts +18 -0
- package/dist/pages/8.11/TaskProcessesPage.js +134 -0
- package/dist/pages/8.11/UtilitiesPage.d.ts +56 -0
- package/dist/pages/8.11/UtilitiesPage.js +1024 -0
- package/dist/pages/8.11/WorkspaceMembersPage.d.ts +21 -0
- package/dist/pages/8.11/WorkspaceMembersPage.js +268 -0
- package/dist/tests/8.11/access-user-role-management.spec.d.ts +1 -0
- package/dist/tests/8.11/access-user-role-management.spec.js +487 -0
- package/dist/tests/8.11/agentic-ai-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/agentic-ai-user-flows.spec.js +209 -0
- package/dist/tests/8.11/aws-cluster-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/aws-cluster-user-flows.spec.js +188 -0
- package/dist/tests/8.11/aws-connectors-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/aws-connectors-user-flows.spec.js +167 -0
- package/dist/tests/8.11/cluster-variables.spec.d.ts +1 -0
- package/dist/tests/8.11/cluster-variables.spec.js +202 -0
- package/dist/tests/8.11/connectors-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/connectors-user-flows.spec.js +537 -0
- package/dist/tests/8.11/console-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/console-user-flows.spec.js +199 -0
- package/dist/tests/8.11/hto-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/hto-user-flows.spec.js +358 -0
- package/dist/tests/8.11/idp-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/idp-user-flows.spec.js +316 -0
- package/dist/tests/8.11/login-negative-tests.spec.d.ts +1 -0
- package/dist/tests/8.11/login-negative-tests.spec.js +29 -0
- package/dist/tests/8.11/login.spec.d.ts +1 -0
- package/dist/tests/8.11/login.spec.js +29 -0
- package/dist/tests/8.11/navigation.spec.d.ts +1 -0
- package/dist/tests/8.11/navigation.spec.js +59 -0
- package/dist/tests/8.11/operate-access-flow.spec.d.ts +1 -0
- package/dist/tests/8.11/operate-access-flow.spec.js +136 -0
- package/dist/tests/8.11/optimize-agentic-control-panel-api.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-agentic-control-panel-api.spec.js +96 -0
- package/dist/tests/8.11/optimize-agentic-control-panel-ui.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-agentic-control-panel-ui.spec.js +69 -0
- package/dist/tests/8.11/optimize-api-tests.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-api-tests.spec.js +1194 -0
- package/dist/tests/8.11/optimize-collections-api.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-collections-api.spec.js +184 -0
- package/dist/tests/8.11/optimize-collections-ui.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-collections-ui.spec.js +46 -0
- package/dist/tests/8.11/optimize-data-filters-api.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-data-filters-api.spec.js +195 -0
- package/dist/tests/8.11/optimize-data-filters-ui.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-data-filters-ui.spec.js +306 -0
- package/dist/tests/8.11/optimize-exporter-filters-importer-e2e.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-exporter-filters-importer-e2e.spec.js +316 -0
- package/dist/tests/8.11/optimize-sharing-alerts-export-api.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-sharing-alerts-export-api.spec.js +337 -0
- package/dist/tests/8.11/optimize-sharing-alerts-export-ui.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-sharing-alerts-export-ui.spec.js +198 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-audit-log.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-audit-log.spec.js +146 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-call-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-call-tools.spec.js +208 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-e2e-flow.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-e2e-flow.spec.js +151 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-list-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-list-tools.spec.js +242 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-cluster-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-cluster-tools.spec.js +75 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-incident-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-incident-tools.spec.js +123 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-user-task-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-user-task-tools.spec.js +151 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-variable-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-variable-tools.spec.js +123 -0
- package/dist/tests/8.11/play.spec.d.ts +1 -0
- package/dist/tests/8.11/play.spec.js +93 -0
- package/dist/tests/8.11/rba-enabled-v2-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/rba-enabled-v2-user-flows.spec.js +495 -0
- package/dist/tests/8.11/saas-migration-path-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/saas-migration-path-user-flows.spec.js +133 -0
- package/dist/tests/8.11/smoke-tests.spec.d.ts +1 -0
- package/dist/tests/8.11/smoke-tests.spec.js +339 -0
- package/dist/tests/8.11/test-setup.spec.d.ts +1 -0
- package/dist/tests/8.11/test-setup.spec.js +256 -0
- package/dist/tests/8.11/web-modeler-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/web-modeler-user-flows.spec.js +523 -0
- package/dist/utils/clusterVersions.d.ts +2 -1
- package/dist/utils/clusterVersions.js +1 -0
- package/dist/utils/consoleApiHelpers.js +1 -0
- package/package.json +1 -1
- package/playwright.config.ts +10 -0
|
@@ -0,0 +1,2272 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModelerCreatePage = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
const sleep_1 = require("../../utils/sleep");
|
|
6
|
+
const ConnectorMarketplacePage_1 = require("./ConnectorMarketplacePage");
|
|
7
|
+
const ProcessApplicationPage_1 = require("./ProcessApplicationPage");
|
|
8
|
+
const clickLocatorWithRetry_1 = require("../../utils/assertionHelpers/clickLocatorWithRetry");
|
|
9
|
+
const modelerCluster_1 = require("../../utils/modelerCluster");
|
|
10
|
+
const sessionRecovery_1 = require("../../utils/sessionRecovery");
|
|
11
|
+
class ModelerCreatePage {
|
|
12
|
+
page;
|
|
13
|
+
processApplicationPage;
|
|
14
|
+
generalPanel;
|
|
15
|
+
deployDiagramDialog;
|
|
16
|
+
processIdInput;
|
|
17
|
+
startEventElement;
|
|
18
|
+
appendTaskButton;
|
|
19
|
+
changeTypeButton;
|
|
20
|
+
userTaskOption;
|
|
21
|
+
appendEndEventButton;
|
|
22
|
+
startInstanceSubButton;
|
|
23
|
+
viewProcessInstanceLink;
|
|
24
|
+
nameInput;
|
|
25
|
+
diagramBreadcrumb;
|
|
26
|
+
diagramActionsButton;
|
|
27
|
+
renameDiagramNameButton;
|
|
28
|
+
diagramNameInput;
|
|
29
|
+
renameInput;
|
|
30
|
+
renameSubmitButton;
|
|
31
|
+
variableInput;
|
|
32
|
+
businessIdInput;
|
|
33
|
+
embedFormButton;
|
|
34
|
+
embedButton;
|
|
35
|
+
newForm;
|
|
36
|
+
deploySubButton;
|
|
37
|
+
deployMenuItem;
|
|
38
|
+
additionalActionsButton;
|
|
39
|
+
cancelButton;
|
|
40
|
+
restConnectorOption;
|
|
41
|
+
changeElementSearchInput;
|
|
42
|
+
changeElementTabStrip;
|
|
43
|
+
reusableAssetsTab;
|
|
44
|
+
webhookMessageStartEventConnectorOption;
|
|
45
|
+
webhookTab;
|
|
46
|
+
webhookIsActiveButton;
|
|
47
|
+
copyWebhookUrlToClipboardButton;
|
|
48
|
+
createTask;
|
|
49
|
+
createEndEvent;
|
|
50
|
+
canvas;
|
|
51
|
+
zoomOutButton;
|
|
52
|
+
endEventCanvas;
|
|
53
|
+
connectToOtherElementButton;
|
|
54
|
+
firstPlacedElement;
|
|
55
|
+
secondPlacedElement;
|
|
56
|
+
appendElementButton;
|
|
57
|
+
appendElementIndicator;
|
|
58
|
+
appendCreatePad;
|
|
59
|
+
payloadInput;
|
|
60
|
+
marketPlaceButton;
|
|
61
|
+
publicHolidayConnectorOption;
|
|
62
|
+
publicHolidayYearOption;
|
|
63
|
+
publicHolidayCountryCodeOption;
|
|
64
|
+
implementationSection;
|
|
65
|
+
implementationOptions;
|
|
66
|
+
intermediateBoundaryEvent;
|
|
67
|
+
intermediateWebhookConnectorOption;
|
|
68
|
+
correlationKeyProcessInput;
|
|
69
|
+
correlationKeyPayloadInput;
|
|
70
|
+
firstElement;
|
|
71
|
+
secondElement;
|
|
72
|
+
thirdElement;
|
|
73
|
+
payloadNameInput;
|
|
74
|
+
payloadNumberInput;
|
|
75
|
+
payloadCheckboxInput;
|
|
76
|
+
payloadDateInput;
|
|
77
|
+
form;
|
|
78
|
+
formPropertySection;
|
|
79
|
+
formLinkingTypeDropdown;
|
|
80
|
+
formLinkTypeOptions;
|
|
81
|
+
addFormJsonConfigurationInput;
|
|
82
|
+
publicationSection;
|
|
83
|
+
publicAccessToggle;
|
|
84
|
+
publicationTab;
|
|
85
|
+
copyPublicLinkButton;
|
|
86
|
+
closeButton;
|
|
87
|
+
rbaEnabledDeployedDialog;
|
|
88
|
+
viewProcessLink;
|
|
89
|
+
appendGatewayButton;
|
|
90
|
+
parallelGatewayOption;
|
|
91
|
+
firstPlacedGateway;
|
|
92
|
+
secondPlacedGateway;
|
|
93
|
+
serviceTaskOption;
|
|
94
|
+
taskDefinitionPanel;
|
|
95
|
+
jobTypeInput;
|
|
96
|
+
playTab;
|
|
97
|
+
continueToPlayButton;
|
|
98
|
+
assigneeInput;
|
|
99
|
+
candidateGroupsInput;
|
|
100
|
+
candidateUsersInput;
|
|
101
|
+
assignmentSection;
|
|
102
|
+
priorityInput;
|
|
103
|
+
startEventVariableInputWithThreeVariables;
|
|
104
|
+
zeebeRestAddressVariable;
|
|
105
|
+
variableAssignmentValueTextbox;
|
|
106
|
+
zeebeSecretVariable;
|
|
107
|
+
variableAssignmentValueTextboxSecondVariable;
|
|
108
|
+
zeebeClientIdVariable;
|
|
109
|
+
variableAssignmentValueTextboxThirdVariable;
|
|
110
|
+
connectorsDocHandlingStartEventElement;
|
|
111
|
+
detailsPanelToggle;
|
|
112
|
+
timerEventOption;
|
|
113
|
+
timerEventSettings;
|
|
114
|
+
timerType;
|
|
115
|
+
timerValue;
|
|
116
|
+
eighthPlacedElement;
|
|
117
|
+
deployAndRunMainButton;
|
|
118
|
+
deployAndRunSubButton;
|
|
119
|
+
deployRunActions;
|
|
120
|
+
deployAndRunMenuItem;
|
|
121
|
+
dialog;
|
|
122
|
+
backupDeployButton;
|
|
123
|
+
globalConnectToolButton;
|
|
124
|
+
formLinkedSuccessMessage;
|
|
125
|
+
webhookActiveMessage;
|
|
126
|
+
diagramNameBreadcrumb;
|
|
127
|
+
constructor(page) {
|
|
128
|
+
this.page = page;
|
|
129
|
+
this.processApplicationPage = new ProcessApplicationPage_1.ProcessApplicationPage(page);
|
|
130
|
+
this.generalPanel = page.locator('[data-group-id="group-general"]');
|
|
131
|
+
this.processIdInput = page.getByLabel('ID', { exact: true });
|
|
132
|
+
this.startEventElement = page.locator('.djs-hit').first();
|
|
133
|
+
// Match on the individual classes rather than the whole `class` attribute:
|
|
134
|
+
// an exact `[class="..."]` match breaks the moment bpmn-js reorders or adds
|
|
135
|
+
// a class, and it is the same shape camunda-hub's own e2e uses
|
|
136
|
+
// (`.djs-append-create-pad` + an `open` class assertion).
|
|
137
|
+
this.appendElementButton = page
|
|
138
|
+
.locator('.djs-append-create-pad.open')
|
|
139
|
+
.first();
|
|
140
|
+
// improved-canvas 1.11.0 (camunda-hub fe2b961, 2026-08-25) stopped
|
|
141
|
+
// auto-opening the append create pad for an element that already has an
|
|
142
|
+
// outgoing sequence flow. Such an element now only carries a "+" append
|
|
143
|
+
// indicator overlay; moving the pointer onto it swaps the create pad in at
|
|
144
|
+
// the same spot, which is what reveals the append entries.
|
|
145
|
+
this.appendElementIndicator = page
|
|
146
|
+
.locator('.djs-append-indicator.selected')
|
|
147
|
+
.first();
|
|
148
|
+
this.appendCreatePad = page.locator('.djs-append-create-pad').first();
|
|
149
|
+
this.appendTaskButton = page.getByRole('button', { name: 'Append task' });
|
|
150
|
+
this.changeTypeButton = page.getByRole('button', {
|
|
151
|
+
name: 'Change element',
|
|
152
|
+
exact: true,
|
|
153
|
+
});
|
|
154
|
+
// Anchor on the built-in entry's data-id: the popup also lists the
|
|
155
|
+
// project's deployed resources (`data-id="resources-replace-bpmnProcess-N"`)
|
|
156
|
+
// labelled with the diagram name, which makes a role+name match on
|
|
157
|
+
// 'User task' ambiguous as soon as such a diagram exists.
|
|
158
|
+
this.userTaskOption = page.locator('.djs-popup-results [data-id="replace-with-user-task"]');
|
|
159
|
+
// The user-task priority field renders as
|
|
160
|
+
// `<input type="number" id="bio-properties-panel-priorityDefinitionPriority">`,
|
|
161
|
+
// whose ARIA role is `spinbutton`, not `textbox`. A role=textbox query only
|
|
162
|
+
// matches it while the entry is flipped into FEEL mode (a CodeMirror
|
|
163
|
+
// editor), which is not a state this flow should depend on. Target the
|
|
164
|
+
// number input by its stable id instead.
|
|
165
|
+
this.priorityInput = page.locator('#bio-properties-panel-priorityDefinitionPriority');
|
|
166
|
+
this.appendEndEventButton = page.getByRole('button', {
|
|
167
|
+
name: 'Append end event',
|
|
168
|
+
});
|
|
169
|
+
this.dialog = page.getByRole('dialog');
|
|
170
|
+
this.deployAndRunMainButton = page.getByRole('button', {
|
|
171
|
+
name: 'Deploy & run',
|
|
172
|
+
exact: true,
|
|
173
|
+
});
|
|
174
|
+
// camunda-hub deploy-run-combo-action: both the Carbon ComboButton and
|
|
175
|
+
// the design-system SplitButton carry this test id.
|
|
176
|
+
this.deployRunActions = page.getByTestId('deploy-run-actions');
|
|
177
|
+
this.deployAndRunMenuItem = page.getByRole('menuitem', {
|
|
178
|
+
name: 'Deploy & run',
|
|
179
|
+
exact: true,
|
|
180
|
+
});
|
|
181
|
+
this.deployAndRunSubButton = this.dialog.getByRole('button', {
|
|
182
|
+
name: 'Deploy & run',
|
|
183
|
+
exact: true,
|
|
184
|
+
});
|
|
185
|
+
this.startInstanceSubButton = page
|
|
186
|
+
.getByRole('button', { name: 'Run' })
|
|
187
|
+
.last();
|
|
188
|
+
this.viewProcessInstanceLink = page.getByRole('button', {
|
|
189
|
+
name: 'View process instance',
|
|
190
|
+
});
|
|
191
|
+
this.viewProcessLink = page
|
|
192
|
+
.getByRole('button', { name: 'View process in Operate' })
|
|
193
|
+
.or(page.getByText('view process in Operate'))
|
|
194
|
+
.or(page.getByText(/^(Diagram|Project|Process application) deployed!$/))
|
|
195
|
+
.first();
|
|
196
|
+
this.nameInput = page.getByLabel('Name', { exact: true });
|
|
197
|
+
this.diagramBreadcrumb = page.locator('[data-test="breadcrumb-diagram"]');
|
|
198
|
+
// Hub's newer nav (isNavV2, camunda-hub use-file-page-actions.ts) renders
|
|
199
|
+
// no breadcrumb-diagram dropdown: Rename/Duplicate/Delete sit behind a
|
|
200
|
+
// kebab next to the current (last) crumb, named "<entity name> actions".
|
|
201
|
+
// Same locator as camunda-hub's own e2e BasePage.breadcrumbActionsButton.
|
|
202
|
+
this.diagramActionsButton = page
|
|
203
|
+
.getByRole('navigation', { name: 'Context navigation' })
|
|
204
|
+
.or(page.getByRole('navigation', { name: 'Breadcrumb', exact: true }))
|
|
205
|
+
.getByRole('button', { name: / actions$/ })
|
|
206
|
+
.last();
|
|
207
|
+
this.renameDiagramNameButton = page
|
|
208
|
+
.getByRole('menuitem', { name: 'Rename', exact: true })
|
|
209
|
+
.or(page.locator('[data-test="diagram-menu-item-rename-diagram"]'))
|
|
210
|
+
.first();
|
|
211
|
+
this.diagramNameInput = page.locator('[data-test="editable-input"]');
|
|
212
|
+
// The nav-v2 Rename opens a modal dialog (camunda-hub RenameDialog.tsx)
|
|
213
|
+
// instead of the legacy inline breadcrumb editor, and a fresh diagram no
|
|
214
|
+
// longer opens with its name in edit mode.
|
|
215
|
+
this.renameInput = page.locator('[data-test="rename-input"]');
|
|
216
|
+
this.renameSubmitButton = page.locator('[data-test="rename-submit"]');
|
|
217
|
+
this.variableInput = page.locator('textarea#variables-json');
|
|
218
|
+
this.businessIdInput = page.locator('[id^="business-id-input"]');
|
|
219
|
+
this.embedFormButton = page.getByRole('button', { name: 'Link form' });
|
|
220
|
+
// With workspaces on, Hub's "Link a form" picker is LinkTargetModal, which
|
|
221
|
+
// confirms with `link-target-confirm`; `confirm-move` is the legacy
|
|
222
|
+
// TargetSelector's.
|
|
223
|
+
this.embedButton = page
|
|
224
|
+
.locator('[data-test="link-target-confirm"]')
|
|
225
|
+
.or(page.locator('[data-test="confirm-move"]'))
|
|
226
|
+
.first();
|
|
227
|
+
this.newForm = page
|
|
228
|
+
.locator('[data-test="item-New form"]')
|
|
229
|
+
.getByText('New form');
|
|
230
|
+
this.deploySubButton = page.locator('[data-test="deploy-action"]');
|
|
231
|
+
this.cancelButton = page.getByRole('button', { name: 'Cancel' });
|
|
232
|
+
this.restConnectorOption = page.locator('[data-id="replace.template-io.camunda.connectors.HttpJson.v2"]');
|
|
233
|
+
this.changeElementSearchInput = page.locator('.djs-popup-search input');
|
|
234
|
+
this.changeElementTabStrip = page.locator('.djs-popup-tabs-container');
|
|
235
|
+
// The tab renders its label as text content, which wins over its `title`
|
|
236
|
+
// attribute in the accessible-name computation. Match case-insensitively:
|
|
237
|
+
// the label is capitalised differently across bpmn-js releases. Scope the
|
|
238
|
+
// lookup to the popup's own tab strip -- the properties panel renders its
|
|
239
|
+
// own tablist (see webhookTab below), so an unscoped tab query is
|
|
240
|
+
// ambiguous.
|
|
241
|
+
this.reusableAssetsTab = this.changeElementTabStrip.getByRole('tab', {
|
|
242
|
+
name: /reusable assets/i,
|
|
243
|
+
});
|
|
244
|
+
// bpmn-js popup entries are `li[role="option"]` inside a `role="listbox"`,
|
|
245
|
+
// so getByRole('listitem') no longer matches. Their accessible name also
|
|
246
|
+
// includes the entry description, and three entries share the label
|
|
247
|
+
// ("GitHub …", "Slack …", plain "Webhook …"), so name matching is
|
|
248
|
+
// ambiguous. Anchor on the entry's data-id — the same selector the hub's
|
|
249
|
+
// own e2e suite uses (`.djs-popup-results [data-id="<entryId>"]`).
|
|
250
|
+
this.webhookMessageStartEventConnectorOption = page.locator('.djs-popup-results [data-id="replace.template-io.camunda.connectors.webhook.WebhookConnectorStartMessage.v1"]');
|
|
251
|
+
this.webhookTab = page.getByRole('tab', { name: 'Webhook' });
|
|
252
|
+
this.webhookIsActiveButton = page.getByRole('button', {
|
|
253
|
+
name: 'Webhook is active in Test',
|
|
254
|
+
});
|
|
255
|
+
// Hub's design-system panel renders the webhook "Path" as a code block
|
|
256
|
+
// (<div data-slot="code-block"><pre><code>URL) with a separate copy button;
|
|
257
|
+
// the <code> holds the URL. The "Path" block precedes the log blocks.
|
|
258
|
+
this.copyWebhookUrlToClipboardButton = page
|
|
259
|
+
.getByRole('textbox', {
|
|
260
|
+
name: 'Copy to clipboard',
|
|
261
|
+
})
|
|
262
|
+
.or(page.locator('[data-slot="code-block"] code'))
|
|
263
|
+
.first();
|
|
264
|
+
this.createTask = page.getByTitle('Create task');
|
|
265
|
+
this.createEndEvent = page.getByTitle('Create end event');
|
|
266
|
+
this.canvas = page.locator('.djs-container');
|
|
267
|
+
this.zoomOutButton = page.locator('[data-test="zoom-out"]');
|
|
268
|
+
this.endEventCanvas = page.locator('[class="bjs-container"]');
|
|
269
|
+
this.connectToOtherElementButton = page.getByRole('button', {
|
|
270
|
+
name: 'Connect to other element',
|
|
271
|
+
});
|
|
272
|
+
this.firstPlacedElement = page.locator('g:nth-child(2) > .djs-element > .djs-hit');
|
|
273
|
+
this.secondPlacedElement = page.locator('g:nth-child(2) > .djs-element > .djs-hit');
|
|
274
|
+
this.payloadInput = page.locator('[class="fjs-input"]');
|
|
275
|
+
// camunda-hub's change-element popup replaced the Marketplace entry with
|
|
276
|
+
// "Browse all" (browse-all-popup-menu-provider.ts).
|
|
277
|
+
this.marketPlaceButton = page
|
|
278
|
+
.getByTitle('Browse Marketplace for more Connectors')
|
|
279
|
+
.or(page.getByTitle('Browse all available elements and assets'))
|
|
280
|
+
.first();
|
|
281
|
+
// Match either marketplace display name — the connector was renamed from
|
|
282
|
+
// "Public Holiday Outbound" to "Worldwide Public Holiday"; accepting both
|
|
283
|
+
// keeps the flow green whichever the marketplace currently serves.
|
|
284
|
+
this.publicHolidayConnectorOption = page
|
|
285
|
+
.locator('[data-test="modeler"]')
|
|
286
|
+
.getByText(/Worldwide Public Holiday|Public Holiday Outbound/)
|
|
287
|
+
.first();
|
|
288
|
+
this.publicHolidayYearOption = page.getByLabel('Year');
|
|
289
|
+
this.publicHolidayCountryCodeOption = page.getByLabel('Countrycode');
|
|
290
|
+
this.implementationSection = page.locator('[data-group-id="group-userTaskImplementation"]');
|
|
291
|
+
this.implementationOptions = page.locator('#bio-properties-panel-userTaskImplementation');
|
|
292
|
+
this.intermediateBoundaryEvent = page.getByRole('button', {
|
|
293
|
+
name: 'Append intermediate/boundary',
|
|
294
|
+
});
|
|
295
|
+
this.intermediateWebhookConnectorOption = page.locator('.djs-popup-results [data-id="replace.template-io.camunda.connectors.webhook.WebhookConnectorIntermediate.v1"]');
|
|
296
|
+
this.correlationKeyPayloadInput = page.getByLabel('Correlation key (payload)');
|
|
297
|
+
this.correlationKeyProcessInput = page.getByLabel('Correlation key (process)');
|
|
298
|
+
this.form = page.locator('[class="fjs-container"]');
|
|
299
|
+
this.firstElement = page.locator('[class="djs-element djs-shape"]').nth(0);
|
|
300
|
+
this.secondElement = page.locator('[class="djs-element djs-shape"]').nth(1);
|
|
301
|
+
this.thirdElement = page.locator('[class="djs-element djs-shape"]').nth(2);
|
|
302
|
+
this.processIdInput = page.getByLabel('ID', { exact: true });
|
|
303
|
+
this.payloadNameInput = page.getByLabel('Full Name');
|
|
304
|
+
this.payloadDateInput = page.getByLabel('Date of Birth');
|
|
305
|
+
this.payloadCheckboxInput = this.form.getByLabel('Agree');
|
|
306
|
+
this.payloadNumberInput = this.form.getByLabel('Count');
|
|
307
|
+
this.formPropertySection = page.locator('[data-group-id="group-form"]');
|
|
308
|
+
this.formLinkingTypeDropdown = page.getByLabel('Type');
|
|
309
|
+
this.formLinkTypeOptions = page.locator('#bio-properties-panel-formType');
|
|
310
|
+
this.addFormJsonConfigurationInput = page.getByLabel('Form JSON configuration');
|
|
311
|
+
this.publicationSection = page.locator('[data-group-id="group-process-publication"]');
|
|
312
|
+
this.publicAccessToggle = page.getByRole('switch', {
|
|
313
|
+
name: 'Toggle public access',
|
|
314
|
+
});
|
|
315
|
+
this.publicationTab = page.getByRole('tab', { name: 'Publication' });
|
|
316
|
+
// Legacy Carbon snippet (copy button) or Hub's design-system code block,
|
|
317
|
+
// whose <code> holds the link (see getPublicationLink()).
|
|
318
|
+
this.copyPublicLinkButton = page
|
|
319
|
+
.getByRole('button', {
|
|
320
|
+
name: 'Copy to clipboard',
|
|
321
|
+
})
|
|
322
|
+
.or(page.locator('[data-slot="code-block"]'))
|
|
323
|
+
.first();
|
|
324
|
+
this.closeButton = page.getByRole('button', { name: 'Close', exact: true });
|
|
325
|
+
this.rbaEnabledDeployedDialog = page.getByRole('dialog', {
|
|
326
|
+
name: 'Process successfully deployed',
|
|
327
|
+
});
|
|
328
|
+
// Since camunda/camunda-hub#25831 a diagram deploys as part of its process
|
|
329
|
+
// application and hub titles the modal for the application, not for the
|
|
330
|
+
// single resource, so an exact 'Deploy diagram' name no longer matches.
|
|
331
|
+
// Match on the verb -- pages/SM-8.10 already leaves this unfiltered.
|
|
332
|
+
this.deployDiagramDialog = page.getByRole('dialog', {
|
|
333
|
+
name: /^Deploy/,
|
|
334
|
+
});
|
|
335
|
+
this.appendGatewayButton = page.getByRole('button', {
|
|
336
|
+
name: 'Append gateway',
|
|
337
|
+
});
|
|
338
|
+
this.parallelGatewayOption = page.getByText('parallel gateway');
|
|
339
|
+
this.firstPlacedGateway = page
|
|
340
|
+
.locator('[data-element-id*="Gateway"]')
|
|
341
|
+
.first();
|
|
342
|
+
this.secondPlacedGateway = page
|
|
343
|
+
.locator('[data-element-id*="Gateway"]')
|
|
344
|
+
.last();
|
|
345
|
+
this.serviceTaskOption = page.locator('.djs-popup-results [data-id="replace-with-service-task"]');
|
|
346
|
+
this.taskDefinitionPanel = page.locator('[data-group-id="group-taskDefinition"]');
|
|
347
|
+
this.jobTypeInput = page.getByRole('textbox', { name: /job type/i });
|
|
348
|
+
// Modeler renamed the third mode tab "Play" -> "Test" (camunda-hub
|
|
349
|
+
// a90fd06). Accept either label; the "Test" branch is scoped to the modes
|
|
350
|
+
// tablist because the details panel also renders a tab named "Test".
|
|
351
|
+
this.playTab = page
|
|
352
|
+
.getByRole('tab', { name: 'Play' })
|
|
353
|
+
.or(page
|
|
354
|
+
.getByRole('tablist', { name: 'List of modes' })
|
|
355
|
+
.getByRole('tab', { name: 'Test', exact: true }));
|
|
356
|
+
this.continueToPlayButton = page.getByRole('button', { name: 'Continue' });
|
|
357
|
+
this.assignmentSection = page.locator('[data-group-id="group-assignmentDefinition"]');
|
|
358
|
+
this.assigneeInput = page.getByRole('textbox', { name: 'assignee' });
|
|
359
|
+
this.candidateGroupsInput = page.getByRole('textbox', {
|
|
360
|
+
name: 'candidate groups',
|
|
361
|
+
});
|
|
362
|
+
this.candidateUsersInput = page.getByRole('textbox', {
|
|
363
|
+
name: 'candidate users',
|
|
364
|
+
});
|
|
365
|
+
this.appendGatewayButton = page.getByRole('button', {
|
|
366
|
+
name: 'Append gateway',
|
|
367
|
+
});
|
|
368
|
+
this.parallelGatewayOption = page.getByText('parallel gateway');
|
|
369
|
+
this.firstPlacedGateway = page
|
|
370
|
+
.locator('[data-element-id*="Gateway"]')
|
|
371
|
+
.first();
|
|
372
|
+
this.secondPlacedGateway = page
|
|
373
|
+
.locator('[data-element-id*="Gateway"]')
|
|
374
|
+
.last();
|
|
375
|
+
this.startEventVariableInputWithThreeVariables =
|
|
376
|
+
page.getByText('Output mapping3');
|
|
377
|
+
this.zeebeRestAddressVariable = page
|
|
378
|
+
.locator('[data-test="properties-panel"]')
|
|
379
|
+
.getByText('zeebeRestAdress');
|
|
380
|
+
this.variableAssignmentValueTextbox = page.getByRole('textbox', {
|
|
381
|
+
name: 'Variable assignment value',
|
|
382
|
+
});
|
|
383
|
+
this.zeebeSecretVariable = page
|
|
384
|
+
.locator('[data-test="properties-panel"]')
|
|
385
|
+
.getByText('zeebeSecret');
|
|
386
|
+
this.variableAssignmentValueTextboxSecondVariable = page.locator('#bio-properties-panel-StartEvent_1-output-1-source div');
|
|
387
|
+
this.zeebeClientIdVariable = page
|
|
388
|
+
.locator('[data-test="properties-panel"]')
|
|
389
|
+
.getByText('zeebeClientId');
|
|
390
|
+
this.variableAssignmentValueTextboxThirdVariable = page.locator('#bio-properties-panel-StartEvent_1-output-2-source div');
|
|
391
|
+
this.connectorsDocHandlingStartEventElement = page.locator('g:nth-child(5) > .djs-element > .djs-hit');
|
|
392
|
+
this.detailsPanelToggle = page.locator('[data-test="details-panel-toggle"]');
|
|
393
|
+
this.timerEventOption = page.locator('.djs-popup-results [data-id="replace-with-timer-intermediate-catch"]');
|
|
394
|
+
this.timerEventSettings = page.getByText(/^Timer$/).first();
|
|
395
|
+
this.timerType = page.getByLabel('Type');
|
|
396
|
+
this.timerValue = page.getByLabel('Value');
|
|
397
|
+
this.eighthPlacedElement = page
|
|
398
|
+
.locator('g:nth-child(8) > .djs-element > .djs-hit')
|
|
399
|
+
.first();
|
|
400
|
+
this.additionalActionsButton = page.getByRole('button', {
|
|
401
|
+
name: 'Additional actions',
|
|
402
|
+
});
|
|
403
|
+
this.deployMenuItem = page.getByRole('menuitem', {
|
|
404
|
+
name: 'Deploy',
|
|
405
|
+
});
|
|
406
|
+
this.backupDeployButton = page.getByRole('button', {
|
|
407
|
+
name: 'Deploy',
|
|
408
|
+
});
|
|
409
|
+
this.globalConnectToolButton = page.locator('[title="Activate global connect tool"]');
|
|
410
|
+
// Under the design system Hub raises this as a design-system toast, not a
|
|
411
|
+
// Carbon `cds--toast-*` node, so match the message text itself.
|
|
412
|
+
this.formLinkedSuccessMessage = page
|
|
413
|
+
.getByText('Form has been successfully linked.')
|
|
414
|
+
.or(page
|
|
415
|
+
.locator('.cds--toast-notification__subtitle')
|
|
416
|
+
.getByText('Form has been successfully linked.'))
|
|
417
|
+
.first();
|
|
418
|
+
// The legacy breadcrumb shows the name directly; the nav-v2 kebab embeds
|
|
419
|
+
// it in its own accessible name ("<name> actions").
|
|
420
|
+
this.diagramNameBreadcrumb = (diagramName) => page
|
|
421
|
+
.locator('button[data-test="breadcrumb-diagram"]', {
|
|
422
|
+
hasText: diagramName,
|
|
423
|
+
})
|
|
424
|
+
.or(page.getByRole('button', { name: `${diagramName} actions` }))
|
|
425
|
+
.first();
|
|
426
|
+
this.webhookActiveMessage = page.getByText('Webhook is active');
|
|
427
|
+
}
|
|
428
|
+
async clickSecondDeployButton() {
|
|
429
|
+
await this.deployAndRunMainButton
|
|
430
|
+
.or(this.backupDeployButton)
|
|
431
|
+
.click({ timeout: 30000 });
|
|
432
|
+
}
|
|
433
|
+
async modelJobWorkerDiagram(processName, embedFrom = false, processId = '') {
|
|
434
|
+
await (0, test_1.expect)(this.generalPanel).toBeVisible({
|
|
435
|
+
timeout: 120000,
|
|
436
|
+
});
|
|
437
|
+
await this.enterDiagramName(processName);
|
|
438
|
+
await (0, sleep_1.sleep)(10000);
|
|
439
|
+
if (processId.length > 0) {
|
|
440
|
+
await this.clickStartEventElement();
|
|
441
|
+
await this.clickGeneralPropertiesPanel();
|
|
442
|
+
await this.clickIdInput();
|
|
443
|
+
await this.fillIdInput(processId);
|
|
444
|
+
await this.clickStartEventElement();
|
|
445
|
+
}
|
|
446
|
+
await this.clickAppendElementButton();
|
|
447
|
+
await this.clickAppendTaskButton();
|
|
448
|
+
await this.clickChangeTypeButton();
|
|
449
|
+
await this.clickUserTaskOption();
|
|
450
|
+
await this.chooseImplementationOption('jobWorker');
|
|
451
|
+
await (0, sleep_1.sleep)(3000);
|
|
452
|
+
if (embedFrom) {
|
|
453
|
+
await this.chooseFormLinkingTypeOption('Camunda Form (embedded)');
|
|
454
|
+
}
|
|
455
|
+
await this.clickAppendElementButton();
|
|
456
|
+
await this.clickAppendEndEventButton();
|
|
457
|
+
await (0, sleep_1.sleep)(20000);
|
|
458
|
+
}
|
|
459
|
+
// Opening the freshly created diagram occasionally lands on a bare gateway
|
|
460
|
+
// error page instead of the editor (the nightly captured Envoy's "upstream
|
|
461
|
+
// connect error or disconnect/reset before headers" plain-text response). That
|
|
462
|
+
// page never renders the properties panel, so one long wait just burns the
|
|
463
|
+
// whole budget before failing; reload between attempts so the blip recovers.
|
|
464
|
+
async waitForDiagramEditorToLoad() {
|
|
465
|
+
const maxAttempts = 3;
|
|
466
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
467
|
+
try {
|
|
468
|
+
await (0, test_1.expect)(this.generalPanel).toBeVisible({ timeout: 60000 });
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
catch (error) {
|
|
472
|
+
if (attempt === maxAttempts - 1) {
|
|
473
|
+
throw error;
|
|
474
|
+
}
|
|
475
|
+
// A reload cannot bring the editor back while the tab is mid-logout
|
|
476
|
+
// bounce -- it only restarts it -- so let hub finish returning to the
|
|
477
|
+
// diagram first, and reload only if it never does.
|
|
478
|
+
if (await this.waitForModelerSession()) {
|
|
479
|
+
continue;
|
|
480
|
+
}
|
|
481
|
+
console.warn(`Diagram editor did not load on attempt ${attempt + 1}; reloading.`);
|
|
482
|
+
await this.page.reload();
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
// True while the tab is sitting on Modeler's own login surface rather than in
|
|
487
|
+
// the app. Hub can throw a modelling session out mid-flow: when a request
|
|
488
|
+
// comes back 401 -- or the late `POST /api/internal/login` 500 that
|
|
489
|
+
// `AppsPage.openModelerWithRetry` guards the hand-off against lands after
|
|
490
|
+
// entry has already been cleared -- auth-service calls logout() and the tab
|
|
491
|
+
// is bounced to `modeler.<host>/login?returnUrl=<the diagram>`.
|
|
492
|
+
onModelerLoginPage(url = this.page.url()) {
|
|
493
|
+
try {
|
|
494
|
+
const { hostname, pathname } = new URL(url);
|
|
495
|
+
return (hostname.startsWith('modeler.') &&
|
|
496
|
+
/^\/login(-callback)?\/?$/.test(pathname));
|
|
497
|
+
}
|
|
498
|
+
catch {
|
|
499
|
+
// Not a parsable URL yet (e.g. a tab still on about:blank).
|
|
500
|
+
return false;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
// Waits out that bounce. The IdP session itself is still alive, so hub
|
|
504
|
+
// completes the round trip on its own and comes back to the diagram named in
|
|
505
|
+
// returnUrl -- but anything issued in the meantime waits out its whole
|
|
506
|
+
// timeout against a login screen instead, which is how linking a form
|
|
507
|
+
// reported `locator.click: Timeout 90000ms exceeded ... navigated to
|
|
508
|
+
// https://modeler.<host>/login?returnUrl=%2Fdiagrams%2F...`. Reports whether
|
|
509
|
+
// the tab made it back, so a caller can redo what the sign-out interrupted.
|
|
510
|
+
async waitForModelerSession(timeout = 120000) {
|
|
511
|
+
if (!this.onModelerLoginPage()) {
|
|
512
|
+
return false;
|
|
513
|
+
}
|
|
514
|
+
return await this.page
|
|
515
|
+
.waitForURL((url) => !this.onModelerLoginPage(url.toString()), { timeout })
|
|
516
|
+
.then(() => true)
|
|
517
|
+
.catch(() => false);
|
|
518
|
+
}
|
|
519
|
+
// Links `formName` to the selected user task, redoing the link when the tab
|
|
520
|
+
// is signed out while it is in flight. The picker is a modal on the diagram
|
|
521
|
+
// page, so the logout bounce takes it down with the page: once hub has
|
|
522
|
+
// returned to the diagram the whole link has to be driven again, not just
|
|
523
|
+
// the click that was interrupted. The element stays selected across the
|
|
524
|
+
// round trip -- its id travels in the returnUrl -- so the properties panel
|
|
525
|
+
// comes back with the "Link form" control in place. Watched via
|
|
526
|
+
// `framenavigated` rather than by re-reading the URL afterwards, because the
|
|
527
|
+
// bounce can finish inside the failing click's own timeout and leave nothing
|
|
528
|
+
// behind to detect.
|
|
529
|
+
async linkFormToUserTask(formName) {
|
|
530
|
+
let signedOutMidFlow = false;
|
|
531
|
+
const watchForSignOut = (frame) => {
|
|
532
|
+
if (frame === this.page.mainFrame() &&
|
|
533
|
+
this.onModelerLoginPage(frame.url())) {
|
|
534
|
+
signedOutMidFlow = true;
|
|
535
|
+
}
|
|
536
|
+
};
|
|
537
|
+
this.page.on('framenavigated', watchForSignOut);
|
|
538
|
+
try {
|
|
539
|
+
await this.clickEmbedFormButton();
|
|
540
|
+
await this.clickForm(formName);
|
|
541
|
+
await this.clickEmbedButton();
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
catch (error) {
|
|
545
|
+
if (!signedOutMidFlow) {
|
|
546
|
+
throw error;
|
|
547
|
+
}
|
|
548
|
+
console.warn('Session was dropped while linking the form; waiting for Modeler to ' +
|
|
549
|
+
'come back and linking again.');
|
|
550
|
+
await this.waitForModelerSession();
|
|
551
|
+
}
|
|
552
|
+
finally {
|
|
553
|
+
this.page.off('framenavigated', watchForSignOut);
|
|
554
|
+
}
|
|
555
|
+
await this.waitForDiagramEditorToLoad();
|
|
556
|
+
await this.clickEmbedFormButton();
|
|
557
|
+
await this.clickForm(formName);
|
|
558
|
+
await this.clickEmbedButton();
|
|
559
|
+
}
|
|
560
|
+
async modelCamundaUserTaskDiagram(processName, processId = '', formName = '') {
|
|
561
|
+
await this.waitForDiagramEditorToLoad();
|
|
562
|
+
await this.enterDiagramName(processName);
|
|
563
|
+
await (0, sleep_1.sleep)(15000);
|
|
564
|
+
if (processId.length > 0) {
|
|
565
|
+
await this.clickStartEventElement();
|
|
566
|
+
await this.clickGeneralPropertiesPanel();
|
|
567
|
+
// Renaming the file does not reliably rename the process: hub only syncs
|
|
568
|
+
// the new file name into the BPMN process name from inside
|
|
569
|
+
// `renameDiagram`, which returns early when the submitted name already
|
|
570
|
+
// equals the stored one (camunda-hub
|
|
571
|
+
// `stores/current-diagram-store.tsx` -> `checkAndSyncProcessName`). Any
|
|
572
|
+
// rename attempt that commits server-side but is not observed in time --
|
|
573
|
+
// the case `enterDiagramName`'s retry loop exists for -- therefore
|
|
574
|
+
// leaves the process named "New BPMN diagram" while the breadcrumb shows
|
|
575
|
+
// the new name, which is exactly what the nightly screenshot showed.
|
|
576
|
+
// Tasklist and Operate list the process *name*, so the task can then
|
|
577
|
+
// never be found by `processName`. Set it explicitly, the same way
|
|
578
|
+
// `UtilitiesPage` already does for uploaded diagrams.
|
|
579
|
+
await this.clickNameInput();
|
|
580
|
+
await this.fillNamedInput(processName);
|
|
581
|
+
await this.clickIdInput();
|
|
582
|
+
await this.fillIdInput(processId);
|
|
583
|
+
await this.clickStartEventElement();
|
|
584
|
+
}
|
|
585
|
+
await this.clickAppendElementButton();
|
|
586
|
+
await this.clickAppendTaskButton();
|
|
587
|
+
await this.clickChangeTypeButton();
|
|
588
|
+
await this.clickUserTaskOption();
|
|
589
|
+
await this.assertImplementationOption('zeebeUserTask');
|
|
590
|
+
if (formName.length > 0) {
|
|
591
|
+
await this.linkFormToUserTask(formName);
|
|
592
|
+
}
|
|
593
|
+
await this.clickAppendElementButton();
|
|
594
|
+
await this.clickAppendEndEventButton();
|
|
595
|
+
await this.clickCanvas();
|
|
596
|
+
await this.assertThreeElementsVisible();
|
|
597
|
+
await (0, sleep_1.sleep)(20000);
|
|
598
|
+
}
|
|
599
|
+
async assignToCandidateGroup(taskName, candidateGroup, assignee) {
|
|
600
|
+
await this.clickCanvas();
|
|
601
|
+
await this.selectUserTask(taskName);
|
|
602
|
+
await this.expandAssignmentSection();
|
|
603
|
+
await this.clickCandidateGroupsInput();
|
|
604
|
+
await this.fillCandidateGroupsInput(candidateGroup);
|
|
605
|
+
if (assignee) {
|
|
606
|
+
await this.clickAssigneeInput();
|
|
607
|
+
await this.fillAssigneeInput(assignee);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
async assignToCandidateUser(taskName, candidateUser, assignee) {
|
|
611
|
+
await this.clickCanvas();
|
|
612
|
+
await this.selectUserTask(taskName);
|
|
613
|
+
await this.expandAssignmentSection();
|
|
614
|
+
await this.clickCandidateUsersInput();
|
|
615
|
+
await this.fillCandidateUsersInput(candidateUser);
|
|
616
|
+
if (assignee) {
|
|
617
|
+
await this.clickAssigneeInput();
|
|
618
|
+
await this.fillAssigneeInput(assignee);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
async expandAssignmentSection() {
|
|
622
|
+
const isExpanded = (await this.assignmentSection
|
|
623
|
+
.locator('[data-group-id="group-assignmentDefinition"] .bio-properties-panel-group-header.open')
|
|
624
|
+
.count()) > 0;
|
|
625
|
+
if (!isExpanded) {
|
|
626
|
+
await this.assignmentSection.click({ timeout: 60000 });
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
async expandFormsSection() {
|
|
630
|
+
const isExpanded = (await this.formPropertySection
|
|
631
|
+
.locator('[data-group-id="group-form"] .bio-properties-panel-group-header.open')
|
|
632
|
+
.count()) > 0;
|
|
633
|
+
if (!isExpanded) {
|
|
634
|
+
await this.formPropertySection.click({ timeout: 60000 });
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
async clickAssigneeInput() {
|
|
638
|
+
await this.assigneeInput.click({ timeout: 60000 });
|
|
639
|
+
}
|
|
640
|
+
async fillAssigneeInput(name) {
|
|
641
|
+
await this.assigneeInput.fill(name, { timeout: 60000 });
|
|
642
|
+
await this.page.waitForTimeout(1000);
|
|
643
|
+
}
|
|
644
|
+
async clickCandidateGroupsInput() {
|
|
645
|
+
await this.candidateGroupsInput.click({ timeout: 60000 });
|
|
646
|
+
}
|
|
647
|
+
async fillCandidateGroupsInput(name) {
|
|
648
|
+
await this.candidateGroupsInput.fill(name, { timeout: 60000 });
|
|
649
|
+
await this.page.waitForTimeout(1000);
|
|
650
|
+
}
|
|
651
|
+
async clickCandidateUsersInput() {
|
|
652
|
+
await this.candidateUsersInput.click({ timeout: 60000 });
|
|
653
|
+
}
|
|
654
|
+
async fillCandidateUsersInput(candidateUser) {
|
|
655
|
+
await this.candidateUsersInput.fill(candidateUser, { timeout: 60000 });
|
|
656
|
+
await this.page.waitForTimeout(1000);
|
|
657
|
+
}
|
|
658
|
+
async selectUserTask(userTask) {
|
|
659
|
+
await this.page.locator(`[data-element-id="${userTask}"]`).click();
|
|
660
|
+
}
|
|
661
|
+
async clickGeneralPropertiesPanel() {
|
|
662
|
+
const isExpanded = (await this.generalPanel
|
|
663
|
+
.locator('.bio-properties-panel-group-header.open')
|
|
664
|
+
.count()) > 0;
|
|
665
|
+
if (!isExpanded) {
|
|
666
|
+
await this.generalPanel.click({ timeout: 60000 });
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
async clickProcessIdInput() {
|
|
670
|
+
await this.processIdInput.click({ timeout: 60000 });
|
|
671
|
+
}
|
|
672
|
+
async fillProcessIdInput(id) {
|
|
673
|
+
await this.processIdInput.fill(id, { timeout: 60000 });
|
|
674
|
+
}
|
|
675
|
+
async clickStartEventElement() {
|
|
676
|
+
await (0, test_1.expect)(this.startEventElement).toBeVisible({ timeout: 15000 });
|
|
677
|
+
await this.startEventElement.click();
|
|
678
|
+
}
|
|
679
|
+
async clickAppendTaskButton() {
|
|
680
|
+
await (0, test_1.expect)(this.appendTaskButton).toBeVisible({ timeout: 15000 });
|
|
681
|
+
await this.appendTaskButton.click();
|
|
682
|
+
}
|
|
683
|
+
async clickChangeTypeButton() {
|
|
684
|
+
await (0, test_1.expect)(this.changeTypeButton).toBeVisible({ timeout: 15000 });
|
|
685
|
+
await this.changeTypeButton.click();
|
|
686
|
+
}
|
|
687
|
+
async clickUserTaskOption() {
|
|
688
|
+
await (0, test_1.expect)(this.userTaskOption).toBeVisible({ timeout: 15000 });
|
|
689
|
+
await this.userTaskOption.click();
|
|
690
|
+
}
|
|
691
|
+
async clickForm(name) {
|
|
692
|
+
// Baseline upgrade runs use fixed form names, so a Playwright retry re-creates
|
|
693
|
+
// a form with the same name and the picker then lists two identical entries.
|
|
694
|
+
// Scope to the first matching item so the link step stays deterministic on retry
|
|
695
|
+
// instead of failing with a strict-mode violation.
|
|
696
|
+
// LinkTargetModal lists each form as a button labelled "Select <name>"
|
|
697
|
+
// inside `link-target-list` and renders no `item-<name>` node; the legacy
|
|
698
|
+
// id stays as a fallback for the TargetSelector picker.
|
|
699
|
+
await this.page
|
|
700
|
+
.locator('[data-test="link-target-list"]')
|
|
701
|
+
.getByRole('button', { name: `Select ${name}`, exact: true })
|
|
702
|
+
.or(this.page.locator(`[data-test="item-${name}"]`).first().getByText(name))
|
|
703
|
+
.first()
|
|
704
|
+
.click({ timeout: 90000 });
|
|
705
|
+
}
|
|
706
|
+
async clickUserTask(id) {
|
|
707
|
+
const priorityUserTask = this.page.locator(`[data-element-id="${id}"]`);
|
|
708
|
+
await priorityUserTask.click({ timeout: 60000 });
|
|
709
|
+
}
|
|
710
|
+
async clickAppendEndEventButton(parentElement) {
|
|
711
|
+
try {
|
|
712
|
+
await this.appendEndEventButton.click({ timeout: 120000 });
|
|
713
|
+
}
|
|
714
|
+
catch (error) {
|
|
715
|
+
await this.page.reload();
|
|
716
|
+
await (0, sleep_1.sleep)(10000);
|
|
717
|
+
if (parentElement == undefined) {
|
|
718
|
+
await this.clickSecondPlacedElement();
|
|
719
|
+
}
|
|
720
|
+
else if (parentElement == 'parallelGateway') {
|
|
721
|
+
await this.clickSecondPlacedGateway();
|
|
722
|
+
}
|
|
723
|
+
await this.clickAppendElementButton();
|
|
724
|
+
await this.appendEndEventButton.click({ timeout: 120000 });
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
async fillPriorityInput(priority) {
|
|
728
|
+
await this.priorityInput.fill(priority, { timeout: 60000 });
|
|
729
|
+
await (0, test_1.expect)(this.page
|
|
730
|
+
.getByText('Must be an expression, or an integer between 0 and 100')
|
|
731
|
+
.first()).not.toBeVisible({ timeout: 30000 });
|
|
732
|
+
await this.page.waitForTimeout(1000);
|
|
733
|
+
}
|
|
734
|
+
async clickPriorityInput() {
|
|
735
|
+
// The properties panel remembers which groups are open, so from the second
|
|
736
|
+
// user task onwards Assignment is already expanded. The previous check used
|
|
737
|
+
// an invalid descendant selector ('...-group-header empty open') that always
|
|
738
|
+
// counted 0, so every call clicked the group again — collapsing it or landing
|
|
739
|
+
// on an arbitrary entry. Detect the header's real 'open' class instead and
|
|
740
|
+
// toggle via the header rather than the whole group box.
|
|
741
|
+
const assignmentHeader = this.assignmentSection.locator('.bio-properties-panel-group-header');
|
|
742
|
+
const isExpanded = (await this.assignmentSection
|
|
743
|
+
.locator('.bio-properties-panel-group-header.open')
|
|
744
|
+
.count()) > 0;
|
|
745
|
+
if (!isExpanded) {
|
|
746
|
+
await assignmentHeader.click({ timeout: 30000 });
|
|
747
|
+
}
|
|
748
|
+
await this.priorityInput.click({ timeout: 30000 });
|
|
749
|
+
}
|
|
750
|
+
async setPriority(taskName, priority, numberOfTasks) {
|
|
751
|
+
for (let i = 1; i <= numberOfTasks; i++) {
|
|
752
|
+
const userTaskId = taskName + i;
|
|
753
|
+
const priorityUserTask = this.page.locator(`[data-element-id="${userTaskId}"]`);
|
|
754
|
+
await priorityUserTask.click({ timeout: 60000 });
|
|
755
|
+
await this.clickPriorityInput();
|
|
756
|
+
await this.fillPriorityInput(priority.toString());
|
|
757
|
+
await this.clickCanvas();
|
|
758
|
+
priority += 25;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
async clickCloseButton() {
|
|
762
|
+
await this.closeButton.click({ timeout: 60000 });
|
|
763
|
+
}
|
|
764
|
+
async clickAdditionalActionsButton() {
|
|
765
|
+
await (0, test_1.expect)(this.additionalActionsButton).toBeVisible({ timeout: 20000 });
|
|
766
|
+
await this.additionalActionsButton.click({ timeout: 60000 });
|
|
767
|
+
}
|
|
768
|
+
async clickDeployMenuItem() {
|
|
769
|
+
await (0, test_1.expect)(this.deployMenuItem).toBeVisible({ timeout: 20000 });
|
|
770
|
+
await this.deployMenuItem.click({ timeout: 60000 });
|
|
771
|
+
}
|
|
772
|
+
async deployDiagram(clusterName) {
|
|
773
|
+
await this.processApplicationPage.ensureStageCluster(clusterName);
|
|
774
|
+
await this.clickDeployButtonWithRetry();
|
|
775
|
+
await (0, test_1.expect)(this.deployDiagramDialog).toBeVisible({
|
|
776
|
+
timeout: 30000,
|
|
777
|
+
});
|
|
778
|
+
await this.selectCluster(clusterName);
|
|
779
|
+
await this.clickDeploySubButtonWithRetry(clusterName);
|
|
780
|
+
await (0, test_1.expect)(this.viewProcessLink).toBeVisible({ timeout: 30000 });
|
|
781
|
+
await (0, test_1.expect)(this.viewProcessLink).toBeHidden({ timeout: 30000 });
|
|
782
|
+
}
|
|
783
|
+
// For a user whose org role lacks instance/workflow create permissions,
|
|
784
|
+
// Hub's checkIfAllowedToRun is false: the split button's primary action
|
|
785
|
+
// becomes "Deploy" and "Deploy & run" moves into its menu, disabled
|
|
786
|
+
// (camunda-hub BPMNDeployAndRunButtonsDs.tsx).
|
|
787
|
+
async assertDeployAndRunNotPermitted() {
|
|
788
|
+
await (0, test_1.expect)(this.deployRunActions.getByRole('button', { name: 'Deploy', exact: true })).toBeVisible({ timeout: 60000 });
|
|
789
|
+
await (0, test_1.expect)(this.deployAndRunMainButton).toHaveCount(0);
|
|
790
|
+
await this.deployRunActions
|
|
791
|
+
.getByRole('button', { name: 'Additional actions' })
|
|
792
|
+
.click({ timeout: 30000 });
|
|
793
|
+
await (0, test_1.expect)(this.deployAndRunMenuItem).toBeVisible({ timeout: 30000 });
|
|
794
|
+
await (0, test_1.expect)(this.deployAndRunMenuItem).toBeDisabled();
|
|
795
|
+
await this.page.keyboard.press('Escape');
|
|
796
|
+
}
|
|
797
|
+
async clickStartInstanceMainButton() {
|
|
798
|
+
await this.deployAndRunMainButton.click({ timeout: 30000 });
|
|
799
|
+
}
|
|
800
|
+
async clickStartInstanceSubButton() {
|
|
801
|
+
await this.deployAndRunSubButton.click({ timeout: 30000 });
|
|
802
|
+
}
|
|
803
|
+
async runProcessInstance(clusterName, variables = '', formVariables = {}, textToVisible = '', hasDeploymentPermission = true, businessId = '') {
|
|
804
|
+
const maxRetries = 10;
|
|
805
|
+
const retryDelayMs = 20000;
|
|
806
|
+
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
807
|
+
try {
|
|
808
|
+
// Inside the loop, not before it: a no-op once bound, but selectCluster
|
|
809
|
+
// clears the binding when the dialog does not offer the cluster, so the
|
|
810
|
+
// next attempt rebinds rather than reopening an unchanged dialog.
|
|
811
|
+
await this.processApplicationPage.ensureStageCluster(clusterName);
|
|
812
|
+
await this.clickStartInstanceMainButton();
|
|
813
|
+
await this.selectCluster(clusterName);
|
|
814
|
+
if (variables.length > 0) {
|
|
815
|
+
await (0, test_1.expect)(this.variableInput).toBeVisible({ timeout: 60000 });
|
|
816
|
+
await this.clickVariableInput();
|
|
817
|
+
await this.fillVariableInput(variables);
|
|
818
|
+
}
|
|
819
|
+
if (Object.keys(formVariables).length > 0) {
|
|
820
|
+
if (formVariables.formName) {
|
|
821
|
+
await this.fillStartFormName(formVariables.formName);
|
|
822
|
+
}
|
|
823
|
+
if (formVariables.checkbox === 'true') {
|
|
824
|
+
await this.checkStartFormCheckbox();
|
|
825
|
+
}
|
|
826
|
+
if (formVariables.startDate) {
|
|
827
|
+
await this.fillStartFormDate(formVariables.startDate);
|
|
828
|
+
}
|
|
829
|
+
if (formVariables.startNumber) {
|
|
830
|
+
await this.fillStartFormNumber(formVariables.startNumber);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
if (businessId.length > 0) {
|
|
834
|
+
await (0, test_1.expect)(this.businessIdInput).toBeVisible({ timeout: 60000 });
|
|
835
|
+
await this.businessIdInput.fill(businessId);
|
|
836
|
+
}
|
|
837
|
+
if (textToVisible.length > 0) {
|
|
838
|
+
await (0, test_1.expect)(this.dialog.getByText(textToVisible)).toBeVisible({
|
|
839
|
+
timeout: 30000,
|
|
840
|
+
});
|
|
841
|
+
}
|
|
842
|
+
await this.clickStartInstanceSubButton();
|
|
843
|
+
if (hasDeploymentPermission) {
|
|
844
|
+
try {
|
|
845
|
+
await (0, test_1.expect)(this.viewProcessInstanceLink).toBeVisible({
|
|
846
|
+
timeout: 30000,
|
|
847
|
+
});
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
catch (error) {
|
|
851
|
+
throw new Error('Process instance link not visible after starting process');
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
else {
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
catch (error) {
|
|
859
|
+
console.warn(`Attempt ${attempt} failed: ${error instanceof Error ? error.message : error}`);
|
|
860
|
+
if (attempt === maxRetries) {
|
|
861
|
+
throw new Error(`runProcessInstance failed after ${maxRetries} attempts. Last error: ${error instanceof Error ? error.message : error}`);
|
|
862
|
+
}
|
|
863
|
+
await this.page.reload();
|
|
864
|
+
// A Hub backend failure (5xx on /api/internal/login) makes the SPA call
|
|
865
|
+
// Auth0 logout, so the reload lands on the login form and every
|
|
866
|
+
// remaining attempt would reload that form until the loop is spent.
|
|
867
|
+
// Sign back in as the same user; Auth0 returns to the diagram.
|
|
868
|
+
await (0, sessionRecovery_1.restoreSessionIfLoggedOut)(this.page);
|
|
869
|
+
await this.page.waitForTimeout(retryDelayMs);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
async selectCluster(clusterName) {
|
|
874
|
+
await (0, test_1.expect)(this.dialog).toBeVisible({ timeout: 30000 });
|
|
875
|
+
const healthCheckTimeout = 30000;
|
|
876
|
+
// Inside a process application the deploy dialog renders
|
|
877
|
+
// ProcessAppClusterSelection, not the per-deploy ClusterSelection toggle
|
|
878
|
+
// list: it shows only clusters assigned to one of the application's stages
|
|
879
|
+
// and auto-selects the first, so there is no label to click. Confirm the
|
|
880
|
+
// intended cluster is the one on offer instead.
|
|
881
|
+
//
|
|
882
|
+
// The unconfigured case is called out explicitly: without this the symptom
|
|
883
|
+
// is the cluster toggle never appearing, retried until the test times out,
|
|
884
|
+
// which says nothing about the actual cause.
|
|
885
|
+
const notConfigured = this.dialog.getByText('Clusters not configured for stages');
|
|
886
|
+
if (await notConfigured.isVisible().catch(() => false)) {
|
|
887
|
+
throw new Error(`Process application has no cluster assigned to any stage, so "${clusterName}" cannot be deployed to. ` +
|
|
888
|
+
'ProcessApplicationPage.ensureStageCluster() should have bound it before the deploy dialog was opened.');
|
|
889
|
+
}
|
|
890
|
+
// Hub's environment-based dialog (camunda-hub#29210) lists every
|
|
891
|
+
// Environment assigned to the workspace, preselects the first -- which
|
|
892
|
+
// need not be this one -- and renders a <label> per row that the legacy
|
|
893
|
+
// toggle detection below would mistake for its own. The dialog is visible
|
|
894
|
+
// a beat before its rows, so wait briefly rather than sampling once.
|
|
895
|
+
const hasEnvironmentRow = await this.dialog
|
|
896
|
+
.locator('[data-test^="environment-row-"]')
|
|
897
|
+
.first()
|
|
898
|
+
.waitFor({ state: 'visible', timeout: 10000 })
|
|
899
|
+
.then(() => true)
|
|
900
|
+
.catch(() => false);
|
|
901
|
+
if (hasEnvironmentRow) {
|
|
902
|
+
try {
|
|
903
|
+
await (0, modelerCluster_1.selectDeployEnvironment)(this.dialog, clusterName);
|
|
904
|
+
}
|
|
905
|
+
catch (error) {
|
|
906
|
+
this.processApplicationPage.forgetStageCluster();
|
|
907
|
+
throw error;
|
|
908
|
+
}
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
const legacyClusterToggle = this.dialog.locator('label').filter({
|
|
912
|
+
hasText: new RegExp(`^${clusterName}`),
|
|
913
|
+
});
|
|
914
|
+
const isLegacyDialog = await legacyClusterToggle
|
|
915
|
+
.first()
|
|
916
|
+
.isVisible()
|
|
917
|
+
.catch(() => false);
|
|
918
|
+
if (!isLegacyDialog) {
|
|
919
|
+
const offered = await this.dialog
|
|
920
|
+
.getByText(clusterName, { exact: false })
|
|
921
|
+
.first()
|
|
922
|
+
.waitFor({ state: 'visible', timeout: 30000 })
|
|
923
|
+
.then(() => true)
|
|
924
|
+
.catch(() => false);
|
|
925
|
+
if (!offered) {
|
|
926
|
+
// Forget the binding before failing. The dialog lists exactly the
|
|
927
|
+
// clusters this application's stages point at, so a missing cluster
|
|
928
|
+
// means the binding did not take -- and no amount of reopening the
|
|
929
|
+
// dialog will make it appear. Clearing the record lets the caller's
|
|
930
|
+
// next attempt rebind instead of re-checking an unchanged dialog.
|
|
931
|
+
this.processApplicationPage.forgetStageCluster();
|
|
932
|
+
throw new Error(`The deploy dialog does not offer "${clusterName}": its stage ` +
|
|
933
|
+
'binding did not take. It will be rebound on the next attempt.');
|
|
934
|
+
}
|
|
935
|
+
return;
|
|
936
|
+
}
|
|
937
|
+
const healthyRegex = new RegExp(`${clusterName}.*?HealthydevManage`);
|
|
938
|
+
const clusterLabel = this.dialog
|
|
939
|
+
.locator('label')
|
|
940
|
+
.filter({ hasText: new RegExp(`^${clusterName}`) });
|
|
941
|
+
await (0, test_1.expect)(clusterLabel).toBeVisible({ timeout: 30000 });
|
|
942
|
+
await clusterLabel.click();
|
|
943
|
+
await (0, test_1.expect)(clusterLabel.getByRole('switch')).toBeChecked({
|
|
944
|
+
timeout: 30000,
|
|
945
|
+
});
|
|
946
|
+
await (0, test_1.expect)(this.dialog).toHaveText(healthyRegex, {
|
|
947
|
+
timeout: healthCheckTimeout,
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
async clickViewProcessInstanceLink() {
|
|
951
|
+
await this.viewProcessInstanceLink.click({ timeout: 180000 });
|
|
952
|
+
}
|
|
953
|
+
async clickNameInput() {
|
|
954
|
+
await this.nameInput.click({ timeout: 60000 });
|
|
955
|
+
}
|
|
956
|
+
async fillNamedInput(name) {
|
|
957
|
+
await this.nameInput.fill(name, { timeout: 60000 });
|
|
958
|
+
}
|
|
959
|
+
// Opens the current diagram's crumb menu: the legacy breadcrumb dropdown, or
|
|
960
|
+
// the nav-v2 "<name> actions" kebab. Waits for the properties panel first:
|
|
961
|
+
// until the diagram has loaded, nav-v2 keeps showing the previous page's
|
|
962
|
+
// crumbs (camunda-hub NavProvider), so the last kebab would belong to the
|
|
963
|
+
// parent container and Rename would rename that instead.
|
|
964
|
+
async clickDiagramBreadcrumb() {
|
|
965
|
+
await (0, test_1.expect)(this.generalPanel).toBeVisible({ timeout: 120000 });
|
|
966
|
+
await this.clickDiagramMenuTrigger(60000);
|
|
967
|
+
}
|
|
968
|
+
// 10s was too tight for the first click after the editor opens: the trigger
|
|
969
|
+
// is already resolved, visible and stable, and the click then waits out its
|
|
970
|
+
// whole budget on the actionability check while the bpmn-js canvas is still
|
|
971
|
+
// settling ("done scrolling" is the last line before the timeout).
|
|
972
|
+
async clickDiagramMenuTrigger(timeout) {
|
|
973
|
+
await (0, test_1.expect)(this.diagramBreadcrumb.or(this.diagramActionsButton).first()).toBeVisible({ timeout });
|
|
974
|
+
if (await this.diagramActionsButton.isVisible().catch(() => false)) {
|
|
975
|
+
await this.diagramActionsButton.click({ timeout });
|
|
976
|
+
}
|
|
977
|
+
else {
|
|
978
|
+
await this.diagramBreadcrumb.click({ timeout });
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
// Opening the breadcrumb menu leaves the pointer on the breadcrumb button,
|
|
982
|
+
// and hub renders that button's truncated-name tooltip on top of the menu,
|
|
983
|
+
// where it swallows the click on "Rename" -- playwright reports
|
|
984
|
+
// `<div role="tooltip">…</div> intercepts pointer events`. Since
|
|
985
|
+
// camunda/camunda-hub#25831 the breadcrumb carries an extra
|
|
986
|
+
// process-application crumb, so the name truncates, and the tooltip renders,
|
|
987
|
+
// as the rule rather than the exception. Park the pointer away from the
|
|
988
|
+
// breadcrumb and let the tooltip unmount before clicking; reopen the menu if
|
|
989
|
+
// a previous attempt closed it.
|
|
990
|
+
async clickEditDiagramNameButton() {
|
|
991
|
+
const openTooltip = this.page.locator('[role="tooltip"][aria-hidden="false"]');
|
|
992
|
+
await (0, test_1.expect)(async () => {
|
|
993
|
+
const menuOpen = await this.renameDiagramNameButton
|
|
994
|
+
.isVisible()
|
|
995
|
+
.catch(() => false);
|
|
996
|
+
if (!menuOpen) {
|
|
997
|
+
// Bounded well below the loop budget rather than reusing
|
|
998
|
+
// `clickDiagramBreadcrumb`'s 60s: at 60s a single reopen is the whole
|
|
999
|
+
// retry window, so the attempt that would have recovered never got to
|
|
1000
|
+
// run and toPass reported the previous attempt's error instead. Gated
|
|
1001
|
+
// on the properties panel for the same reason as there.
|
|
1002
|
+
await (0, test_1.expect)(this.generalPanel).toBeVisible({ timeout: 20000 });
|
|
1003
|
+
await this.clickDiagramMenuTrigger(20000);
|
|
1004
|
+
}
|
|
1005
|
+
// Park the pointer so the breadcrumb's own tooltip gets a chance to
|
|
1006
|
+
// unmount -- best effort, because it is not reliably hover-driven, and
|
|
1007
|
+
// requiring it to go turned an interceptable click into a hard failure.
|
|
1008
|
+
await this.page.mouse.move(0, 0);
|
|
1009
|
+
await openTooltip
|
|
1010
|
+
.first()
|
|
1011
|
+
.waitFor({ state: 'hidden', timeout: 2000 })
|
|
1012
|
+
.catch(() => false);
|
|
1013
|
+
try {
|
|
1014
|
+
await this.renameDiagramNameButton.click({ timeout: 10000 });
|
|
1015
|
+
}
|
|
1016
|
+
catch {
|
|
1017
|
+
// The tooltip renders over the menu and swallows the click (playwright
|
|
1018
|
+
// reports `<div role="tooltip">…</div> intercepts pointer events`).
|
|
1019
|
+
// Dispatching on the element bypasses hit-testing, which no amount of
|
|
1020
|
+
// waiting achieves when the tooltip never unmounts. Not a swallowed
|
|
1021
|
+
// failure: the assertion below is what decides whether this worked.
|
|
1022
|
+
await this.renameDiagramNameButton.dispatchEvent('click');
|
|
1023
|
+
}
|
|
1024
|
+
await (0, test_1.expect)(this.diagramNameInput.or(this.renameInput).first()).toBeVisible({ timeout: 10000 });
|
|
1025
|
+
// The menu also closes on its own: `modelDiagramFromFile` opens it right
|
|
1026
|
+
// after the diagram is picked, and when bpmn-js finishes importing it
|
|
1027
|
+
// takes focus, which dismisses the menu that `isVisible` had just seen.
|
|
1028
|
+
// The click then fails with "Rename" gone from the DOM rather than
|
|
1029
|
+
// intercepted. Reopening is what recovers, so the budget has to fit
|
|
1030
|
+
// several whole attempts, not one.
|
|
1031
|
+
}).toPass({ timeout: 180000, intervals: [1000, 2000, 5000] });
|
|
1032
|
+
}
|
|
1033
|
+
// The rename can silently no-op: camunda-hub's breadcrumb name editor
|
|
1034
|
+
// (InlineEditable) resets its input back to the stored diagram name whenever
|
|
1035
|
+
// the diagram store pushes a new value, and `renameDiagram` returns early when
|
|
1036
|
+
// the submitted name equals the stored one — so an Enter that races the
|
|
1037
|
+
// editor's initial autosave commits nothing. The diagram then keeps its
|
|
1038
|
+
// "New BPMN diagram" default name, and every later lookup by process name
|
|
1039
|
+
// (Operate's instance list, Tasklist, Play) can never match, which is what the
|
|
1040
|
+
// nightly showed: three instances deployed as "New BPMN diagram". Confirm the
|
|
1041
|
+
// name landed in the breadcrumb and re-open the editor to retry if it didn't.
|
|
1042
|
+
// Nav-v2 has no inline editor: Rename opens a dialog, and a fresh diagram
|
|
1043
|
+
// does not open with its name in edit mode, so fill whichever editor shows.
|
|
1044
|
+
async enterDiagramName(name) {
|
|
1045
|
+
const maxAttempts = 3;
|
|
1046
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
1047
|
+
try {
|
|
1048
|
+
// The dialog's submit stays disabled while the input equals the stored
|
|
1049
|
+
// name, so a retry after a rename that committed late cannot resubmit.
|
|
1050
|
+
if (attempt > 0 &&
|
|
1051
|
+
(await this.diagramNameBreadcrumb(name)
|
|
1052
|
+
.isVisible()
|
|
1053
|
+
.catch(() => false))) {
|
|
1054
|
+
return;
|
|
1055
|
+
}
|
|
1056
|
+
// Creating the diagram does not reliably leave the name editor open --
|
|
1057
|
+
// hub opens the editor on the breadcrumb, and a slow canvas render
|
|
1058
|
+
// lands on a closed one. The input therefore has to be opened on the
|
|
1059
|
+
// FIRST attempt too, not only on a retry: reaching for it blind burnt
|
|
1060
|
+
// the whole 90s fill timeout and threw straight out of this loop, so
|
|
1061
|
+
// the reopen below (which exists for exactly this) never ran.
|
|
1062
|
+
// clickEditDiagramNameButton() reopens the breadcrumb menu itself when
|
|
1063
|
+
// it is closed, so it covers both the first attempt and a retry.
|
|
1064
|
+
if (!(await this.diagramNameEditorOpen())) {
|
|
1065
|
+
await this.clickEditDiagramNameButton();
|
|
1066
|
+
}
|
|
1067
|
+
// 20s rather than 90s: the editor is proven open at this point, so the
|
|
1068
|
+
// long budget only delayed the retry that actually recovers -- and at
|
|
1069
|
+
// 90s x 2 x 3 attempts this loop could outlive the 12min test timeout,
|
|
1070
|
+
// losing the artifacts that explain the failure.
|
|
1071
|
+
if (await this.renameInput.isVisible().catch(() => false)) {
|
|
1072
|
+
await this.renameInput.fill(name, { timeout: 20000 });
|
|
1073
|
+
await (0, test_1.expect)(this.renameInput).toHaveValue(name, { timeout: 5000 });
|
|
1074
|
+
await this.renameSubmitButton.click({ timeout: 10000 });
|
|
1075
|
+
await (0, test_1.expect)(this.renameInput).toBeHidden({ timeout: 30000 });
|
|
1076
|
+
}
|
|
1077
|
+
else {
|
|
1078
|
+
await this.diagramNameInput.fill(name, { timeout: 20000 });
|
|
1079
|
+
await this.diagramNameInput.press('Enter', { timeout: 20000 });
|
|
1080
|
+
}
|
|
1081
|
+
await this.diagramNameBreadcrumb(name).waitFor({
|
|
1082
|
+
state: 'visible',
|
|
1083
|
+
timeout: 30000,
|
|
1084
|
+
});
|
|
1085
|
+
return;
|
|
1086
|
+
}
|
|
1087
|
+
catch (error) {
|
|
1088
|
+
console.warn(`Diagram rename to "${name}" did not commit on attempt ${attempt + 1}: ${error instanceof Error ? error.message : error}`);
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
throw new Error(`Diagram name was not set to "${name}".`);
|
|
1092
|
+
}
|
|
1093
|
+
async diagramNameEditorOpen() {
|
|
1094
|
+
return this.diagramNameInput
|
|
1095
|
+
.or(this.renameInput)
|
|
1096
|
+
.first()
|
|
1097
|
+
.waitFor({ state: 'visible', timeout: 5000 })
|
|
1098
|
+
.then(() => true)
|
|
1099
|
+
.catch(() => false);
|
|
1100
|
+
}
|
|
1101
|
+
async clickVariableInput() {
|
|
1102
|
+
await this.variableInput.click({ timeout: 60000 });
|
|
1103
|
+
}
|
|
1104
|
+
async fillVariableInput(variable) {
|
|
1105
|
+
await this.variableInput.fill(variable);
|
|
1106
|
+
}
|
|
1107
|
+
async clickEmbedFormButton() {
|
|
1108
|
+
await this.embedFormButton.click({ timeout: 60000 });
|
|
1109
|
+
}
|
|
1110
|
+
async clickEmbedButton() {
|
|
1111
|
+
await this.embedButton.click({ timeout: 60000 });
|
|
1112
|
+
}
|
|
1113
|
+
async clickNewForm() {
|
|
1114
|
+
await this.newForm.click({ timeout: 120000 });
|
|
1115
|
+
}
|
|
1116
|
+
async clickDeploySubButton() {
|
|
1117
|
+
await this.deploySubButton.click({ timeout: 120000, force: true });
|
|
1118
|
+
}
|
|
1119
|
+
async clickCancelButton() {
|
|
1120
|
+
await this.cancelButton.click({ timeout: 60000 });
|
|
1121
|
+
}
|
|
1122
|
+
// `waitFor` actually blocks up to the timeout; `isVisible()` would return
|
|
1123
|
+
// immediately and report false while the popup is still rendering.
|
|
1124
|
+
async waitForVisible(locator, timeout) {
|
|
1125
|
+
return locator
|
|
1126
|
+
.first()
|
|
1127
|
+
.waitFor({ state: 'visible', timeout })
|
|
1128
|
+
.then(() => true)
|
|
1129
|
+
.catch(() => false);
|
|
1130
|
+
}
|
|
1131
|
+
// The change-element popup is now tabbed: every `replace.template-*` entry
|
|
1132
|
+
// is assigned to the "Reusable Assets" tab, so connector templates are not
|
|
1133
|
+
// in the DOM at all while the default "BPMN" tab is selected - which is why
|
|
1134
|
+
// the template locators time out with `<element(s) not found>`.
|
|
1135
|
+
// Opening that tab is version-tolerant: on an untabbed popup the strip is
|
|
1136
|
+
// absent and this is a no-op.
|
|
1137
|
+
// Search is the fallback, because it spans the full entry set across every
|
|
1138
|
+
// tab. It must be typed with `pressSequentially`: the popup's search input
|
|
1139
|
+
// is uncontrolled and its state is written by a `keyup` handler only, so
|
|
1140
|
+
// `fill()` (which dispatches `input` alone) never applies the filter.
|
|
1141
|
+
async revealChangeElementTemplate(option, searchTerm) {
|
|
1142
|
+
if (await this.waitForVisible(option, 5000)) {
|
|
1143
|
+
return;
|
|
1144
|
+
}
|
|
1145
|
+
if (await this.waitForVisible(this.changeElementTabStrip, 5000)) {
|
|
1146
|
+
// Do not throw: a failed tab click leaves the search fallback below
|
|
1147
|
+
// intact, and search alone is enough on an untabbed popup.
|
|
1148
|
+
await this.reusableAssetsTab.click({ timeout: 30000 }).catch(() => { });
|
|
1149
|
+
if (await this.waitForVisible(option, 15000)) {
|
|
1150
|
+
return;
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
if (!(await this.waitForVisible(this.changeElementSearchInput, 5000))) {
|
|
1154
|
+
return;
|
|
1155
|
+
}
|
|
1156
|
+
await this.changeElementSearchInput.click();
|
|
1157
|
+
await this.changeElementSearchInput.fill('');
|
|
1158
|
+
await this.changeElementSearchInput.pressSequentially(searchTerm, {
|
|
1159
|
+
delay: 50,
|
|
1160
|
+
});
|
|
1161
|
+
}
|
|
1162
|
+
async clickRestConnectorOption() {
|
|
1163
|
+
await this.revealChangeElementTemplate(this.restConnectorOption, 'REST');
|
|
1164
|
+
await (0, test_1.expect)(this.restConnectorOption).toBeVisible({ timeout: 90000 });
|
|
1165
|
+
await this.restConnectorOption.click();
|
|
1166
|
+
}
|
|
1167
|
+
async clickWebhookStartEventConnectorOption() {
|
|
1168
|
+
await this.revealChangeElementTemplate(this.webhookMessageStartEventConnectorOption, 'Webhook');
|
|
1169
|
+
await this.webhookMessageStartEventConnectorOption.click({ timeout: 60000 });
|
|
1170
|
+
}
|
|
1171
|
+
async clickWebhookTab() {
|
|
1172
|
+
await this.webhookTab.click({ timeout: 60000 });
|
|
1173
|
+
}
|
|
1174
|
+
async clickWebhookIsActiveButton() {
|
|
1175
|
+
await this.webhookIsActiveButton.click({ timeout: 60000 });
|
|
1176
|
+
}
|
|
1177
|
+
async assertThreeElementsVisible() {
|
|
1178
|
+
await (0, test_1.expect)(this.firstElement).toBeVisible({ timeout: 30000 });
|
|
1179
|
+
await (0, test_1.expect)(this.secondElement).toBeVisible({ timeout: 30000 });
|
|
1180
|
+
await (0, test_1.expect)(this.thirdElement).toBeVisible({ timeout: 30000 });
|
|
1181
|
+
}
|
|
1182
|
+
async clickDeployButtonWithRetry(retries = 3) {
|
|
1183
|
+
for (let i = 0; i < retries; i++) {
|
|
1184
|
+
try {
|
|
1185
|
+
await this.clickAdditionalActionsButton();
|
|
1186
|
+
await this.clickDeployMenuItem();
|
|
1187
|
+
return;
|
|
1188
|
+
}
|
|
1189
|
+
catch (error) {
|
|
1190
|
+
console.error(`Attempt ${i + 1} to click deploy button failed: ${error}`);
|
|
1191
|
+
await this.page.reload();
|
|
1192
|
+
await (0, sleep_1.sleep)(10000);
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
throw new Error(`Failed to click deploy button after ${retries} retries`);
|
|
1196
|
+
}
|
|
1197
|
+
async clickDeploySubButtonWithRetry(clusterName) {
|
|
1198
|
+
const retries = 3;
|
|
1199
|
+
for (let i = 0; i < retries; i++) {
|
|
1200
|
+
try {
|
|
1201
|
+
await (0, test_1.expect)(this.deploySubButton).toBeVisible({ timeout: 20000 });
|
|
1202
|
+
await (0, test_1.expect)(this.deploySubButton).toBeEnabled();
|
|
1203
|
+
await this.deploySubButton.click({ force: true });
|
|
1204
|
+
await (0, test_1.expect)(this.dialog).not.toBeVisible();
|
|
1205
|
+
return;
|
|
1206
|
+
}
|
|
1207
|
+
catch (error) {
|
|
1208
|
+
console.error(`Attempt ${i + 1} to click deploy button failed: ${error}`);
|
|
1209
|
+
await this.page.reload();
|
|
1210
|
+
await (0, sleep_1.sleep)(10000);
|
|
1211
|
+
await this.clickDeployButtonWithRetry();
|
|
1212
|
+
await this.selectCluster(clusterName);
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
throw new Error(`Failed to click deploy button after ${retries} retries`);
|
|
1216
|
+
}
|
|
1217
|
+
async clickCreateTask() {
|
|
1218
|
+
await this.createTask.click({ timeout: 60000 });
|
|
1219
|
+
}
|
|
1220
|
+
async clickCreateEndEvent() {
|
|
1221
|
+
await this.createEndEvent.click({ timeout: 60000 });
|
|
1222
|
+
}
|
|
1223
|
+
// The canvas does not scroll with the DOM, so an element the diagram has
|
|
1224
|
+
// pushed past the canvas edge cannot be clicked at all — the hit test returns
|
|
1225
|
+
// the canvas container (or the panel toggle bar beside it). Zoom out until
|
|
1226
|
+
// the element and one element-width of margin fit inside the canvas.
|
|
1227
|
+
async fitElementIntoCanvas(element, margin = 120, maxZoomOutSteps = 3) {
|
|
1228
|
+
for (let step = 0; step < maxZoomOutSteps; step++) {
|
|
1229
|
+
const canvasBox = await this.canvas.boundingBox();
|
|
1230
|
+
const elementBox = await element.boundingBox();
|
|
1231
|
+
if (canvasBox === null || elementBox === null) {
|
|
1232
|
+
return;
|
|
1233
|
+
}
|
|
1234
|
+
const elementRightEdge = elementBox.x + elementBox.width + margin;
|
|
1235
|
+
if (elementRightEdge <= canvasBox.x + canvasBox.width) {
|
|
1236
|
+
return;
|
|
1237
|
+
}
|
|
1238
|
+
await this.zoomOutButton.click({ timeout: 30000 });
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
// A context pad is a fixed-size strip anchored to the top-right of its
|
|
1242
|
+
// element, so once the diagram is zoomed out it can reach across the gap and
|
|
1243
|
+
// cover the top of the next shape. Click the bottom edge of the target, below
|
|
1244
|
+
// the strip, so a neighbour's open pad cannot swallow the click.
|
|
1245
|
+
async clickShapeBelowContextPad(element) {
|
|
1246
|
+
const box = await element.boundingBox();
|
|
1247
|
+
if (box === null) {
|
|
1248
|
+
await element.click({ timeout: 60000 });
|
|
1249
|
+
return;
|
|
1250
|
+
}
|
|
1251
|
+
await element.click({
|
|
1252
|
+
timeout: 60000,
|
|
1253
|
+
position: { x: box.width / 2, y: box.height - 2 },
|
|
1254
|
+
});
|
|
1255
|
+
}
|
|
1256
|
+
async clickCanvas() {
|
|
1257
|
+
// Clicking the canvas centre lands on a shape (or an open create pad) as
|
|
1258
|
+
// soon as the diagram has more than a couple of elements, and the click is
|
|
1259
|
+
// then intercepted instead of clearing the selection. Click the empty
|
|
1260
|
+
// gutter above the diagram and right of the palette instead.
|
|
1261
|
+
await this.canvas.click({ timeout: 60000, position: { x: 150, y: 25 } });
|
|
1262
|
+
}
|
|
1263
|
+
async clickEndEventCanvas() {
|
|
1264
|
+
await this.endEventCanvas.click({ timeout: 60000 });
|
|
1265
|
+
}
|
|
1266
|
+
async clickConnectToOtherElementButton() {
|
|
1267
|
+
// 'Connect to other element' is a create-pad entry
|
|
1268
|
+
// (`data-entry-id="connect"`), so the pad has to be open and hovered before
|
|
1269
|
+
// the entry exists at all. The user task this is called on already has an
|
|
1270
|
+
// outgoing sequence flow, so the pad no longer auto-opens — go through the
|
|
1271
|
+
// append indicator first, which is exactly what clickAppendElementButton
|
|
1272
|
+
// does (with its own retries).
|
|
1273
|
+
await this.clickAppendElementButton();
|
|
1274
|
+
await (0, test_1.expect)(this.connectToOtherElementButton).toBeVisible({
|
|
1275
|
+
timeout: 60000,
|
|
1276
|
+
});
|
|
1277
|
+
await this.connectToOtherElementButton.click({ timeout: 60000 });
|
|
1278
|
+
}
|
|
1279
|
+
async clickFirstPlacedElement() {
|
|
1280
|
+
await (0, test_1.expect)(this.firstPlacedElement).toBeVisible({ timeout: 60000 });
|
|
1281
|
+
await this.firstPlacedElement.click({ timeout: 60000 });
|
|
1282
|
+
}
|
|
1283
|
+
async clickSecondPlacedElement() {
|
|
1284
|
+
await this.secondPlacedElement.click({ timeout: 60000 });
|
|
1285
|
+
}
|
|
1286
|
+
async clickSecondElement() {
|
|
1287
|
+
await (0, test_1.expect)(this.secondElement).toBeVisible({ timeout: 60000 });
|
|
1288
|
+
await this.secondElement.click({ timeout: 60000 });
|
|
1289
|
+
}
|
|
1290
|
+
// The append create pad only auto-opens for an element with no outgoing
|
|
1291
|
+
// sequence flow. Every other selected element gets the "+" append indicator
|
|
1292
|
+
// overlay instead, and the pad is rendered only once the pointer hovers it —
|
|
1293
|
+
// which is exactly what appending a second parallel branch off an
|
|
1294
|
+
// already-connected gateway needs.
|
|
1295
|
+
async openAppendCreatePad() {
|
|
1296
|
+
const padOpen = await this.appendElementButton
|
|
1297
|
+
.isVisible()
|
|
1298
|
+
.catch(() => false);
|
|
1299
|
+
if (padOpen)
|
|
1300
|
+
return;
|
|
1301
|
+
// Force past the actionability check on both hops: the indicator is
|
|
1302
|
+
// replaced by the create pad the moment the pointer reaches it, so an
|
|
1303
|
+
// unforced click/hover is reported as "intercepted by the create pad" and
|
|
1304
|
+
// then as "element is not visible" once the swap has happened.
|
|
1305
|
+
await this.appendElementIndicator.hover({ force: true, timeout: 10000 });
|
|
1306
|
+
await this.appendCreatePad.hover({ force: true, timeout: 10000 });
|
|
1307
|
+
}
|
|
1308
|
+
async clickAppendElementButton() {
|
|
1309
|
+
const maxRetries = 3;
|
|
1310
|
+
for (let retries = 0; retries < maxRetries; retries++) {
|
|
1311
|
+
try {
|
|
1312
|
+
await this.page.waitForTimeout(1000);
|
|
1313
|
+
await this.openAppendCreatePad();
|
|
1314
|
+
await (0, test_1.expect)(this.appendElementButton).toBeVisible({ timeout: 10000 });
|
|
1315
|
+
await this.appendElementButton.hover({ force: true });
|
|
1316
|
+
return;
|
|
1317
|
+
}
|
|
1318
|
+
catch (error) {
|
|
1319
|
+
console.error(`Click attempt to append element ${retries + 1} failed: ${error}`);
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
throw new Error(`Failed to hover append element after ${maxRetries} attempts.`);
|
|
1323
|
+
}
|
|
1324
|
+
async clickMarketPlaceButton() {
|
|
1325
|
+
const maxRetries = 3;
|
|
1326
|
+
for (let retries = 0; retries < maxRetries; retries++) {
|
|
1327
|
+
try {
|
|
1328
|
+
if (retries === 0) {
|
|
1329
|
+
await this.marketPlaceButton.click({ timeout: 30000 });
|
|
1330
|
+
}
|
|
1331
|
+
else {
|
|
1332
|
+
await this.changeTypeButton.click({ force: true, timeout: 30000 });
|
|
1333
|
+
await this.marketPlaceButton.click({ timeout: 30000 });
|
|
1334
|
+
}
|
|
1335
|
+
return;
|
|
1336
|
+
}
|
|
1337
|
+
catch (error) {
|
|
1338
|
+
console.error(`Click attempt ${retries + 1} failed: ${error}`);
|
|
1339
|
+
await new Promise((resolve) => setTimeout(resolve, 10000));
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
throw new Error(`Failed to click the button after ${maxRetries} attempts.`);
|
|
1343
|
+
}
|
|
1344
|
+
async openChangeElementPopup() {
|
|
1345
|
+
await this.clickCanvas();
|
|
1346
|
+
await this.secondElement.click({ timeout: 60000 });
|
|
1347
|
+
await this.clickChangeTypeButton();
|
|
1348
|
+
await (0, test_1.expect)(this.marketPlaceButton).toBeVisible({ timeout: 60000 });
|
|
1349
|
+
}
|
|
1350
|
+
async clickPublicHolidayConnectorOption() {
|
|
1351
|
+
const maxRetries = 4;
|
|
1352
|
+
for (let retries = 0; retries < maxRetries; retries++) {
|
|
1353
|
+
try {
|
|
1354
|
+
// Always open the change-type popup before trying to click the option.
|
|
1355
|
+
// This has to come first: the marketplace button only exists inside
|
|
1356
|
+
// that popup, so the re-download recovery below can only work once the
|
|
1357
|
+
// popup is open (it used to run before this block, right after a
|
|
1358
|
+
// page.reload(), and so could never find the button).
|
|
1359
|
+
await this.openChangeElementPopup();
|
|
1360
|
+
if (retries > 0) {
|
|
1361
|
+
// The previous attempt did not find the connector in the popup, so
|
|
1362
|
+
// the marketplace download never landed — Hub's connector-detail
|
|
1363
|
+
// request can fail (a 504 on
|
|
1364
|
+
// /api/external/marketplace/connectors/<id> leaves the marketplace
|
|
1365
|
+
// dialog stuck on its spinner and no import modal opens). Re-run the
|
|
1366
|
+
// download from the now-open popup, then reopen the popup.
|
|
1367
|
+
await this.clickMarketPlaceButton();
|
|
1368
|
+
const connectorMarketplacePage = new ConnectorMarketplacePage_1.ConnectorMarketplacePage(this.page);
|
|
1369
|
+
await connectorMarketplacePage.searchAndDownloadConnector('Public Holiday Connector');
|
|
1370
|
+
await this.openChangeElementPopup();
|
|
1371
|
+
}
|
|
1372
|
+
// Filter the virtualized change-element popup so the option scrolls
|
|
1373
|
+
// into view. Search by each full connector name (the marketplace
|
|
1374
|
+
// renamed it "Public Holiday Outbound" -> "Worldwide Public Holiday"),
|
|
1375
|
+
// not the shared "Public Holiday" substring — a generic term could
|
|
1376
|
+
// surface a different Public Holiday connector we must not select.
|
|
1377
|
+
const connectorNames = [
|
|
1378
|
+
'Worldwide Public Holiday',
|
|
1379
|
+
'Public Holiday Outbound',
|
|
1380
|
+
];
|
|
1381
|
+
const changeElementSearch = this.page.locator('.djs-popup-search input');
|
|
1382
|
+
const searchVisible = await changeElementSearch
|
|
1383
|
+
.waitFor({ state: 'visible', timeout: 5000 })
|
|
1384
|
+
.then(() => true)
|
|
1385
|
+
.catch(() => false);
|
|
1386
|
+
if (searchVisible) {
|
|
1387
|
+
for (const name of connectorNames) {
|
|
1388
|
+
await changeElementSearch.fill('');
|
|
1389
|
+
await changeElementSearch.pressSequentially(name, { delay: 50 });
|
|
1390
|
+
// waitFor actually blocks up to the timeout; isVisible() would
|
|
1391
|
+
// return immediately and miss the option still rendering after
|
|
1392
|
+
// the search filter applies.
|
|
1393
|
+
const optionVisible = await this.publicHolidayConnectorOption
|
|
1394
|
+
.waitFor({ state: 'visible', timeout: 5000 })
|
|
1395
|
+
.then(() => true)
|
|
1396
|
+
.catch(() => false);
|
|
1397
|
+
if (optionVisible) {
|
|
1398
|
+
break;
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
await this.publicHolidayConnectorOption.waitFor({
|
|
1403
|
+
state: 'visible',
|
|
1404
|
+
timeout: 60000,
|
|
1405
|
+
});
|
|
1406
|
+
await this.publicHolidayConnectorOption.click({ timeout: 30000 });
|
|
1407
|
+
return;
|
|
1408
|
+
}
|
|
1409
|
+
catch (error) {
|
|
1410
|
+
console.error(`Click attempt ${retries + 1} failed: ${error}`);
|
|
1411
|
+
if (retries >= maxRetries - 1)
|
|
1412
|
+
break;
|
|
1413
|
+
await this.page.reload();
|
|
1414
|
+
await new Promise((resolve) => setTimeout(resolve, 10000));
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
throw new Error(`Failed to click the button after ${maxRetries} attempts.`);
|
|
1418
|
+
}
|
|
1419
|
+
async clickPublicHolidayYearOption() {
|
|
1420
|
+
await this.publicHolidayYearOption.click({ timeout: 60000 });
|
|
1421
|
+
}
|
|
1422
|
+
async fillPublicHolidayYearOption(year) {
|
|
1423
|
+
await this.publicHolidayYearOption.fill(year);
|
|
1424
|
+
}
|
|
1425
|
+
async clickPublicHolidayCountryCodeOption() {
|
|
1426
|
+
await this.publicHolidayCountryCodeOption.click({ timeout: 60000 });
|
|
1427
|
+
}
|
|
1428
|
+
async fillPublicHolidayCountryCodeOption(countryCode) {
|
|
1429
|
+
await this.publicHolidayCountryCodeOption.fill(countryCode);
|
|
1430
|
+
}
|
|
1431
|
+
async chooseImplementationOption(implementationType) {
|
|
1432
|
+
await this.implementationSection.click();
|
|
1433
|
+
if ((await this.implementationOptions.inputValue()) == implementationType) {
|
|
1434
|
+
console.log(`${implementationType} is already selected.`);
|
|
1435
|
+
}
|
|
1436
|
+
else {
|
|
1437
|
+
await this.implementationOptions.selectOption(implementationType);
|
|
1438
|
+
}
|
|
1439
|
+
await this.assertImplementationOption(implementationType);
|
|
1440
|
+
}
|
|
1441
|
+
async assertImplementationOption(implementationType) {
|
|
1442
|
+
await this.expandImplementationOptionIfNecessary();
|
|
1443
|
+
(0, test_1.expect)(await this.implementationOptions.inputValue()).toEqual(implementationType);
|
|
1444
|
+
}
|
|
1445
|
+
async expandImplementationOptionIfNecessary() {
|
|
1446
|
+
const isExpanded = (await this.implementationSection
|
|
1447
|
+
.locator('.bio-properties-panel-group-header empty open')
|
|
1448
|
+
.count()) > 0;
|
|
1449
|
+
if (!isExpanded) {
|
|
1450
|
+
await this.implementationSection.click();
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
async clickIntermediateBoundaryEvent() {
|
|
1454
|
+
await this.intermediateBoundaryEvent.click({ timeout: 60000 });
|
|
1455
|
+
}
|
|
1456
|
+
async clickIntermediateWebhookConnectorOption() {
|
|
1457
|
+
await this.revealChangeElementTemplate(this.intermediateWebhookConnectorOption, 'Webhook');
|
|
1458
|
+
await this.intermediateWebhookConnectorOption.click({ timeout: 60000 });
|
|
1459
|
+
}
|
|
1460
|
+
async clickCorrelationKeyProcessInput() {
|
|
1461
|
+
await this.correlationKeyProcessInput.click({ timeout: 60000 });
|
|
1462
|
+
}
|
|
1463
|
+
async fillCorrelationKeyProcessInput(correlationKeyProcess) {
|
|
1464
|
+
await this.correlationKeyProcessInput.fill(correlationKeyProcess);
|
|
1465
|
+
}
|
|
1466
|
+
async clickCorrelationKeyPayloadInput() {
|
|
1467
|
+
await this.correlationKeyPayloadInput.click({ timeout: 60000 });
|
|
1468
|
+
}
|
|
1469
|
+
async fillCorrelationKeyPayloadInput(correlationKeyPayload) {
|
|
1470
|
+
await this.correlationKeyPayloadInput.fill(correlationKeyPayload);
|
|
1471
|
+
}
|
|
1472
|
+
async clickIdInput() {
|
|
1473
|
+
await this.processIdInput.click();
|
|
1474
|
+
}
|
|
1475
|
+
async fillIdInput(id) {
|
|
1476
|
+
await this.processIdInput.fill(id);
|
|
1477
|
+
}
|
|
1478
|
+
async fillStartFormName(name) {
|
|
1479
|
+
await this.payloadNameInput.fill(name);
|
|
1480
|
+
}
|
|
1481
|
+
async fillStartFormDate(date) {
|
|
1482
|
+
await this.payloadDateInput.click();
|
|
1483
|
+
await this.payloadDateInput.fill(date);
|
|
1484
|
+
await this.payloadDateInput.press('Enter');
|
|
1485
|
+
}
|
|
1486
|
+
async checkStartFormCheckbox() {
|
|
1487
|
+
await this.payloadCheckboxInput.check();
|
|
1488
|
+
}
|
|
1489
|
+
async fillStartFormNumber(number) {
|
|
1490
|
+
await this.payloadNumberInput.fill(number);
|
|
1491
|
+
}
|
|
1492
|
+
async chooseFormLinkingTypeOption(formLinkType) {
|
|
1493
|
+
await this.formPropertySection.click();
|
|
1494
|
+
const jsonConfig = JSON.stringify({
|
|
1495
|
+
executionPlatform: 'Camunda Cloud',
|
|
1496
|
+
executionPlatformVersion: '8.6.0',
|
|
1497
|
+
exporter: {
|
|
1498
|
+
name: 'Camunda Web Modeler',
|
|
1499
|
+
version: 'ca7603f',
|
|
1500
|
+
},
|
|
1501
|
+
schemaVersion: 17,
|
|
1502
|
+
id: 'Form_0ex0ayi',
|
|
1503
|
+
components: [
|
|
1504
|
+
{
|
|
1505
|
+
label: 'Full Name',
|
|
1506
|
+
type: 'textfield',
|
|
1507
|
+
id: 'Textfield_0',
|
|
1508
|
+
validate: {
|
|
1509
|
+
minLength: 2,
|
|
1510
|
+
required: true,
|
|
1511
|
+
},
|
|
1512
|
+
key: 'fullName',
|
|
1513
|
+
},
|
|
1514
|
+
],
|
|
1515
|
+
generated: true,
|
|
1516
|
+
type: 'default',
|
|
1517
|
+
});
|
|
1518
|
+
await this.formLinkTypeOptions.selectOption(formLinkType);
|
|
1519
|
+
await this.addFormJsonConfigurationInput.click();
|
|
1520
|
+
await this.addFormJsonConfigurationInput.fill(jsonConfig);
|
|
1521
|
+
}
|
|
1522
|
+
async clickAppendGatewayButton() {
|
|
1523
|
+
await (0, test_1.expect)(this.appendGatewayButton).toBeVisible({ timeout: 30000 });
|
|
1524
|
+
await this.appendGatewayButton.click({ timeout: 30000 });
|
|
1525
|
+
}
|
|
1526
|
+
async clickParallelGatewayOption() {
|
|
1527
|
+
await (0, test_1.expect)(this.parallelGatewayOption).toBeVisible({ timeout: 30000 });
|
|
1528
|
+
await this.parallelGatewayOption.click({ timeout: 90000 });
|
|
1529
|
+
}
|
|
1530
|
+
async clickFirstPlacedGateway() {
|
|
1531
|
+
try {
|
|
1532
|
+
await this.firstPlacedGateway.click({ timeout: 60000 });
|
|
1533
|
+
// The split gateway already has an outgoing flow, so selecting it renders
|
|
1534
|
+
// the append indicator rather than an open create pad — accept either.
|
|
1535
|
+
await (0, test_1.expect)(this.appendElementButton.or(this.appendElementIndicator)).toBeVisible({ timeout: 60000 });
|
|
1536
|
+
}
|
|
1537
|
+
catch (error) {
|
|
1538
|
+
await this.page.reload();
|
|
1539
|
+
await (0, sleep_1.sleep)(10000);
|
|
1540
|
+
await this.firstPlacedGateway.click({ timeout: 60000 });
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
async clickSecondPlacedGateway(userTaskId = '') {
|
|
1544
|
+
try {
|
|
1545
|
+
await this.clickShapeBelowContextPad(this.secondPlacedGateway);
|
|
1546
|
+
}
|
|
1547
|
+
catch (error) {
|
|
1548
|
+
await this.page.reload();
|
|
1549
|
+
await (0, sleep_1.sleep)(10000);
|
|
1550
|
+
// The reload resets the canvas viewbox to the origin, discarding the
|
|
1551
|
+
// auto-scroll that kept the right-most gateway on screen.
|
|
1552
|
+
await this.fitElementIntoCanvas(this.secondPlacedGateway);
|
|
1553
|
+
// Clear any selection the reload restored, so its context pad is closed
|
|
1554
|
+
// before the gateway is clicked.
|
|
1555
|
+
await this.clickCanvas();
|
|
1556
|
+
if (userTaskId != '') {
|
|
1557
|
+
await this.clickUserTask(userTaskId);
|
|
1558
|
+
await this.clickConnectToOtherElementButton();
|
|
1559
|
+
}
|
|
1560
|
+
await this.clickShapeBelowContextPad(this.secondPlacedGateway);
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
async addParallelUserTasks(numberOfTasks, taskName) {
|
|
1564
|
+
try {
|
|
1565
|
+
await this.clickAppendElementButton();
|
|
1566
|
+
}
|
|
1567
|
+
catch (error) {
|
|
1568
|
+
await this.page.reload();
|
|
1569
|
+
await (0, sleep_1.sleep)(20000);
|
|
1570
|
+
await this.clickFirstPlacedElement();
|
|
1571
|
+
await this.clickAppendElementButton();
|
|
1572
|
+
}
|
|
1573
|
+
await this.clickAppendGatewayButton();
|
|
1574
|
+
await this.clickChangeTypeButton();
|
|
1575
|
+
await this.clickParallelGatewayOption();
|
|
1576
|
+
await this.clickAppendElementButton();
|
|
1577
|
+
await this.clickAppendTaskButton();
|
|
1578
|
+
await this.clickChangeTypeButton();
|
|
1579
|
+
await this.clickUserTaskOption();
|
|
1580
|
+
await this.assertImplementationOption('zeebeUserTask');
|
|
1581
|
+
await this.clickGeneralPropertiesPanel();
|
|
1582
|
+
await this.clickNameInput();
|
|
1583
|
+
await this.fillNamedInput(taskName + '1');
|
|
1584
|
+
await this.clickIdInput();
|
|
1585
|
+
await this.fillIdInput(taskName + '1');
|
|
1586
|
+
await this.clickAppendElementButton();
|
|
1587
|
+
await this.clickAppendGatewayButton();
|
|
1588
|
+
await this.clickChangeTypeButton();
|
|
1589
|
+
await this.clickParallelGatewayOption();
|
|
1590
|
+
for (let i = 2; i <= numberOfTasks; i++) {
|
|
1591
|
+
await this.clickFirstPlacedGateway();
|
|
1592
|
+
await this.clickAppendElementButton();
|
|
1593
|
+
await this.clickAppendTaskButton();
|
|
1594
|
+
await this.clickChangeTypeButton();
|
|
1595
|
+
await this.clickUserTaskOption();
|
|
1596
|
+
await this.assertImplementationOption('zeebeUserTask');
|
|
1597
|
+
await this.clickNameInput();
|
|
1598
|
+
await this.fillNamedInput(taskName + i);
|
|
1599
|
+
await this.clickIdInput();
|
|
1600
|
+
await this.fillIdInput(taskName + i);
|
|
1601
|
+
await this.clickUserTask(taskName + '1');
|
|
1602
|
+
await this.clickConnectToOtherElementButton();
|
|
1603
|
+
await this.clickSecondPlacedGateway(taskName + i);
|
|
1604
|
+
await this.clickCanvas();
|
|
1605
|
+
await (0, sleep_1.sleep)(1000);
|
|
1606
|
+
}
|
|
1607
|
+
await this.fitElementIntoCanvas(this.secondPlacedGateway);
|
|
1608
|
+
await this.clickSecondPlacedGateway();
|
|
1609
|
+
}
|
|
1610
|
+
async clickServiceTaskOption() {
|
|
1611
|
+
const maxRetries = 3;
|
|
1612
|
+
for (let retries = 0; retries < maxRetries; retries++) {
|
|
1613
|
+
try {
|
|
1614
|
+
if (retries === 0) {
|
|
1615
|
+
await this.serviceTaskOption.click({ timeout: 30000, force: true });
|
|
1616
|
+
}
|
|
1617
|
+
else {
|
|
1618
|
+
await this.changeTypeButton.click({ force: true, timeout: 30000 });
|
|
1619
|
+
await this.serviceTaskOption.click({ timeout: 30000, force: true });
|
|
1620
|
+
}
|
|
1621
|
+
return;
|
|
1622
|
+
}
|
|
1623
|
+
catch (error) {
|
|
1624
|
+
console.error(`Click attempt ${retries + 1} failed: ${error}`);
|
|
1625
|
+
await new Promise((resolve) => setTimeout(resolve, 10000));
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
throw new Error(`Failed to click the button after ${maxRetries} attempts.`);
|
|
1629
|
+
}
|
|
1630
|
+
async clickTaskDefinitionPropertiesPanel() {
|
|
1631
|
+
const isExpanded = (await this.taskDefinitionPanel
|
|
1632
|
+
.locator('.bio-properties-panel-group-header empty open')
|
|
1633
|
+
.count()) > 0;
|
|
1634
|
+
if (!isExpanded) {
|
|
1635
|
+
await this.taskDefinitionPanel.click();
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
async clickJobTypeInput() {
|
|
1639
|
+
await this.jobTypeInput.click();
|
|
1640
|
+
}
|
|
1641
|
+
async fillJobTypeInput(name) {
|
|
1642
|
+
await this.jobTypeInput.fill(name);
|
|
1643
|
+
}
|
|
1644
|
+
// Test mode mounts a one-time "A new way to test your processes" modal
|
|
1645
|
+
// (camunda-hub TestAnnouncementModal) that covers the setup steps behind it.
|
|
1646
|
+
// It renders unless localStorage already carries the seen flag, which it
|
|
1647
|
+
// reads on mount; a fresh Playwright context always starts empty, so set the
|
|
1648
|
+
// flag before entering Test mode rather than clicking the modal away.
|
|
1649
|
+
// camunda-hub cfaea03b0d renamed the storage key `play-testAnnouncementSeen`
|
|
1650
|
+
// -> `test-studio-testAnnouncementSeen`; the hook still reads the old key as
|
|
1651
|
+
// a legacy fallback, so write both and stay correct either way.
|
|
1652
|
+
async suppressTestModeAnnouncement() {
|
|
1653
|
+
await this.page.evaluate(() => {
|
|
1654
|
+
localStorage.setItem('test-studio-testAnnouncementSeen', 'true');
|
|
1655
|
+
localStorage.setItem('play-testAnnouncementSeen', 'true');
|
|
1656
|
+
});
|
|
1657
|
+
}
|
|
1658
|
+
// `afterNavigation` marks the call sites that land here straight off a
|
|
1659
|
+
// page load (ensureStageCluster's goto() detour, the legacy retry's
|
|
1660
|
+
// reload()) rather than off an already-rendered diagram. Only those recover
|
|
1661
|
+
// by reloading -- see below.
|
|
1662
|
+
async switchToPlay(afterNavigation = false) {
|
|
1663
|
+
await this.suppressTestModeAnnouncement();
|
|
1664
|
+
// completePlayConfiguration re-enters Play after ensureStageCluster's
|
|
1665
|
+
// goto() detour, and the diagram page keeps rendering well past the point
|
|
1666
|
+
// goto() resolves: in a verification run the mode tabs were still absent
|
|
1667
|
+
// 10s after it returned, so the click burned the whole global
|
|
1668
|
+
// actionTimeout on a page that was merely still booting. Wait for the tab
|
|
1669
|
+
// on its own, longer budget first, then click within the normal one.
|
|
1670
|
+
//
|
|
1671
|
+
// Waiting longer is not enough on its own for the post-navigation call,
|
|
1672
|
+
// because the tabs' absence there is not always transient. Hub renders the
|
|
1673
|
+
// modes tablist only when `isCurrentDiagramValid && isBPMN &&
|
|
1674
|
+
// allowedViewModes.length > 0`, and `currentDiagramStore.isValid` stays
|
|
1675
|
+
// false until the diagram content has been fetched AND sanitised
|
|
1676
|
+
// (`healthState.isValid && hasBeenValidated`). A diagram fetch that fails
|
|
1677
|
+
// on that fresh load therefore renders an action bar with no mode tabs at
|
|
1678
|
+
// all, permanently -- so the single-shot 90s wait could only ever expire on
|
|
1679
|
+
// it. Re-navigate between attempts instead: the reload re-runs the fetch
|
|
1680
|
+
// that did not land. Gated on `afterNavigation` so the in-place call from
|
|
1681
|
+
// the spec, made on a diagram whose tabs have been on screen throughout
|
|
1682
|
+
// modelling, can never reload mid-edit.
|
|
1683
|
+
if (afterNavigation) {
|
|
1684
|
+
await (0, test_1.expect)(async () => {
|
|
1685
|
+
const visible = await this.playTab
|
|
1686
|
+
.waitFor({ state: 'visible', timeout: 45000 })
|
|
1687
|
+
.then(() => true)
|
|
1688
|
+
.catch(() => false);
|
|
1689
|
+
if (!visible) {
|
|
1690
|
+
await this.page.reload({ waitUntil: 'domcontentloaded' });
|
|
1691
|
+
await this.playTab.waitFor({ state: 'visible', timeout: 45000 });
|
|
1692
|
+
}
|
|
1693
|
+
}).toPass({ timeout: 150000 });
|
|
1694
|
+
}
|
|
1695
|
+
else {
|
|
1696
|
+
await this.playTab.waitFor({ state: 'visible', timeout: 90000 });
|
|
1697
|
+
}
|
|
1698
|
+
await this.playTab.click();
|
|
1699
|
+
}
|
|
1700
|
+
// Scopes the "Set up test run" deploy step to the diagram under test.
|
|
1701
|
+
// Hub's step 2 ("Choose resources to deploy") pre-selects "All resources"
|
|
1702
|
+
// (`#deploy-mode-bundle`), which deploys the whole shared project and is
|
|
1703
|
+
// rejected with a 400 for other specs' invalid resources. "Only this
|
|
1704
|
+
// resource" (`#deploy-mode-single-file`) deploys just this process. Matched
|
|
1705
|
+
// by id: the radio has no accessible name of its own. Ported from pages/8.9.
|
|
1706
|
+
async selectPlayDeploySingleResource() {
|
|
1707
|
+
const singleResourceOption = this.page.locator('#deploy-mode-single-file:not([disabled])');
|
|
1708
|
+
const hasOption = await singleResourceOption
|
|
1709
|
+
.waitFor({ state: 'visible', timeout: 15000 })
|
|
1710
|
+
.then(() => true)
|
|
1711
|
+
.catch(() => false);
|
|
1712
|
+
if (!hasOption) {
|
|
1713
|
+
return;
|
|
1714
|
+
}
|
|
1715
|
+
await (0, test_1.expect)(async () => {
|
|
1716
|
+
if ((await singleResourceOption.getAttribute('aria-checked')) === 'true') {
|
|
1717
|
+
return;
|
|
1718
|
+
}
|
|
1719
|
+
await singleResourceOption.click({ timeout: 10000 });
|
|
1720
|
+
await (0, test_1.expect)(singleResourceOption).toHaveAttribute('aria-checked', 'true', { timeout: 10000 });
|
|
1721
|
+
}).toPass({ timeout: 30000 });
|
|
1722
|
+
}
|
|
1723
|
+
async completePlayConfiguration(clusterName) {
|
|
1724
|
+
// Play is a tab on the diagram page, not its own URL, so the stage-cluster
|
|
1725
|
+
// detour's goto() lands back on the Modeler tab and every Play locator
|
|
1726
|
+
// below would then look for a panel that is no longer rendered. Re-enter
|
|
1727
|
+
// Play when the detour actually navigated. Binding cannot simply move
|
|
1728
|
+
// before switchToPlay(): this is the first point in the flow that knows
|
|
1729
|
+
// which cluster the test plays on.
|
|
1730
|
+
const reboundStageCluster = await this.processApplicationPage.ensureStageCluster(clusterName);
|
|
1731
|
+
if (reboundStageCluster) {
|
|
1732
|
+
await this.switchToPlay(true);
|
|
1733
|
+
}
|
|
1734
|
+
const timeout = 30000;
|
|
1735
|
+
// New flow (8.10+): "Setup environment" panel with three steps:
|
|
1736
|
+
// 1. Connect cluster → "Configure environment" modal → select cluster → Save
|
|
1737
|
+
// 2. Deploy process → wait for success banner
|
|
1738
|
+
// 3. Configure test case
|
|
1739
|
+
// camunda-hub 8b42269 ("unify Setup environment / Configure test case
|
|
1740
|
+
// panel, polish", #28226, 2026-09-04) replaced ConfigurationOverlay with
|
|
1741
|
+
// TestConfigurationPanel, a Carbon Accordion. "Deploy process" is now only
|
|
1742
|
+
// the accordion HEADER label and the Deploy button lives in the item's
|
|
1743
|
+
// separate content wrapper, so scoping by getByText('Deploy process') ->
|
|
1744
|
+
// '..' resolves to the header's own span and matches no button at all --
|
|
1745
|
+
// isEnabled() then throws, the probe reads false forever and the settle
|
|
1746
|
+
// wait below times out even though Deploy is on screen and enabled. The
|
|
1747
|
+
// data-testid is unchanged between the old overlay and the new panel, so
|
|
1748
|
+
// anchor on it instead.
|
|
1749
|
+
const setupDeployButton = this.page.getByTestId('test-configuration-deploy-button');
|
|
1750
|
+
// "Deploy reported success" has moved twice. 8b42269 dropped the
|
|
1751
|
+
// "Process has been successfully deployed." sentence in favour of a
|
|
1752
|
+
// `deploy-success-badge` element, and camunda-hub d2fd90227c ("remove
|
|
1753
|
+
// non-process-application deploy logic from test studio", #28585,
|
|
1754
|
+
// 2026-09-11) then deleted that badge outright along with the rest of the
|
|
1755
|
+
// non-process-application deploy path -- so neither locator matches
|
|
1756
|
+
// anything on a current modeler build and this wait could only ever time
|
|
1757
|
+
// out, even though the deploy itself succeeds.
|
|
1758
|
+
//
|
|
1759
|
+
// The surviving indicator is the accordion step icon: DeployStepIcon
|
|
1760
|
+
// renders a check carrying `aria-label="Deployment complete"` exactly when
|
|
1761
|
+
// `isDeployStepComplete` is true, which is the same `isTestEnvironmentReady`
|
|
1762
|
+
// flag that opens step 3. Match it by attribute rather than getByLabel:
|
|
1763
|
+
// TestConfigurationPanel wraps the icon in an `aria-hidden` span, so it is
|
|
1764
|
+
// deliberately outside the accessibility tree. The sibling error state has
|
|
1765
|
+
// its own label ("Deployment failed"), so a failed deploy still surfaces as
|
|
1766
|
+
// a timeout here instead of passing. Keep both older locators for
|
|
1767
|
+
// pre-d2fd902 modeler builds.
|
|
1768
|
+
//
|
|
1769
|
+
// Probed by ATTACHMENT, never visibility: the panel reacts to the same
|
|
1770
|
+
// completion state by hiding the setup overlay and collapsing the deploy
|
|
1771
|
+
// accordion item, so the indicator can be present-but-hidden within a frame
|
|
1772
|
+
// of appearing and a toBeVisible() wait on it can never pass.
|
|
1773
|
+
const deploySuccessBadge = this.page
|
|
1774
|
+
.locator('[aria-label="Deployment complete"]')
|
|
1775
|
+
.or(this.page.getByTestId('deploy-success-badge'))
|
|
1776
|
+
.or(this.page.getByText('Process has been successfully deployed'))
|
|
1777
|
+
.first();
|
|
1778
|
+
const isDeployReported = async () => (await deploySuccessBadge.count()) > 0;
|
|
1779
|
+
// Legacy-only button. camunda-hub renamed it twice (a90fd06 label
|
|
1780
|
+
// "Configure scenario" -> "Configure test case"; b3958a1649 (#27259,
|
|
1781
|
+
// 2026-08-07) test id `play-configuration-configure-scenario-button` ->
|
|
1782
|
+
// `configure-test-case-button`) and then 8b42269 removed it outright: the
|
|
1783
|
+
// accordion panel hides the setup overlay and opens step 3 by itself once
|
|
1784
|
+
// the deploy step completes, so there is nothing left to click. Keep the
|
|
1785
|
+
// locator for older modeler builds and drive it only when it is really
|
|
1786
|
+
// there. Match test ids ONLY: the accessible name of the new accordion's
|
|
1787
|
+
// step-3 heading button is also exactly "Configure test case" (its "3"
|
|
1788
|
+
// marker is aria-hidden), so a `getByRole('button', {name: ...})` fallback
|
|
1789
|
+
// silently binds to that heading instead. That made the deploy step look
|
|
1790
|
+
// already-done (the heading is visible while disabled) and then spent the
|
|
1791
|
+
// whole retry budget clicking a permanently disabled heading.
|
|
1792
|
+
const configureScenarioButton = this.page
|
|
1793
|
+
.getByTestId('configure-test-case-button')
|
|
1794
|
+
.or(this.page.getByTestId('play-configuration-configure-scenario-button'))
|
|
1795
|
+
.first();
|
|
1796
|
+
// Play settles into exactly ONE of three states, and which one is not
|
|
1797
|
+
// knowable up front, so race them instead of timing out on each in turn:
|
|
1798
|
+
// the setup overlay, the legacy Continue button, or the configure-test
|
|
1799
|
+
// panel (meaning setup is already done for this diagram).
|
|
1800
|
+
//
|
|
1801
|
+
// Waiting only for the first two and reading "neither" as "already ready"
|
|
1802
|
+
// was wrong once the diagram moved inside a process application.
|
|
1803
|
+
// ConfigurationOverlay renders null until isDeploymentStateValidated, and
|
|
1804
|
+
// it sets that flag synchronously ONLY when processApplicationId is
|
|
1805
|
+
// undefined -- exactly what a project-root diagram used to give it. With
|
|
1806
|
+
// the diagram in a process application the id is defined, so the overlay
|
|
1807
|
+
// must first await checkExistingDeployment(). The old 15s probe raced that
|
|
1808
|
+
// async call, concluded "already ready" and returned while the overlay was
|
|
1809
|
+
// still about to appear. ConfigureTestPanel returns null for as long as the
|
|
1810
|
+
// overlay is up, so the Start button never existed and
|
|
1811
|
+
// clickStartInstanceButton burned its entire retry budget looking for it.
|
|
1812
|
+
// camunda-hub's "Play" -> "Test Studio" rebrand renamed this container's
|
|
1813
|
+
// data-test from `play-configuration-overlay` to
|
|
1814
|
+
// `test-studio-configuration-overlay` (confirmed in a failing run's trace
|
|
1815
|
+
// DOM, and already fixed the same way in pages/SM-8.10). Anchor on the
|
|
1816
|
+
// new data-test, keep the legacy attribute for older modeler builds, and
|
|
1817
|
+
// fall back to the "Setup environment" panel title. This locator means
|
|
1818
|
+
// "the setup panel is still on screen".
|
|
1819
|
+
const configurationOverlay = this.page
|
|
1820
|
+
.locator('[data-test="test-studio-configuration-overlay"]')
|
|
1821
|
+
.or(this.page.locator('[data-test="play-configuration-overlay"]'))
|
|
1822
|
+
.or(this.page.getByText('Set up environment'))
|
|
1823
|
+
// With Hub's Environments feature on, the card is titled "Set up test
|
|
1824
|
+
// run" (steps "Choose where to run" / "Choose resources to deploy" /
|
|
1825
|
+
// "Configure test case") and none of the locators above match.
|
|
1826
|
+
.or(this.page.getByText('Set up test run', { exact: true }))
|
|
1827
|
+
.first();
|
|
1828
|
+
const configureTestPanel = this.page.getByTestId('configure-test-panel');
|
|
1829
|
+
// Step 2's content (the Deploy button) only renders visibly while its
|
|
1830
|
+
// accordion item is expanded; clicking the heading is the recovery when it
|
|
1831
|
+
// did not expand on its own.
|
|
1832
|
+
const deployStepHeading = this.page
|
|
1833
|
+
.getByRole('button', { name: 'Deploy process' })
|
|
1834
|
+
.or(this.page.getByRole('button', { name: 'Choose resources to deploy' }))
|
|
1835
|
+
.first();
|
|
1836
|
+
// Step-3 accordion heading. Fallback click target only, while the panel is
|
|
1837
|
+
// closed and the heading enabled -- never a completion probe, since it is
|
|
1838
|
+
// visible while disabled (see configureScenarioButton).
|
|
1839
|
+
const configureStepHeading = this.page.getByRole('button', {
|
|
1840
|
+
name: 'Configure test case',
|
|
1841
|
+
exact: true,
|
|
1842
|
+
});
|
|
1843
|
+
await (0, test_1.expect)(configurationOverlay
|
|
1844
|
+
.or(this.continueToPlayButton)
|
|
1845
|
+
.or(configureTestPanel)
|
|
1846
|
+
.first()).toBeVisible({ timeout: 90000 });
|
|
1847
|
+
if (await configureTestPanel.isVisible()) {
|
|
1848
|
+
// Already past setup for this diagram -- nothing to drive.
|
|
1849
|
+
return;
|
|
1850
|
+
}
|
|
1851
|
+
// Keyed on the overlay itself, not on its Deploy button: when
|
|
1852
|
+
// checkExistingDeployment finds a deployment the overlay opens with the
|
|
1853
|
+
// deploy step already complete, so there is no Deploy button to see and
|
|
1854
|
+
// keying on it would fall through to the legacy Continue flow.
|
|
1855
|
+
const isNewFlow = await configurationOverlay.isVisible();
|
|
1856
|
+
if (isNewFlow) {
|
|
1857
|
+
// Step 1: connect a cluster only if none is connected yet.
|
|
1858
|
+
//
|
|
1859
|
+
// The panel may auto-connect to a previously used cluster: on load the
|
|
1860
|
+
// Deploy button is transiently disabled and, once a cluster is connected,
|
|
1861
|
+
// the "Connect cluster" button is replaced by a "Change" button. So
|
|
1862
|
+
// neither the Deploy button's disabled state nor a single visibility poll
|
|
1863
|
+
// is a reliable signal on its own — checking too early sees a disabled
|
|
1864
|
+
// Deploy button and then waits forever for a "Connect cluster" button that
|
|
1865
|
+
// never renders (it has become "Change").
|
|
1866
|
+
//
|
|
1867
|
+
// Wait until the panel settles into one of three stable states before
|
|
1868
|
+
// deciding, then branch:
|
|
1869
|
+
// - "Connect cluster" button visible → no cluster connected, connect one
|
|
1870
|
+
// (Environments panel: "Select environment"; or "Cluster
|
|
1871
|
+
// unavailable", re-picked through "Change")
|
|
1872
|
+
// - Deploy button enabled → a cluster is already connected
|
|
1873
|
+
// - deploy already complete → re-entering an already deployed
|
|
1874
|
+
// process application, where the Deploy button is replaced by the
|
|
1875
|
+
// deploy step's completion state and "Connect cluster" by "Change",
|
|
1876
|
+
// so neither of the first two states is ever reached
|
|
1877
|
+
//
|
|
1878
|
+
// The success badge is NOT a usable completion signal, not even by
|
|
1879
|
+
// attachment: the current Test Studio panel does not render it at all,
|
|
1880
|
+
// so a wait on it can never resolve — that is what made step 2 below
|
|
1881
|
+
// burn its whole 90s budget on every 8.10 nightly from 2026-09-10 on,
|
|
1882
|
+
// while the same flow stayed green on 8.9 and SM-8.10, both of which
|
|
1883
|
+
// already probe the panel instead. The deploy step reports completion
|
|
1884
|
+
// three other ways: the "Deployment complete" icon in the accordion
|
|
1885
|
+
// HEADING (which stays on screen when the item collapses), the
|
|
1886
|
+
// "Configure test case" step unlocking, and the configure-test panel
|
|
1887
|
+
// opening. Accept any of them, keep the badge for older modeler builds.
|
|
1888
|
+
// A failed deploy leaves all four absent, so both the settle wait and
|
|
1889
|
+
// step 2 still fail on a real deploy failure rather than masking it.
|
|
1890
|
+
//
|
|
1891
|
+
// This probe has to be shared with the settle wait, not just used in
|
|
1892
|
+
// step 2: the already-deployed state is exactly the one that renders no
|
|
1893
|
+
// "Connect cluster" button and no enabled Deploy button, so a settle
|
|
1894
|
+
// wait keyed on the badge alone can never see it and would throw here
|
|
1895
|
+
// before step 2 is ever reached.
|
|
1896
|
+
const deployCompleteIcon = this.page.locator('[aria-label="Deployment complete"]');
|
|
1897
|
+
const isDeployComplete = async () => (await isDeployReported()) ||
|
|
1898
|
+
(await deployCompleteIcon.isVisible().catch(() => false)) ||
|
|
1899
|
+
(await configureTestPanel.isVisible().catch(() => false)) ||
|
|
1900
|
+
(await configureScenarioButton
|
|
1901
|
+
.isEnabled({ timeout: 3000 })
|
|
1902
|
+
.catch(() => false));
|
|
1903
|
+
const connectClusterButton = this.page.getByRole('button', {
|
|
1904
|
+
name: 'Connect cluster',
|
|
1905
|
+
});
|
|
1906
|
+
// Environments panel: step 1 ("Choose where to run") offers "Select
|
|
1907
|
+
// environment", which opens the "Choose where to run" dialog of the
|
|
1908
|
+
// workspace's environment rows.
|
|
1909
|
+
const selectEnvironmentButton = this.page.getByRole('button', {
|
|
1910
|
+
name: 'Select environment',
|
|
1911
|
+
});
|
|
1912
|
+
// Once a cluster is bound the same picker is reached through "Change";
|
|
1913
|
+
// an unusable one shows "Cluster unavailable" and keeps Deploy disabled
|
|
1914
|
+
// for good, so treat it as "step 1 not done".
|
|
1915
|
+
const changeClusterButton = this.page
|
|
1916
|
+
.getByRole('button', { name: 'Change', exact: true })
|
|
1917
|
+
.first();
|
|
1918
|
+
const clusterHealthyIcon = this.page.locator('[aria-label="Cluster healthy"]');
|
|
1919
|
+
const clusterUnavailableIcon = this.page.locator('[aria-label="Cluster unavailable"]');
|
|
1920
|
+
await (0, test_1.expect)(async () => {
|
|
1921
|
+
const connectVisible = (await connectClusterButton.isVisible().catch(() => false)) ||
|
|
1922
|
+
(await selectEnvironmentButton.isVisible().catch(() => false)) ||
|
|
1923
|
+
(await clusterUnavailableIcon.isVisible().catch(() => false));
|
|
1924
|
+
const deployEnabled = await setupDeployButton
|
|
1925
|
+
.isEnabled()
|
|
1926
|
+
.catch(() => false);
|
|
1927
|
+
// Evaluated last and only when needed: its isEnabled() probe waits on
|
|
1928
|
+
// a button that is absent on most builds, so short-circuiting keeps
|
|
1929
|
+
// the common "Deploy is enabled" poll cheap.
|
|
1930
|
+
const settled = connectVisible || deployEnabled || (await isDeployComplete());
|
|
1931
|
+
(0, test_1.expect)(settled).toBe(true);
|
|
1932
|
+
}).toPass({ timeout: 30000 });
|
|
1933
|
+
const chooseWhereToRunDialog = this.page.getByRole('dialog', {
|
|
1934
|
+
name: 'Choose where to run',
|
|
1935
|
+
});
|
|
1936
|
+
const configureEnvDialog = this.page
|
|
1937
|
+
.getByRole('dialog')
|
|
1938
|
+
.filter({ hasText: 'Configure environment' });
|
|
1939
|
+
const chooseEnvironment = async () => {
|
|
1940
|
+
await (0, test_1.expect)(chooseWhereToRunDialog).toBeVisible({ timeout });
|
|
1941
|
+
await (0, modelerCluster_1.selectDeployEnvironment)(chooseWhereToRunDialog, clusterName);
|
|
1942
|
+
await chooseWhereToRunDialog
|
|
1943
|
+
.getByRole('button', { name: 'Save', exact: true })
|
|
1944
|
+
.click({ timeout });
|
|
1945
|
+
await (0, test_1.expect)(chooseWhereToRunDialog).toBeHidden({ timeout });
|
|
1946
|
+
};
|
|
1947
|
+
const hasSelectEnvironment = await selectEnvironmentButton
|
|
1948
|
+
.isVisible()
|
|
1949
|
+
.catch(() => false);
|
|
1950
|
+
const hasConnectButton = await connectClusterButton
|
|
1951
|
+
.isVisible()
|
|
1952
|
+
.catch(() => false);
|
|
1953
|
+
const needsClusterConnect = hasConnectButton ||
|
|
1954
|
+
(await clusterUnavailableIcon.isVisible().catch(() => false));
|
|
1955
|
+
if (hasSelectEnvironment || needsClusterConnect) {
|
|
1956
|
+
let openPickerButton = changeClusterButton;
|
|
1957
|
+
if (hasSelectEnvironment) {
|
|
1958
|
+
openPickerButton = selectEnvironmentButton;
|
|
1959
|
+
}
|
|
1960
|
+
else if (hasConnectButton) {
|
|
1961
|
+
openPickerButton = connectClusterButton;
|
|
1962
|
+
}
|
|
1963
|
+
await openPickerButton.click({ timeout: 15000 });
|
|
1964
|
+
await (0, test_1.expect)(chooseWhereToRunDialog.or(configureEnvDialog).first()).toBeVisible({ timeout });
|
|
1965
|
+
}
|
|
1966
|
+
if (await chooseWhereToRunDialog.isVisible()) {
|
|
1967
|
+
await chooseEnvironment();
|
|
1968
|
+
}
|
|
1969
|
+
else if (await configureEnvDialog.isVisible()) {
|
|
1970
|
+
// The "Configure environment" modal lists each available cluster as a
|
|
1971
|
+
// labelled toggle switch (cds--toggle), not as a combobox+option list.
|
|
1972
|
+
// Mirror the legacy `selectCluster` deploy-dialog logic: scope by the
|
|
1973
|
+
// cluster's label, toggle it on, and confirm the switch is checked
|
|
1974
|
+
// before saving. This handles environments with multiple clusters.
|
|
1975
|
+
const clusterLabel = configureEnvDialog
|
|
1976
|
+
.locator('label')
|
|
1977
|
+
.filter({ hasText: new RegExp(`^${clusterName}`) });
|
|
1978
|
+
const clusterSwitch = clusterLabel.getByRole('switch');
|
|
1979
|
+
await (0, test_1.expect)(clusterLabel).toBeVisible({ timeout });
|
|
1980
|
+
const alreadyChecked = (await clusterSwitch.getAttribute('aria-checked')) === 'true';
|
|
1981
|
+
if (!alreadyChecked) {
|
|
1982
|
+
await clusterLabel.click({ timeout });
|
|
1983
|
+
}
|
|
1984
|
+
await (0, test_1.expect)(clusterSwitch).toBeChecked({ timeout });
|
|
1985
|
+
// Wait for "Healthy" status before saving so the deploy step
|
|
1986
|
+
// doesn't race the backend's health check.
|
|
1987
|
+
await (0, test_1.expect)(configureEnvDialog).toContainText('Healthy', {
|
|
1988
|
+
timeout: 30000,
|
|
1989
|
+
});
|
|
1990
|
+
await configureEnvDialog
|
|
1991
|
+
.getByRole('button', { name: 'Save' })
|
|
1992
|
+
.click({ timeout });
|
|
1993
|
+
}
|
|
1994
|
+
// Step 2: deploy, unless the overlay already opened with the
|
|
1995
|
+
// deploy step complete. checkExistingDeployment only runs when
|
|
1996
|
+
// processApplicationId is defined, which it now is, so re-entering
|
|
1997
|
+
// Play on an already-deployed process application legitimately
|
|
1998
|
+
// has nothing to deploy and renders no Deploy button at all. Keyed on
|
|
1999
|
+
// the shared completion probe defined above, never on the success badge.
|
|
2000
|
+
if (!(await isDeployComplete())) {
|
|
2001
|
+
// Gate on the cluster step having completed: ClusterStepIcon renders
|
|
2002
|
+
// this label in the accordion heading exactly when DeployStepContent
|
|
2003
|
+
// enables Deploy, so a cluster problem fails here, not as "Deploy
|
|
2004
|
+
// never enabled".
|
|
2005
|
+
await (0, test_1.expect)(clusterHealthyIcon).toBeVisible({ timeout: 90000 });
|
|
2006
|
+
// Expand the deploy step if it did not open by itself. The probe must
|
|
2007
|
+
// wait: isVisible() does not, and clicking an already-open heading
|
|
2008
|
+
// collapses it.
|
|
2009
|
+
const deployButtonShown = await setupDeployButton
|
|
2010
|
+
.waitFor({ state: 'visible', timeout: 30000 })
|
|
2011
|
+
.then(() => true)
|
|
2012
|
+
.catch(() => false);
|
|
2013
|
+
const canExpandDeployStep = await deployStepHeading
|
|
2014
|
+
.isEnabled()
|
|
2015
|
+
.catch(() => false);
|
|
2016
|
+
if (!deployButtonShown && canExpandDeployStep) {
|
|
2017
|
+
await deployStepHeading.click({ timeout });
|
|
2018
|
+
}
|
|
2019
|
+
// Stays disabled until the backend confirms the cluster from step 1.
|
|
2020
|
+
await (0, test_1.expect)(setupDeployButton).toBeEnabled({ timeout: 60000 });
|
|
2021
|
+
await this.selectPlayDeploySingleResource();
|
|
2022
|
+
// Re-click only while the deploy is provably incomplete and the button
|
|
2023
|
+
// enabled (an in-flight deploy disables it), because the accordion
|
|
2024
|
+
// re-renders around the button and a click can land on a detached node.
|
|
2025
|
+
await (0, test_1.expect)(async () => {
|
|
2026
|
+
if (await isDeployComplete()) {
|
|
2027
|
+
return;
|
|
2028
|
+
}
|
|
2029
|
+
const isButtonShown = await setupDeployButton
|
|
2030
|
+
.isVisible()
|
|
2031
|
+
.catch(() => false);
|
|
2032
|
+
if (!isButtonShown) {
|
|
2033
|
+
if (await deployStepHeading.isEnabled().catch(() => false)) {
|
|
2034
|
+
await deployStepHeading.click({ timeout });
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
else if (await setupDeployButton.isEnabled().catch(() => false)) {
|
|
2038
|
+
await setupDeployButton.click({ timeout });
|
|
2039
|
+
}
|
|
2040
|
+
(0, test_1.expect)(await isDeployComplete()).toBe(true);
|
|
2041
|
+
}).toPass({ timeout: 120000, intervals: [1000, 2000, 5000] });
|
|
2042
|
+
}
|
|
2043
|
+
// Step 3: reach the configure-test panel and confirm it really rendered.
|
|
2044
|
+
// The accordion panel opens step 3 on its own once the deploy step
|
|
2045
|
+
// completes (TestConfigurationPanel hides the setup overlay in an
|
|
2046
|
+
// effect); only the legacy overlay needed the "Configure test case"
|
|
2047
|
+
// click, and that click only called hideConfigurationOverlay(), so the
|
|
2048
|
+
// overlay's cluster-change effect could fire resetDeployment and bring
|
|
2049
|
+
// it straight back. Re-drive the button when it exists, but key the
|
|
2050
|
+
// retry on the panel rather than on the overlay: the new panel keeps its
|
|
2051
|
+
// "Setup environment" heading on screen alongside step 3, so an
|
|
2052
|
+
// overlay-visible check is now permanently true and would loop on a
|
|
2053
|
+
// button that no longer exists.
|
|
2054
|
+
await (0, test_1.expect)(async () => {
|
|
2055
|
+
const hasConfigureButton = await configureScenarioButton
|
|
2056
|
+
.isVisible()
|
|
2057
|
+
.catch(() => false);
|
|
2058
|
+
if (hasConfigureButton) {
|
|
2059
|
+
await configureScenarioButton.click({ timeout });
|
|
2060
|
+
}
|
|
2061
|
+
else if (!(await configureTestPanel.isVisible()) &&
|
|
2062
|
+
(await configureStepHeading
|
|
2063
|
+
.isEnabled({ timeout: 5000 })
|
|
2064
|
+
.catch(() => false))) {
|
|
2065
|
+
await configureStepHeading.click({ timeout: 15000 });
|
|
2066
|
+
}
|
|
2067
|
+
await (0, test_1.expect)(configureTestPanel).toBeVisible({ timeout: 15000 });
|
|
2068
|
+
}).toPass({ timeout: 90000 });
|
|
2069
|
+
return;
|
|
2070
|
+
}
|
|
2071
|
+
// Legacy flow: select cluster via dialog, then click Continue.
|
|
2072
|
+
let attempts = 0;
|
|
2073
|
+
const maxRetries = 2;
|
|
2074
|
+
while (attempts < maxRetries) {
|
|
2075
|
+
try {
|
|
2076
|
+
// Call switchToPlay on subsequent attempts, i.e. after the reload at
|
|
2077
|
+
// the bottom of this loop.
|
|
2078
|
+
if (attempts > 0)
|
|
2079
|
+
await this.switchToPlay(true);
|
|
2080
|
+
await this.selectCluster(clusterName);
|
|
2081
|
+
await this.continueToPlayButton.click({ timeout });
|
|
2082
|
+
await (0, test_1.expect)(this.page.getByText('Play environment is ready')).toBeVisible({ timeout: 90000 });
|
|
2083
|
+
return; // Exit if successful
|
|
2084
|
+
}
|
|
2085
|
+
catch (error) {
|
|
2086
|
+
if (attempts >= maxRetries - 1)
|
|
2087
|
+
throw error;
|
|
2088
|
+
await this.page.reload();
|
|
2089
|
+
attempts++;
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
async embedForm(formName) {
|
|
2094
|
+
await this.clickEmbedFormButton();
|
|
2095
|
+
await this.clickForm(formName);
|
|
2096
|
+
await this.clickEmbedButton();
|
|
2097
|
+
}
|
|
2098
|
+
async openDetailsPanelIfCollapsed() {
|
|
2099
|
+
await (0, test_1.expect)(this.detailsPanelToggle).toBeVisible({ timeout: 60000 });
|
|
2100
|
+
const isCollapsed = (await this.detailsPanelToggle.getAttribute('aria-expanded')) === 'false';
|
|
2101
|
+
if (isCollapsed) {
|
|
2102
|
+
await this.detailsPanelToggle.click({ timeout: 60000 });
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
async fillStartEventVariablesForDocHandling(zeebeUrl, zeebeClientId, zeebeClientSecret) {
|
|
2106
|
+
console.log(`URL: ${zeebeUrl}, ClientId: ${zeebeClientId}, Secret: ${zeebeClientSecret}`);
|
|
2107
|
+
await (0, sessionRecovery_1.recoverStuckModelerLogin)(this.page);
|
|
2108
|
+
await (0, test_1.expect)(this.connectorsDocHandlingStartEventElement).toBeVisible({
|
|
2109
|
+
timeout: 60000,
|
|
2110
|
+
});
|
|
2111
|
+
await this.connectorsDocHandlingStartEventElement.click();
|
|
2112
|
+
// After the page reload in modelAndRunConnectorsDocHandlingDiagram the
|
|
2113
|
+
// modeler's Details (properties) panel is collapsed, so the start event's
|
|
2114
|
+
// "Output mapping" group is not rendered. Re-open the panel before
|
|
2115
|
+
// asserting on its contents.
|
|
2116
|
+
await this.openDetailsPanelIfCollapsed();
|
|
2117
|
+
await (0, test_1.expect)(this.startEventVariableInputWithThreeVariables).toBeVisible({
|
|
2118
|
+
timeout: 60000,
|
|
2119
|
+
});
|
|
2120
|
+
await this.startEventVariableInputWithThreeVariables.click();
|
|
2121
|
+
await this.fillZeebeRestValue(zeebeUrl);
|
|
2122
|
+
await this.fillZeebeSecretValue(zeebeClientSecret);
|
|
2123
|
+
await this.fillZeebeClientId(zeebeClientId);
|
|
2124
|
+
await (0, sleep_1.sleep)(1000);
|
|
2125
|
+
}
|
|
2126
|
+
// Each Output mapping row is a collapsible properties-panel entry whose
|
|
2127
|
+
// header *toggles* on click, so a single blind click is not idempotent: when
|
|
2128
|
+
// the panel re-renders while the click is in flight — it does, right after
|
|
2129
|
+
// the preceding FEEL editor commits its value — the entry ends up collapsed
|
|
2130
|
+
// again and its editor keeps a zero-size box. That is what reported
|
|
2131
|
+
// `expect(#bio-properties-panel-StartEvent_1-output-2-source div)
|
|
2132
|
+
// .toBeVisible()` timing out with "unexpected value hidden" for a full 60s
|
|
2133
|
+
// while the trace screenshot showed zeebeRestAdress and zeebeSecret open and
|
|
2134
|
+
// zeebeClientId collapsed. Ask for the state instead of assuming it: only
|
|
2135
|
+
// click while the editor is still hidden, and re-check after each click.
|
|
2136
|
+
async expandOutputMappingEntry(header, editor) {
|
|
2137
|
+
const maxAttempts = 5;
|
|
2138
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
2139
|
+
if (await editor.isVisible().catch(() => false)) {
|
|
2140
|
+
return;
|
|
2141
|
+
}
|
|
2142
|
+
await header.click();
|
|
2143
|
+
const opened = await editor
|
|
2144
|
+
.waitFor({ state: 'visible', timeout: 15000 })
|
|
2145
|
+
.then(() => true)
|
|
2146
|
+
.catch(() => false);
|
|
2147
|
+
if (opened) {
|
|
2148
|
+
return;
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
await (0, test_1.expect)(editor).toBeVisible({ timeout: 60000 });
|
|
2152
|
+
}
|
|
2153
|
+
async fillZeebeClientId(clientId) {
|
|
2154
|
+
await this.expandOutputMappingEntry(this.zeebeClientIdVariable, this.variableAssignmentValueTextboxThirdVariable);
|
|
2155
|
+
await this.variableAssignmentValueTextboxThirdVariable.click();
|
|
2156
|
+
await (0, sleep_1.sleep)(1000);
|
|
2157
|
+
await this.variableAssignmentValueTextboxThirdVariable.fill('');
|
|
2158
|
+
await this.variableAssignmentValueTextboxThirdVariable.fill(clientId);
|
|
2159
|
+
await (0, test_1.expect)(this.variableAssignmentValueTextboxThirdVariable).toHaveText(clientId);
|
|
2160
|
+
}
|
|
2161
|
+
async fillZeebeSecretValue(zeebeSecret) {
|
|
2162
|
+
await this.expandOutputMappingEntry(this.zeebeSecretVariable, this.variableAssignmentValueTextboxSecondVariable);
|
|
2163
|
+
await this.variableAssignmentValueTextboxSecondVariable.click();
|
|
2164
|
+
await (0, sleep_1.sleep)(1000);
|
|
2165
|
+
await this.variableAssignmentValueTextboxSecondVariable.fill('');
|
|
2166
|
+
await this.variableAssignmentValueTextboxSecondVariable.fill(zeebeSecret);
|
|
2167
|
+
await (0, test_1.expect)(this.variableAssignmentValueTextboxSecondVariable).toHaveText(zeebeSecret);
|
|
2168
|
+
}
|
|
2169
|
+
async fillZeebeRestValue(zeebeUrl) {
|
|
2170
|
+
await this.expandOutputMappingEntry(this.zeebeRestAddressVariable, this.variableAssignmentValueTextbox);
|
|
2171
|
+
await this.variableAssignmentValueTextbox.click();
|
|
2172
|
+
await (0, sleep_1.sleep)(1000);
|
|
2173
|
+
await this.variableAssignmentValueTextbox.fill('');
|
|
2174
|
+
await this.variableAssignmentValueTextbox.fill(zeebeUrl);
|
|
2175
|
+
await (0, test_1.expect)(this.variableAssignmentValueTextbox).toHaveText(zeebeUrl);
|
|
2176
|
+
}
|
|
2177
|
+
async clickTimerEventOption() {
|
|
2178
|
+
await this.timerEventOption.click();
|
|
2179
|
+
}
|
|
2180
|
+
async clickTimerEventSettings() {
|
|
2181
|
+
await this.timerEventSettings.click();
|
|
2182
|
+
}
|
|
2183
|
+
async selectTimerType(type) {
|
|
2184
|
+
await this.timerType.selectOption(type);
|
|
2185
|
+
}
|
|
2186
|
+
async clickTimerValue() {
|
|
2187
|
+
await this.timerValue.click();
|
|
2188
|
+
}
|
|
2189
|
+
async fillTimerValue(value) {
|
|
2190
|
+
await this.timerValue.fill(value);
|
|
2191
|
+
}
|
|
2192
|
+
async clickEighthPlacedElement() {
|
|
2193
|
+
await this.eighthPlacedElement.click();
|
|
2194
|
+
}
|
|
2195
|
+
async clickGlobalConnectToolButton() {
|
|
2196
|
+
await this.globalConnectToolButton.click({ timeout: 90000 });
|
|
2197
|
+
await (0, sleep_1.sleep)(1000);
|
|
2198
|
+
}
|
|
2199
|
+
async linkFormToStartEvent(formName) {
|
|
2200
|
+
await this.startEventElement.click({ timeout: 90000 });
|
|
2201
|
+
await (0, sleep_1.sleep)(1000);
|
|
2202
|
+
await this.embedForm(formName);
|
|
2203
|
+
}
|
|
2204
|
+
async expandPublicationSection() {
|
|
2205
|
+
const isExpanded = (await this.publicationSection
|
|
2206
|
+
.locator('.bio-properties-panel-group-header.open')
|
|
2207
|
+
.count()) > 0;
|
|
2208
|
+
if (!isExpanded) {
|
|
2209
|
+
await this.publicationSection.click({ timeout: 60000 });
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
async enablePublicAccessIfDisabled() {
|
|
2213
|
+
await this.expandPublicationSection();
|
|
2214
|
+
const isDisabled = (await this.publicAccessToggle.getAttribute('aria-checked')) === 'false';
|
|
2215
|
+
if (isDisabled) {
|
|
2216
|
+
await this.publicAccessToggle.focus();
|
|
2217
|
+
await this.page.waitForTimeout(500);
|
|
2218
|
+
await this.publicAccessToggle.press('Space');
|
|
2219
|
+
await this.page.waitForTimeout(2000);
|
|
2220
|
+
await (0, test_1.expect)(this.page.getByText('Public access enabled')).toBeVisible({
|
|
2221
|
+
timeout: 15000,
|
|
2222
|
+
});
|
|
2223
|
+
console.log('Public access toggle enabled successfully');
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
async clickPublicationTab() {
|
|
2227
|
+
await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.publicationTab, {
|
|
2228
|
+
postAction: async () => {
|
|
2229
|
+
await this.clickStartEventElement();
|
|
2230
|
+
},
|
|
2231
|
+
});
|
|
2232
|
+
}
|
|
2233
|
+
async clickCopyPublicLinkButton() {
|
|
2234
|
+
await this.copyPublicLinkButton.click({ timeout: 60000 });
|
|
2235
|
+
}
|
|
2236
|
+
async getPublicationLink() {
|
|
2237
|
+
await this.clickPublicationTab();
|
|
2238
|
+
await (0, test_1.expect)(this.copyPublicLinkButton).toBeVisible({ timeout: 60000 });
|
|
2239
|
+
// The design-system code block shows the link as text; its copy button is
|
|
2240
|
+
// a separate control, so read the <code> instead of the clipboard.
|
|
2241
|
+
const codeBlock = this.page.locator('[data-slot="code-block"]').first();
|
|
2242
|
+
if (await codeBlock.isVisible()) {
|
|
2243
|
+
const codeBlockLink = codeBlock.locator('code');
|
|
2244
|
+
// The publication tab polls for active links; wait for the URL to render.
|
|
2245
|
+
await (0, test_1.expect)(codeBlockLink).toContainText(/https?:\/\//, {
|
|
2246
|
+
timeout: 60000,
|
|
2247
|
+
});
|
|
2248
|
+
const link = (await codeBlockLink.innerText()).trim();
|
|
2249
|
+
(0, test_1.expect)(link).toMatch(/^https?:\/\//);
|
|
2250
|
+
console.log('Captured public link:', link);
|
|
2251
|
+
return link;
|
|
2252
|
+
}
|
|
2253
|
+
await this.clickCopyPublicLinkButton();
|
|
2254
|
+
await (0, sleep_1.sleep)(1000);
|
|
2255
|
+
const context = this.page.context();
|
|
2256
|
+
await context.grantPermissions(['clipboard-read']);
|
|
2257
|
+
const clipboardText = await this.page.evaluate(async () => {
|
|
2258
|
+
return await navigator.clipboard.readText();
|
|
2259
|
+
});
|
|
2260
|
+
console.log('Captured public link:', clipboardText);
|
|
2261
|
+
return clipboardText;
|
|
2262
|
+
}
|
|
2263
|
+
async assertFormEmbedded() {
|
|
2264
|
+
await (0, test_1.expect)(this.formLinkedSuccessMessage).toBeVisible({ timeout: 15000 });
|
|
2265
|
+
}
|
|
2266
|
+
async assertDiagramNameSet(diagramName) {
|
|
2267
|
+
await (0, test_1.expect)(this.diagramNameBreadcrumb(diagramName)).toBeVisible({
|
|
2268
|
+
timeout: 60000,
|
|
2269
|
+
});
|
|
2270
|
+
}
|
|
2271
|
+
}
|
|
2272
|
+
exports.ModelerCreatePage = ModelerCreatePage;
|