@camunda/e2e-test-suite 0.0.1329 → 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.
Files changed (167) hide show
  1. package/.github/c8_versions.json +1 -0
  2. package/README.md +1 -0
  3. package/dist/fixtures/8.11.d.ts +83 -0
  4. package/dist/fixtures/8.11.js +203 -0
  5. package/dist/pages/8.11/AppsPage.d.ts +60 -0
  6. package/dist/pages/8.11/AppsPage.js +1060 -0
  7. package/dist/pages/8.11/AuditLogPage.d.ts +14 -0
  8. package/dist/pages/8.11/AuditLogPage.js +69 -0
  9. package/dist/pages/8.11/Authorization.d.ts +44 -0
  10. package/dist/pages/8.11/Authorization.js +409 -0
  11. package/dist/pages/8.11/ClientCredentialsDetailsPage.d.ts +12 -0
  12. package/dist/pages/8.11/ClientCredentialsDetailsPage.js +36 -0
  13. package/dist/pages/8.11/ClusterDetailsPage.d.ts +107 -0
  14. package/dist/pages/8.11/ClusterDetailsPage.js +892 -0
  15. package/dist/pages/8.11/ClusterPage.d.ts +96 -0
  16. package/dist/pages/8.11/ClusterPage.js +657 -0
  17. package/dist/pages/8.11/ClusterSecretsPage.d.ts +48 -0
  18. package/dist/pages/8.11/ClusterSecretsPage.js +406 -0
  19. package/dist/pages/8.11/ConnectorMarketplacePage.d.ts +29 -0
  20. package/dist/pages/8.11/ConnectorMarketplacePage.js +156 -0
  21. package/dist/pages/8.11/ConnectorSettingsPage.d.ts +39 -0
  22. package/dist/pages/8.11/ConnectorSettingsPage.js +150 -0
  23. package/dist/pages/8.11/ConnectorTemplatePage.d.ts +11 -0
  24. package/dist/pages/8.11/ConnectorTemplatePage.js +34 -0
  25. package/dist/pages/8.11/ConsoleOrganizationPage.d.ts +77 -0
  26. package/dist/pages/8.11/ConsoleOrganizationPage.js +457 -0
  27. package/dist/pages/8.11/DataFiltersPage.d.ts +30 -0
  28. package/dist/pages/8.11/DataFiltersPage.js +135 -0
  29. package/dist/pages/8.11/FormJsPage.d.ts +38 -0
  30. package/dist/pages/8.11/FormJsPage.js +283 -0
  31. package/dist/pages/8.11/HomePage.d.ts +29 -0
  32. package/dist/pages/8.11/HomePage.js +176 -0
  33. package/dist/pages/8.11/IdpCreatePage.d.ts +118 -0
  34. package/dist/pages/8.11/IdpCreatePage.js +514 -0
  35. package/dist/pages/8.11/LoginPage.d.ts +45 -0
  36. package/dist/pages/8.11/LoginPage.js +214 -0
  37. package/dist/pages/8.11/ModelerCreatePage.d.ts +256 -0
  38. package/dist/pages/8.11/ModelerCreatePage.js +2272 -0
  39. package/dist/pages/8.11/ModelerHomePage.d.ts +100 -0
  40. package/dist/pages/8.11/ModelerHomePage.js +1168 -0
  41. package/dist/pages/8.11/ModelerUserInvitePage.d.ts +29 -0
  42. package/dist/pages/8.11/ModelerUserInvitePage.js +136 -0
  43. package/dist/pages/8.11/OCIdentityAuthorizationsPage.d.ts +11 -0
  44. package/dist/pages/8.11/OCIdentityAuthorizationsPage.js +25 -0
  45. package/dist/pages/8.11/OCIdentityClusterVariablesPage.d.ts +21 -0
  46. package/dist/pages/8.11/OCIdentityClusterVariablesPage.js +128 -0
  47. package/dist/pages/8.11/OCIdentityGroupsPage.d.ts +38 -0
  48. package/dist/pages/8.11/OCIdentityGroupsPage.js +176 -0
  49. package/dist/pages/8.11/OCIdentityHomePage.d.ts +21 -0
  50. package/dist/pages/8.11/OCIdentityHomePage.js +111 -0
  51. package/dist/pages/8.11/OCIdentityMappingRulesPage.d.ts +23 -0
  52. package/dist/pages/8.11/OCIdentityMappingRulesPage.js +124 -0
  53. package/dist/pages/8.11/OCIdentityRolesPage.d.ts +43 -0
  54. package/dist/pages/8.11/OCIdentityRolesPage.js +236 -0
  55. package/dist/pages/8.11/OperateHomePage.d.ts +28 -0
  56. package/dist/pages/8.11/OperateHomePage.js +150 -0
  57. package/dist/pages/8.11/OperateProcessInstancePage.d.ts +43 -0
  58. package/dist/pages/8.11/OperateProcessInstancePage.js +893 -0
  59. package/dist/pages/8.11/OperateProcessesPage.d.ts +28 -0
  60. package/dist/pages/8.11/OperateProcessesPage.js +153 -0
  61. package/dist/pages/8.11/OptimizeCollectionsPage.d.ts +30 -0
  62. package/dist/pages/8.11/OptimizeCollectionsPage.js +175 -0
  63. package/dist/pages/8.11/OptimizeDashboardPage.d.ts +11 -0
  64. package/dist/pages/8.11/OptimizeDashboardPage.js +71 -0
  65. package/dist/pages/8.11/OptimizeHomePage.d.ts +17 -0
  66. package/dist/pages/8.11/OptimizeHomePage.js +171 -0
  67. package/dist/pages/8.11/OptimizeReportPage.d.ts +49 -0
  68. package/dist/pages/8.11/OptimizeReportPage.js +184 -0
  69. package/dist/pages/8.11/OptimizeSharePage.d.ts +16 -0
  70. package/dist/pages/8.11/OptimizeSharePage.js +100 -0
  71. package/dist/pages/8.11/PlayPage.d.ts +17 -0
  72. package/dist/pages/8.11/PlayPage.js +157 -0
  73. package/dist/pages/8.11/ProcessApplicationPage.d.ts +32 -0
  74. package/dist/pages/8.11/ProcessApplicationPage.js +496 -0
  75. package/dist/pages/8.11/SettingsPage.d.ts +10 -0
  76. package/dist/pages/8.11/SettingsPage.js +53 -0
  77. package/dist/pages/8.11/SignUpPage.d.ts +42 -0
  78. package/dist/pages/8.11/SignUpPage.js +134 -0
  79. package/dist/pages/8.11/TaskDetailsPage.d.ts +77 -0
  80. package/dist/pages/8.11/TaskDetailsPage.js +324 -0
  81. package/dist/pages/8.11/TaskPanelPage.d.ts +26 -0
  82. package/dist/pages/8.11/TaskPanelPage.js +245 -0
  83. package/dist/pages/8.11/TaskProcessesPage.d.ts +18 -0
  84. package/dist/pages/8.11/TaskProcessesPage.js +134 -0
  85. package/dist/pages/8.11/UtilitiesPage.d.ts +56 -0
  86. package/dist/pages/8.11/UtilitiesPage.js +1024 -0
  87. package/dist/pages/8.11/WorkspaceMembersPage.d.ts +21 -0
  88. package/dist/pages/8.11/WorkspaceMembersPage.js +268 -0
  89. package/dist/tests/8.11/access-user-role-management.spec.d.ts +1 -0
  90. package/dist/tests/8.11/access-user-role-management.spec.js +487 -0
  91. package/dist/tests/8.11/agentic-ai-user-flows.spec.d.ts +1 -0
  92. package/dist/tests/8.11/agentic-ai-user-flows.spec.js +209 -0
  93. package/dist/tests/8.11/aws-cluster-user-flows.spec.d.ts +1 -0
  94. package/dist/tests/8.11/aws-cluster-user-flows.spec.js +188 -0
  95. package/dist/tests/8.11/aws-connectors-user-flows.spec.d.ts +1 -0
  96. package/dist/tests/8.11/aws-connectors-user-flows.spec.js +167 -0
  97. package/dist/tests/8.11/cluster-variables.spec.d.ts +1 -0
  98. package/dist/tests/8.11/cluster-variables.spec.js +202 -0
  99. package/dist/tests/8.11/connectors-user-flows.spec.d.ts +1 -0
  100. package/dist/tests/8.11/connectors-user-flows.spec.js +537 -0
  101. package/dist/tests/8.11/console-user-flows.spec.d.ts +1 -0
  102. package/dist/tests/8.11/console-user-flows.spec.js +199 -0
  103. package/dist/tests/8.11/hto-user-flows.spec.d.ts +1 -0
  104. package/dist/tests/8.11/hto-user-flows.spec.js +358 -0
  105. package/dist/tests/8.11/idp-user-flows.spec.d.ts +1 -0
  106. package/dist/tests/8.11/idp-user-flows.spec.js +316 -0
  107. package/dist/tests/8.11/login-negative-tests.spec.d.ts +1 -0
  108. package/dist/tests/8.11/login-negative-tests.spec.js +29 -0
  109. package/dist/tests/8.11/login.spec.d.ts +1 -0
  110. package/dist/tests/8.11/login.spec.js +29 -0
  111. package/dist/tests/8.11/navigation.spec.d.ts +1 -0
  112. package/dist/tests/8.11/navigation.spec.js +59 -0
  113. package/dist/tests/8.11/operate-access-flow.spec.d.ts +1 -0
  114. package/dist/tests/8.11/operate-access-flow.spec.js +136 -0
  115. package/dist/tests/8.11/optimize-agentic-control-panel-api.spec.d.ts +1 -0
  116. package/dist/tests/8.11/optimize-agentic-control-panel-api.spec.js +96 -0
  117. package/dist/tests/8.11/optimize-agentic-control-panel-ui.spec.d.ts +1 -0
  118. package/dist/tests/8.11/optimize-agentic-control-panel-ui.spec.js +69 -0
  119. package/dist/tests/8.11/optimize-api-tests.spec.d.ts +1 -0
  120. package/dist/tests/8.11/optimize-api-tests.spec.js +1194 -0
  121. package/dist/tests/8.11/optimize-collections-api.spec.d.ts +1 -0
  122. package/dist/tests/8.11/optimize-collections-api.spec.js +184 -0
  123. package/dist/tests/8.11/optimize-collections-ui.spec.d.ts +1 -0
  124. package/dist/tests/8.11/optimize-collections-ui.spec.js +46 -0
  125. package/dist/tests/8.11/optimize-data-filters-api.spec.d.ts +1 -0
  126. package/dist/tests/8.11/optimize-data-filters-api.spec.js +195 -0
  127. package/dist/tests/8.11/optimize-data-filters-ui.spec.d.ts +1 -0
  128. package/dist/tests/8.11/optimize-data-filters-ui.spec.js +306 -0
  129. package/dist/tests/8.11/optimize-exporter-filters-importer-e2e.spec.d.ts +1 -0
  130. package/dist/tests/8.11/optimize-exporter-filters-importer-e2e.spec.js +316 -0
  131. package/dist/tests/8.11/optimize-sharing-alerts-export-api.spec.d.ts +1 -0
  132. package/dist/tests/8.11/optimize-sharing-alerts-export-api.spec.js +337 -0
  133. package/dist/tests/8.11/optimize-sharing-alerts-export-ui.spec.d.ts +1 -0
  134. package/dist/tests/8.11/optimize-sharing-alerts-export-ui.spec.js +198 -0
  135. package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-audit-log.spec.d.ts +1 -0
  136. package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-audit-log.spec.js +146 -0
  137. package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-call-tools.spec.d.ts +1 -0
  138. package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-call-tools.spec.js +208 -0
  139. package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-e2e-flow.spec.d.ts +1 -0
  140. package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-e2e-flow.spec.js +151 -0
  141. package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-list-tools.spec.d.ts +1 -0
  142. package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-list-tools.spec.js +242 -0
  143. package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-cluster-tools.spec.d.ts +1 -0
  144. package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-cluster-tools.spec.js +75 -0
  145. package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-incident-tools.spec.d.ts +1 -0
  146. package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-incident-tools.spec.js +123 -0
  147. package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-user-task-tools.spec.d.ts +1 -0
  148. package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-user-task-tools.spec.js +151 -0
  149. package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-variable-tools.spec.d.ts +1 -0
  150. package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-variable-tools.spec.js +123 -0
  151. package/dist/tests/8.11/play.spec.d.ts +1 -0
  152. package/dist/tests/8.11/play.spec.js +93 -0
  153. package/dist/tests/8.11/rba-enabled-v2-user-flows.spec.d.ts +1 -0
  154. package/dist/tests/8.11/rba-enabled-v2-user-flows.spec.js +495 -0
  155. package/dist/tests/8.11/saas-migration-path-user-flows.spec.d.ts +1 -0
  156. package/dist/tests/8.11/saas-migration-path-user-flows.spec.js +133 -0
  157. package/dist/tests/8.11/smoke-tests.spec.d.ts +1 -0
  158. package/dist/tests/8.11/smoke-tests.spec.js +339 -0
  159. package/dist/tests/8.11/test-setup.spec.d.ts +1 -0
  160. package/dist/tests/8.11/test-setup.spec.js +256 -0
  161. package/dist/tests/8.11/web-modeler-user-flows.spec.d.ts +1 -0
  162. package/dist/tests/8.11/web-modeler-user-flows.spec.js +523 -0
  163. package/dist/utils/clusterVersions.d.ts +2 -1
  164. package/dist/utils/clusterVersions.js +1 -0
  165. package/dist/utils/consoleApiHelpers.js +1 -0
  166. package/package.json +1 -1
  167. package/playwright.config.ts +10 -0
@@ -0,0 +1,892 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ClusterDetailsPage = void 0;
4
+ const test_1 = require("@playwright/test");
5
+ const sleep_1 = require("../../utils/sleep");
6
+ const clickLocatorWithRetry_1 = require("../../utils/assertionHelpers/clickLocatorWithRetry");
7
+ const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
8
+ const ClientCredentialsDetailsPage_1 = require("./ClientCredentialsDetailsPage");
9
+ class ClusterDetailsPage {
10
+ page;
11
+ // Name of a client whose scopes still have to be checked against the
12
+ // clients list — see createAPIClient() / clickCloseModalButton().
13
+ pendingClientScopeCheck = null;
14
+ apiTab;
15
+ createFirstClientButton;
16
+ clientNameTextbox;
17
+ tasklistCheckbox;
18
+ secretsCheckbox;
19
+ optimizeCheckbox;
20
+ operateCheckbox;
21
+ createButton;
22
+ closeModalButton;
23
+ createClientButton;
24
+ settingsTab;
25
+ rbaEnableButton;
26
+ rbaDisableButton;
27
+ dialog;
28
+ deleteButton;
29
+ deleteSubButton;
30
+ createClientCredentialsDialog;
31
+ clientCredentialsDialog;
32
+ clustersLink;
33
+ alertsTab;
34
+ alertsList;
35
+ createFirstAlertButton;
36
+ createNewAlertButton;
37
+ emailRadioButton;
38
+ createAlertsDialog;
39
+ createAlertButton;
40
+ createNewClientButton;
41
+ clientsList;
42
+ clientsFilterInput;
43
+ envVarsTab;
44
+ zeebeCheckbox;
45
+ apiClientNameTextbox;
46
+ expandButton;
47
+ rbaEnabledMessage;
48
+ authorizationsHeading;
49
+ authorizationsSwitch;
50
+ orchestrationClusterCheckbox;
51
+ clientCredentialsLink;
52
+ reviewUpdateButton;
53
+ selectTargetVersionDialog;
54
+ nextButton;
55
+ targetVersionOption;
56
+ updateAvailableDialog;
57
+ updateButton;
58
+ mcpSupportToggle;
59
+ restartRequiredDialog;
60
+ restartConfirmButton;
61
+ mcpTab;
62
+ mcpConfigBlock;
63
+ constructor(page) {
64
+ this.page = page;
65
+ this.apiTab = page.getByRole('tab', { name: 'API' });
66
+ this.createFirstClientButton = page.getByRole('button', {
67
+ name: 'Create your first Client',
68
+ });
69
+ this.clientNameTextbox = page.getByRole('textbox', { name: 'Client Name' });
70
+ this.tasklistCheckbox = page
71
+ .getByRole('dialog')
72
+ .locator('label')
73
+ .filter({ hasText: 'Tasklist' });
74
+ this.optimizeCheckbox = page
75
+ .getByRole('dialog')
76
+ .locator('label')
77
+ .filter({ hasText: /^Optimize API$/ });
78
+ this.operateCheckbox = page
79
+ .getByRole('dialog')
80
+ .locator('label')
81
+ .filter({ hasText: 'Operate' });
82
+ this.secretsCheckbox = page
83
+ .getByRole('dialog')
84
+ .locator('label')
85
+ .filter({ hasText: /^Administration API - Resource: Secrets$/ });
86
+ this.createButton = page.getByRole('button', { name: 'Create', exact: true });
87
+ this.createClientButton = page.getByRole('button', {
88
+ name: 'Create new Client',
89
+ });
90
+ this.settingsTab = page.getByRole('tab', { name: 'Settings' });
91
+ this.rbaEnableButton = page.getByRole('button', { name: 'Enable' });
92
+ this.rbaDisableButton = page.getByRole('button', { name: 'Disable' });
93
+ this.dialog = page.getByRole('dialog');
94
+ this.deleteButton = page.getByRole('button', { name: 'Delete' });
95
+ this.deleteSubButton = page.getByRole('button', {
96
+ name: 'danger Delete',
97
+ });
98
+ this.createClientCredentialsDialog = page.getByRole('dialog', {
99
+ name: 'Create new client credentials',
100
+ });
101
+ // Use a content-based locator so the test stays robust if the dialog
102
+ // title is ever renamed in the Console UI.
103
+ this.clientCredentialsDialog = page.getByRole('dialog').filter({
104
+ has: page.getByText('The Client Secret will not be shown again.'),
105
+ });
106
+ // Hub's client-credentials dialog (design-system Dialog, not the old
107
+ // Carbon one) exposes its close affix as an accessible button named
108
+ // "Close" rather than via an aria-label picked up by getByLabel -- see
109
+ // camunda-hub's own e2e suite, ConsoleClusterDetailsPage.ts
110
+ // (clientCredentialsDialogCloseButton), which already uses this pattern.
111
+ this.closeModalButton = this.clientCredentialsDialog.getByRole('button', {
112
+ name: 'Close',
113
+ });
114
+ this.clustersLink = page
115
+ .getByRole('banner')
116
+ .getByRole('link', { name: 'Clusters' });
117
+ this.alertsTab = page.getByRole('tab', { name: 'Alerts' });
118
+ this.alertsList = page
119
+ .getByRole('row')
120
+ .filter({ hasNotText: 'Delivery method' }); //Filter out header row
121
+ this.createFirstAlertButton = page.getByRole('button', {
122
+ name: 'Create an alert',
123
+ });
124
+ this.createNewAlertButton = page.getByRole('button', {
125
+ name: 'Create new alert',
126
+ });
127
+ this.emailRadioButton = page.getByRole('radio', {
128
+ name: 'Email',
129
+ });
130
+ this.createAlertsDialog = page.getByRole('dialog', {
131
+ name: 'Create process incident alert',
132
+ });
133
+ this.createAlertButton = page.getByRole('button', {
134
+ name: 'Create alert',
135
+ exact: true,
136
+ });
137
+ this.createNewClientButton = page.getByRole('button', {
138
+ name: 'Create new client',
139
+ });
140
+ this.clientsList = page.getByRole('row').filter({ hasNotText: 'Scopes' });
141
+ // The clients table paginates at ten rows and is not ordered by creation
142
+ // time, so on a cluster that already has clients a newly created one is
143
+ // usually on a page other than the one being displayed -- matching a row
144
+ // without filtering first reports it as missing (main's filterClientsList
145
+ // existed for exactly this). "Filter table" was Carbon's default
146
+ // TableToolbarSearch label; Hub's rebranded panel renders a plain
147
+ // "Search" input instead, so match either.
148
+ this.clientsFilterInput = page
149
+ .getByRole('searchbox', { name: 'Filter table' })
150
+ .or(page.getByRole('searchbox', { name: 'Search' }))
151
+ .or(page.getByPlaceholder('Search'));
152
+ this.envVarsTab = this.clientCredentialsDialog.getByRole('tab', {
153
+ name: 'Env Vars',
154
+ });
155
+ this.zeebeCheckbox = page
156
+ .getByRole('dialog')
157
+ .locator('label')
158
+ .filter({ hasText: /^Zeebe$/ });
159
+ this.apiClientNameTextbox = page.getByRole('textbox', {
160
+ name: 'Client Name',
161
+ });
162
+ this.expandButton = page.locator('button[class="cds--table-expand__button"]');
163
+ this.rbaEnabledMessage = page.getByText('Authorizations enabled');
164
+ // Hub's design-system Settings tab: <button role="switch"
165
+ // aria-label="Switch Enable authorizations" aria-checked="true|false">
166
+ // (c4 C4Toggle). It has no Carbon `.cds--toggle__*` nodes. Same as 8.8.
167
+ this.authorizationsSwitch = this.page.getByRole('switch', {
168
+ name: /Enable authorizations/i,
169
+ });
170
+ this.authorizationsHeading = this.page.getByRole('heading', {
171
+ name: 'Authorizations',
172
+ });
173
+ this.orchestrationClusterCheckbox = page
174
+ .locator('label')
175
+ .filter({ hasText: /^Orchestration Cluster API$/ });
176
+ this.clientCredentialsLink = (clientCredentials) => page.getByRole('cell', { name: clientCredentials }).locator('a');
177
+ this.reviewUpdateButton = page.getByRole('button', { name: 'Review Update' });
178
+ this.selectTargetVersionDialog = page
179
+ .getByRole('dialog')
180
+ .filter({ hasText: 'Select target version' });
181
+ this.nextButton = this.selectTargetVersionDialog.getByRole('button', {
182
+ name: 'Next',
183
+ });
184
+ this.targetVersionOption = (version) => {
185
+ const escaped = version.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
186
+ // Match the version as a leading token: some options are suffixed with
187
+ // "(latest)" (or similar), others (e.g. in nightly runs) are not.
188
+ return this.selectTargetVersionDialog
189
+ .locator('label')
190
+ .filter({ hasText: new RegExp(`^${escaped}(\\s|$)`) });
191
+ };
192
+ this.updateAvailableDialog = page
193
+ .getByRole('dialog')
194
+ .filter({ hasText: 'Update available' });
195
+ this.updateButton = this.updateAvailableDialog.getByRole('button', {
196
+ name: 'Update',
197
+ });
198
+ this.mcpSupportToggle = page.getByRole('switch', {
199
+ name: /Enable MCP Support/i,
200
+ });
201
+ this.restartRequiredDialog = page
202
+ .getByRole('dialog')
203
+ .filter({ hasText: 'Restart required' });
204
+ this.restartConfirmButton = this.restartRequiredDialog.getByRole('button', {
205
+ name: 'Continue',
206
+ });
207
+ this.mcpTab = page.getByRole('tab', { name: 'MCP' });
208
+ // The config text renders in a <pre> inside the MCP-labelled panel, not
209
+ // a textbox -- matches the already-working 8.9 sibling's locator. A live
210
+ // trace confirmed "Copy to clipboard" is actually the aria-label/title of
211
+ // an unrelated icon-only <button> positioned over that block, which is
212
+ // why getByRole('textbox', {name: 'Copy to clipboard'}) always found
213
+ // nothing here.
214
+ this.mcpConfigBlock = page.getByLabel('MCP', { exact: true }).locator('pre');
215
+ }
216
+ async clickAPITab() {
217
+ await (0, test_1.expect)(this.apiTab).toBeVisible({ timeout: 60000 });
218
+ await this.apiTab.click({ timeout: 60000 });
219
+ }
220
+ async dismissOopsIfPresent() {
221
+ // The clients list panel sometimes lands in a Carbon "Oops ... something
222
+ // went wrong." state when a background ClustersService request fails on
223
+ // SaaS INT. The panel replaces the create-client button, so any click
224
+ // attempt will time out until the user clicks the inline Reload button.
225
+ const oopsHeading = this.page.getByRole('heading', { name: /Oops/i });
226
+ if (!(await oopsHeading.isVisible({ timeout: 1000 }).catch(() => false))) {
227
+ return;
228
+ }
229
+ const reloadButton = this.page.getByRole('button', {
230
+ name: 'Reload',
231
+ exact: true,
232
+ });
233
+ if (await reloadButton.isVisible({ timeout: 1000 }).catch(() => false)) {
234
+ await reloadButton.click({ timeout: 15000 }).catch(() => { });
235
+ }
236
+ else {
237
+ await this.page.reload();
238
+ }
239
+ await this.page.waitForLoadState('domcontentloaded');
240
+ }
241
+ async clickCreateClientButton() {
242
+ await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.createFirstClientButton.or(this.createNewClientButton), {
243
+ preAction: async () => {
244
+ await this.dismissOopsIfPresent();
245
+ },
246
+ });
247
+ }
248
+ async clickClientNameTextbox() {
249
+ await this.clientNameTextbox.click({ timeout: 60000 });
250
+ }
251
+ async fillClientNameTextbox(name) {
252
+ await this.clientNameTextbox.fill(name, { timeout: 60000 });
253
+ }
254
+ async clickTasklistCheckbox() {
255
+ await this.tasklistCheckbox.click({ timeout: 60000 });
256
+ }
257
+ async checkSecretsCheckbox() {
258
+ if (!(await this.secretsCheckbox.isChecked())) {
259
+ await this.secretsCheckbox.click();
260
+ }
261
+ }
262
+ async clickOperateCheckbox() {
263
+ await this.operateCheckbox.click({ timeout: 60000 });
264
+ }
265
+ async clickOptimizeCheckbox() {
266
+ await this.optimizeCheckbox.click({ timeout: 60000 });
267
+ }
268
+ async clickCreateButton() {
269
+ await this.createButton.click({ timeout: 60000 });
270
+ }
271
+ async clickCloseModalButton() {
272
+ await this.closeModalButton.click({ timeout: 60000 });
273
+ const pendingClient = this.pendingClientScopeCheck;
274
+ if (pendingClient === null) {
275
+ return;
276
+ }
277
+ this.pendingClientScopeCheck = null;
278
+ await this.assertAPIClientScopes(pendingClient);
279
+ }
280
+ // Asserts the scopes an API client was created with, read from its row in
281
+ // the clients list. Only meaningful once the credentials modal is closed:
282
+ // while it is open the panel behind it can still be showing its pre-create
283
+ // state and lists no row for the new client at all.
284
+ async assertAPIClientScopes(name) {
285
+ const row = this.clientsList.filter({ hasText: name });
286
+ const scopes = /(?=.*Orchestration)(?=.*Optimize)(?=.*Secrets)/;
287
+ const maxAttempts = 3;
288
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
289
+ try {
290
+ // The table paginates and isn't ordered by creation time, so a newly
291
+ // created client is usually on a page other than the one displayed --
292
+ // filter down to it first, the same way main's filterClientsList did,
293
+ // rather than matching rows only on the currently rendered page.
294
+ await (0, test_1.expect)(this.clientsFilterInput).toBeVisible({ timeout: 60000 });
295
+ await this.clientsFilterInput.fill(name);
296
+ await (0, test_1.expect)(row).toContainText(scopes, { timeout: 60000 });
297
+ return;
298
+ }
299
+ catch (error) {
300
+ if (attempt === maxAttempts) {
301
+ throw error;
302
+ }
303
+ // A panel that rendered before the client existed — or that failed
304
+ // into the "Oops ... something went wrong." state — only picks the
305
+ // new client up on a refetch, which is what reloading the API tab
306
+ // forces. A single reload isn't always enough on a nightly cluster
307
+ // this suite reuses across parallel test workers, so retry more
308
+ // than once before failing the test.
309
+ console.warn(`assertAPIClientScopes: "${name}" is not listed yet (attempt ${attempt}/${maxAttempts}); reloading the API tab and retrying. ${error}`);
310
+ await this.dismissOopsIfPresent();
311
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
312
+ await this.clickAPITab();
313
+ }
314
+ }
315
+ }
316
+ async clickSettingsTab() {
317
+ // Console paints the cluster-details tab list before it finishes
318
+ // hydrating it, so a click that lands in that window is accepted by
319
+ // Playwright but swallowed by React: the page silently stays on
320
+ // Overview and the caller's next wait (the Authorizations heading in
321
+ // `disableAuthorizations`) burns its full 60s on a tab that was never
322
+ // opened. Re-click until the tab reports itself selected.
323
+ await (0, test_1.expect)(async () => {
324
+ await this.settingsTab.click({ timeout: 60000 });
325
+ await (0, test_1.expect)(this.settingsTab).toHaveAttribute('aria-selected', 'true', {
326
+ timeout: 10000,
327
+ });
328
+ }).toPass({ timeout: 120000, intervals: [1000, 2000, 5000] });
329
+ }
330
+ // The Settings panel body is fetched separately from the tab list, so a
331
+ // selected Settings tab does not guarantee the Authorizations section is
332
+ // there: when that fetch fails -- or Console lands on its hard-crash banner
333
+ // ("An error has occurred") on the way in -- the section never renders, and
334
+ // neither state recovers on its own. A flat 60s wait can then only time out.
335
+ // Reload and re-open Settings between attempts, which is the same recovery
336
+ // `clickSettingsTab` already applies to the tab itself.
337
+ async waitForAuthorizationsSection() {
338
+ await (0, test_1.expect)(async () => {
339
+ const rendered = await this.authorizationsHeading
340
+ .waitFor({ state: 'visible', timeout: 60000 })
341
+ .then(() => true)
342
+ .catch(() => false);
343
+ if (rendered) {
344
+ return;
345
+ }
346
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
347
+ await this.clickSettingsTab();
348
+ await (0, test_1.expect)(this.authorizationsHeading).toBeVisible({ timeout: 60000 });
349
+ }).toPass({ timeout: 300000, intervals: [1000, 2000, 5000] });
350
+ }
351
+ // Drives the design-system Authorizations switch. Returns false when this
352
+ // shell does not render one, so the caller falls through to the legacy
353
+ // Carbon toggle.
354
+ async setAuthorizationsViaSwitch(enabled) {
355
+ const hasSwitch = await this.authorizationsSwitch
356
+ .waitFor({ state: 'visible', timeout: 10000 })
357
+ .then(() => true)
358
+ .catch(() => false);
359
+ if (!hasSwitch) {
360
+ return false;
361
+ }
362
+ const isOn = (await this.authorizationsSwitch.getAttribute('aria-checked')) === 'true';
363
+ if (isOn === enabled) {
364
+ return true;
365
+ }
366
+ await this.authorizationsSwitch.click({ timeout: 30000 });
367
+ const confirmOpened = await this.dialog
368
+ .waitFor({ state: 'visible', timeout: 15000 })
369
+ .then(() => true)
370
+ .catch(() => false);
371
+ if (confirmOpened) {
372
+ const confirm = enabled ? this.rbaEnableButton : this.rbaDisableButton;
373
+ await confirm.click({ timeout: 30000 });
374
+ await (0, test_1.expect)(this.page.getByText(enabled ? 'Enabling...' : 'Disabling...')).not.toBeVisible({ timeout: 60000 });
375
+ }
376
+ await (0, test_1.expect)(this.authorizationsSwitch).toHaveAttribute('aria-checked', String(enabled), { timeout: 120000 });
377
+ return true;
378
+ }
379
+ async enableAuthorizations() {
380
+ await (0, sleep_1.sleep)(5000);
381
+ await this.waitForAuthorizationsSection();
382
+ if (await this.setAuthorizationsViaSwitch(true)) {
383
+ return;
384
+ }
385
+ // Locate all elements with class .cds--toggle__text
386
+ const toggleTextElements = await this.page.$$('.cds--toggle__text');
387
+ // Check if toggleTextElements has at least 2 elements
388
+ if (toggleTextElements.length >= 2) {
389
+ // Get the text content of the second toggle text element
390
+ const toggleText = await toggleTextElements[1].textContent();
391
+ // Check if the text content is 'Disabled'
392
+ if (toggleText === 'Disabled') {
393
+ // Locate all elements with class .cds--toggle__switch
394
+ const toggleSwitchElements = await this.page.$$('.cds--toggle__switch');
395
+ // Check if toggleSwitchElements has at least 2 elements
396
+ if (toggleSwitchElements.length >= 2) {
397
+ // Click the second toggle switch element
398
+ await toggleSwitchElements[1].click();
399
+ if (await this.dialog.isVisible({ timeout: 15000 })) {
400
+ await this.rbaEnableButton.click({ timeout: 30000 });
401
+ await (0, test_1.expect)(this.page.getByText('Enabling...')).not.toBeVisible({
402
+ timeout: 60000,
403
+ });
404
+ }
405
+ console.log('Second toggle switch clicked.');
406
+ }
407
+ else {
408
+ console.log('Second toggle switch not found or less than 2.');
409
+ }
410
+ }
411
+ else {
412
+ console.log("Second toggle text does not contain 'Disabled'.");
413
+ }
414
+ }
415
+ else {
416
+ // Was a console.log that returned as though authorizations had been
417
+ // enabled; under Hub this branch ran every time (8.8 fix 7d771aa).
418
+ throw new Error('Could not enable authorizations: the Settings tab rendered neither ' +
419
+ 'the design-system "Enable authorizations" switch nor a Carbon ' +
420
+ 'toggle pair.');
421
+ }
422
+ }
423
+ async disableAuthorizations() {
424
+ await this.waitForAuthorizationsSection();
425
+ if (await this.setAuthorizationsViaSwitch(false)) {
426
+ return;
427
+ }
428
+ // Locate all elements with class .cds--toggle__text
429
+ const toggleTextElements = await this.page.$$('.cds--toggle__text');
430
+ // Check if toggleTextElements has at least 2 elements
431
+ if (toggleTextElements.length >= 2) {
432
+ // Get the text content of the second toggle text element
433
+ const toggleText = await toggleTextElements[1].textContent();
434
+ // Check if the text content is 'Enabled'
435
+ if (toggleText === 'Enabled') {
436
+ // Locate all elements with class .cds--toggle__switch
437
+ const toggleSwitchElements = await this.page.$$('.cds--toggle__switch');
438
+ // Check if toggleSwitchElements has at least 2 elements
439
+ if (toggleSwitchElements.length >= 2) {
440
+ // Click the second toggle switch element
441
+ await toggleSwitchElements[1].click();
442
+ console.log('Second toggle switch clicked.');
443
+ }
444
+ else {
445
+ console.log('Second toggle switch not found or less than 2.');
446
+ }
447
+ }
448
+ else {
449
+ console.log("Second toggle text does not contain 'Enabled'.");
450
+ }
451
+ }
452
+ else {
453
+ throw new Error('Could not disable authorizations: the Settings tab rendered neither ' +
454
+ 'the design-system "Enable authorizations" switch nor a Carbon ' +
455
+ 'toggle pair.');
456
+ }
457
+ }
458
+ async searchAndClickClientCredentialsLink(name) {
459
+ await (0, test_1.expect)(this.clientsList.first()).toBeVisible({ timeout: 60000 });
460
+ const clientLink = this.clientCredentialsLink(name);
461
+ await (0, test_1.expect)(clientLink).toBeVisible({ timeout: 30000 });
462
+ await clientLink.click();
463
+ const clientCredentialsDetailsPage = new ClientCredentialsDetailsPage_1.ClientCredentialsDetailsPage(this.page);
464
+ await clientCredentialsDetailsPage.isOpen(name);
465
+ return clientCredentialsDetailsPage;
466
+ }
467
+ async deleteAPIClientsIfExist(name) {
468
+ if (name) {
469
+ const row = this.clientsList.filter({ hasText: name });
470
+ const deleteButton = row.getByRole('button', { name: 'Delete' });
471
+ try {
472
+ await (0, test_1.expect)(deleteButton).toBeVisible({ timeout: 10000 });
473
+ await deleteButton.click();
474
+ await (0, test_1.expect)(this.dialog).toBeVisible();
475
+ await this.deleteSubButton.click();
476
+ await (0, test_1.expect)(this.page.getByText('Deleting...')).not.toBeVisible({
477
+ timeout: 10000,
478
+ });
479
+ await (0, test_1.expect)(row).not.toBeVisible();
480
+ }
481
+ catch (error) {
482
+ console.warn(`No client row found for ${name} or deletion failed: ${error}`);
483
+ }
484
+ return;
485
+ }
486
+ await this.doDelete(this.dialog, 'API clients');
487
+ }
488
+ async clickAlertsTab() {
489
+ await (0, test_1.expect)(this.alertsTab).toBeVisible({ timeout: 40000 });
490
+ await this.alertsTab.click();
491
+ }
492
+ async clickExpandButton() {
493
+ await this.expandButton.click({ timeout: 60000 });
494
+ }
495
+ async clickCreateFirstAlertButton() {
496
+ await (0, test_1.expect)(this.createFirstAlertButton).toBeVisible({ timeout: 40000 });
497
+ await this.createFirstAlertButton.click();
498
+ }
499
+ async clickCreateNewAlertButton() {
500
+ await (0, test_1.expect)(this.createNewAlertButton).toBeVisible({ timeout: 60000 });
501
+ await this.createNewAlertButton.click();
502
+ await (0, test_1.expect)(this.page.getByText('Creating...')).not.toBeVisible({
503
+ timeout: 60000,
504
+ });
505
+ }
506
+ async createAlert(isFirstAlert = true) {
507
+ if (isFirstAlert) {
508
+ await this.clickCreateFirstAlertButton();
509
+ }
510
+ else {
511
+ await this.clickCreateNewAlertButton();
512
+ }
513
+ await (0, test_1.expect)(this.createAlertsDialog).toBeVisible();
514
+ await this.selectEmailRadioButton();
515
+ await this.clickCreateAlertButton();
516
+ }
517
+ async selectEmailRadioButton() {
518
+ await (0, test_1.expect)(this.emailRadioButton).toBeVisible({ timeout: 60000 });
519
+ await this.emailRadioButton.click({ force: true });
520
+ }
521
+ async clickCreateAlertButton() {
522
+ await (0, test_1.expect)(this.createAlertButton).toBeVisible({ timeout: 60000 });
523
+ await this.createAlertButton.click();
524
+ await (0, test_1.expect)(this.page.getByText('Creating...')).not.toBeVisible({
525
+ timeout: 60000,
526
+ });
527
+ }
528
+ async deleteAlerts() {
529
+ await this.doDelete(this.dialog, 'Alerts');
530
+ }
531
+ async doDelete(dialog, text) {
532
+ try {
533
+ await (0, test_1.expect)(this.deleteButton.first()).toBeVisible({
534
+ timeout: 10000,
535
+ });
536
+ }
537
+ catch (error) {
538
+ return; //No items found in the list
539
+ }
540
+ try {
541
+ let deletes = await this.deleteButton.all();
542
+ while (deletes.length > 0) {
543
+ const deleteButton = deletes[0];
544
+ if (await deleteButton.isVisible()) {
545
+ await deleteButton.click({ timeout: 60000 });
546
+ await (0, test_1.expect)(dialog).toBeVisible({ timeout: 40000 });
547
+ await this.deleteSubButton.click();
548
+ await (0, test_1.expect)(this.page.getByText('Deleting...')).not.toBeVisible({
549
+ timeout: 60000,
550
+ });
551
+ }
552
+ await (0, sleep_1.sleep)(3000);
553
+ deletes = await this.deleteButton.all();
554
+ }
555
+ await (0, test_1.expect)(this.deleteButton).not.toBeVisible({
556
+ timeout: 30000,
557
+ });
558
+ }
559
+ catch (error) {
560
+ console.error(`Error during ${text} deletion: `, error);
561
+ }
562
+ }
563
+ // This poll reloads the cluster-details page for minutes on end, which is a
564
+ // prime window for the Console SPA to drop its own session: auth0-spa-js
565
+ // calls `/v2/logout` when a silent token renewal fails, and the tab then
566
+ // lands on the identity provider's login form. From that point on every
567
+ // reload only re-renders that form, so the component status can never
568
+ // appear again and all 7 attempts are spent on a login page.
569
+ // `recoverSession` is supplied by the caller (which knows the credentials);
570
+ // it re-authenticates and returns the tab to this cluster's details page so
571
+ // the health assertion itself is retried unchanged.
572
+ async assertComponentsHealth(components = [
573
+ 'Zeebe',
574
+ 'Tasklist',
575
+ 'Operate',
576
+ 'Optimize',
577
+ 'Admin',
578
+ ], recoverSession) {
579
+ for (const component of components) {
580
+ await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.page.getByText(`${component}Healthy`, { exact: true }), {
581
+ visibilityTimeout: 60000,
582
+ totalTimeout: 400000,
583
+ maxRetries: 7,
584
+ preAction: async () => {
585
+ if (recoverSession && this.isSessionLost()) {
586
+ await recoverSession();
587
+ return;
588
+ }
589
+ await this.page.reload();
590
+ },
591
+ });
592
+ }
593
+ }
594
+ // True when the tab has been bounced to the identity provider
595
+ // (`weblogin.` / `login.` / `auth.` hosts), i.e. the Console session is
596
+ // gone and no amount of reloading will bring the cluster page back.
597
+ isSessionLost() {
598
+ try {
599
+ return /^(weblogin|login|auth)\./.test(new URL(this.page.url()).host);
600
+ }
601
+ catch {
602
+ return false;
603
+ }
604
+ }
605
+ async createAPIClientAndReturnVariables(name, setEnvVariables = true, clusterType) {
606
+ await this.createAPIClient(name);
607
+ await this.clickEnvVarsButton();
608
+ const variables = {
609
+ zeebeAuthUrl: await this.clientCredentialsText(/export ZEEBE_AUTHORIZATION_SERVER_URL='([^']+)'/),
610
+ zeebeClientId: await this.clientCredentialsText(/export ZEEBE_CLIENT_ID='([^']+)'/),
611
+ zeebeClientSecret: await this.clientCredentialsText(/export ZEEBE_CLIENT_SECRET='([^']+)'/),
612
+ zeebeUrl: await this.clientCredentialsText(/export ZEEBE_REST_ADDRESS='([^']+)'/),
613
+ tokenAudience: await this.clientCredentialsText(/export ZEEBE_TOKEN_AUDIENCE='([^']+)'/),
614
+ optimizeBaseUrl: await this.clientCredentialsText(/export CAMUNDA_OPTIMIZE_BASE_URL='([^']+)'/),
615
+ };
616
+ if (setEnvVariables) {
617
+ if (clusterType) {
618
+ // Use cluster-specific suffixed env vars
619
+ const suffix = clusterType.toUpperCase().replace(/[\s-]/g, '_');
620
+ process.env[`ZEEBE_API_CLIENT_ID_${suffix}`] = variables.zeebeClientId;
621
+ process.env[`ZEEBE_API_CLIENT_SECRET_${suffix}`] =
622
+ variables.zeebeClientSecret;
623
+ process.env[`ZEEBE_API_AUTH_URL_${suffix}`] = variables.zeebeAuthUrl;
624
+ process.env[`ZEEBE_API_URL_${suffix}`] = variables.zeebeUrl;
625
+ process.env[`ZEEBE_API_TOKEN_AUDIENCE_${suffix}`] =
626
+ variables.tokenAudience;
627
+ process.env[`CAMUNDA_OPTIMIZE_BASE_URL_${suffix}`] =
628
+ variables.optimizeBaseUrl;
629
+ console.log(`[ClusterDetailsPage] Set credentials for cluster type: ${clusterType}`);
630
+ }
631
+ else {
632
+ process.env.ZEEBE_API_CLIENT_ID = variables.zeebeClientId;
633
+ process.env.ZEEBE_API_CLIENT_SECRET = variables.zeebeClientSecret;
634
+ process.env.ZEEBE_API_AUTH_URL = variables.zeebeAuthUrl;
635
+ process.env.ZEEBE_API_URL = variables.zeebeUrl;
636
+ process.env.ZEEBE_API_TOKEN_AUDIENCE = variables.tokenAudience;
637
+ process.env.CAMUNDA_OPTIMIZE_BASE_URL = variables.optimizeBaseUrl;
638
+ process.env.OPTIMIZE_API_TOKEN_AUDIENCE = 'optimize.ultrawombat.com';
639
+ }
640
+ }
641
+ return variables;
642
+ }
643
+ async createAPIClient(name) {
644
+ const maxRetries = 3;
645
+ for (let attempt = 0; attempt < maxRetries; attempt++) {
646
+ // Use a suffixed name on retries so duplicate-name validation never
647
+ // leaves the Create button permanently disabled. A prior attempt may
648
+ // have created the client before we could detect the credentials dialog.
649
+ const attemptName = attempt === 0 ? name : `${name}-r${attempt}`;
650
+ try {
651
+ await this.clickCreateClientButton();
652
+ await (0, test_1.expect)(this.createClientCredentialsDialog).toBeVisible({
653
+ timeout: 30000,
654
+ });
655
+ await this.fillAPIClientName(attemptName);
656
+ await this.checkOrchestrationClusterCheckbox();
657
+ await this.checkOptimizeCheckbox();
658
+ await this.checkSecretsCheckbox();
659
+ await this.clickCreateButton();
660
+ // The POST behind Create occasionally returns "fetch error" — the
661
+ // create dialog stays open with an in-modal "Error fetch error"
662
+ // banner and the success ("Client credentials" / "The Client
663
+ // Secret will not be shown again.") dialog never appears. Detect
664
+ // that state and retry instead of burning 60s on a visibility
665
+ // assertion that will never resolve.
666
+ const credentialsShown = await this.clientCredentialsDialog
667
+ .isVisible({ timeout: 30000 })
668
+ .catch(() => false);
669
+ if (!credentialsShown) {
670
+ const stuckCreateDialog = await this.createClientCredentialsDialog
671
+ .isVisible({ timeout: 500 })
672
+ .catch(() => false);
673
+ const fetchError = stuckCreateDialog
674
+ ? await this.createClientCredentialsDialog
675
+ .getByText(/fetch error/i)
676
+ .isVisible({ timeout: 500 })
677
+ .catch(() => false)
678
+ : false;
679
+ if (stuckCreateDialog && fetchError) {
680
+ throw new Error('createAPIClient: create dialog stuck with "fetch error"');
681
+ }
682
+ // Not the fetch-error path — fall through to the original
683
+ // visibility expectation so the failure surface stays informative.
684
+ await (0, test_1.expect)(this.clientCredentialsDialog).toBeVisible({
685
+ timeout: 30000,
686
+ });
687
+ }
688
+ await (0, test_1.expect)(this.clientCredentialsDialog
689
+ .getByText('The Client Secret will not be shown again.')
690
+ .first()).toBeVisible();
691
+ // The client now exists — the modal above is proof — so the scopes it
692
+ // was created with are checked in clickCloseModalButton() rather than
693
+ // here. The clients list behind the open modal is not a reliable
694
+ // source for that check: it can still be rendering its pre-create
695
+ // state (no row for this client) or have failed into "Oops ...
696
+ // something went wrong.", and the modal blocks the pointer events a
697
+ // reload would need. Asserting it here instead sent a created client
698
+ // round the retry loop, which both left orphan clients behind and
699
+ // discarded the credentials the caller has yet to read.
700
+ this.pendingClientScopeCheck = attemptName;
701
+ return;
702
+ }
703
+ catch (error) {
704
+ if (attempt < maxRetries - 1) {
705
+ console.warn(`createAPIClient attempt ${attempt + 1} for "${name}" failed: ${error}; cancelling any stuck dialog and reloading.`);
706
+ // Cancel the stuck create dialog if it's still open, then reload
707
+ // the API tab so the next attempt starts from a clean state.
708
+ const cancel = this.createClientCredentialsDialog.getByRole('button', { name: 'Cancel' });
709
+ if (await cancel.isVisible({ timeout: 500 }).catch(() => false)) {
710
+ await cancel.click({ timeout: 5000 }).catch(() => { });
711
+ }
712
+ await this.page.keyboard.press('Escape').catch(() => { });
713
+ await this.page
714
+ .reload({ waitUntil: 'domcontentloaded' })
715
+ .catch(() => { });
716
+ // The API tab needs to be re-selected after reload.
717
+ await this.clickAPITab().catch(() => { });
718
+ }
719
+ else {
720
+ throw new Error(`Creating API client "${name}" failed after ${maxRetries} attempts: ${error}`);
721
+ }
722
+ }
723
+ }
724
+ }
725
+ async clickEnvVarsButton() {
726
+ await (0, test_1.expect)(this.envVarsTab).toBeVisible({ timeout: 40000 });
727
+ await this.envVarsTab.click();
728
+ }
729
+ async clientCredentialsText(regex) {
730
+ const innerText = await this.clientCredentialsDialog.innerText();
731
+ const match = innerText.match(regex);
732
+ if (match && match[1]) {
733
+ return match[1];
734
+ }
735
+ else {
736
+ throw new Error(`No client credentials found by the regex expression ${regex}`);
737
+ }
738
+ }
739
+ async checkTasklistCheckbox() {
740
+ if (!(await this.tasklistCheckbox.isChecked())) {
741
+ await this.tasklistCheckbox.click();
742
+ }
743
+ }
744
+ async checkOptimizeCheckbox() {
745
+ if (!(await this.optimizeCheckbox.isChecked())) {
746
+ await this.optimizeCheckbox.click();
747
+ }
748
+ }
749
+ async checkOperateCheckbox() {
750
+ if (!(await this.operateCheckbox.isChecked())) {
751
+ await this.operateCheckbox.click();
752
+ }
753
+ }
754
+ async checkZeebeCheckbox() {
755
+ if (!(await this.zeebeCheckbox.isChecked())) {
756
+ await this.zeebeCheckbox.click();
757
+ }
758
+ }
759
+ async fillAPIClientName(name) {
760
+ const maxRetries = 3;
761
+ for (let attempt = 1; attempt <= maxRetries; attempt++) {
762
+ try {
763
+ await (0, sleep_1.sleep)(1000);
764
+ await (0, test_1.expect)(this.apiClientNameTextbox).toBeVisible({ timeout: 60000 });
765
+ await this.apiClientNameTextbox.click();
766
+ await this.apiClientNameTextbox.fill(name);
767
+ const inputValue = await this.apiClientNameTextbox.inputValue();
768
+ if (inputValue === name) {
769
+ return;
770
+ }
771
+ console.log(`Attempt ${attempt}: Value input not filled correctly. Expected: "${name}", Got: "${inputValue}"`);
772
+ }
773
+ catch (error) {
774
+ console.log(`Attempt ${attempt}: Error filling value input:`, error);
775
+ }
776
+ if (attempt < maxRetries) {
777
+ await this.apiClientNameTextbox.clear();
778
+ }
779
+ }
780
+ throw new Error(`Failed to fill value input after ${maxRetries} attempts`);
781
+ }
782
+ async assertAlertText(text, timeout = 60000, maxRetries = 10) {
783
+ for (let attempt = 0; attempt < maxRetries; attempt++) {
784
+ try {
785
+ await (0, test_1.expect)(this.alertsList.nth(1)).toContainText(text, { timeout });
786
+ return;
787
+ }
788
+ catch (error) {
789
+ if (attempt < maxRetries - 1) {
790
+ console.warn(`Attempt ${attempt + 1} failed for asserting ${text}. Retrying...`);
791
+ await this.page.reload();
792
+ await (0, sleep_1.sleep)(20000);
793
+ }
794
+ else {
795
+ throw new Error(`Assertion failed after ${maxRetries} attempts`);
796
+ }
797
+ }
798
+ }
799
+ }
800
+ async checkOrchestrationClusterCheckbox() {
801
+ if (!(await this.orchestrationClusterCheckbox.isChecked())) {
802
+ await this.orchestrationClusterCheckbox.click();
803
+ }
804
+ }
805
+ async clickReviewUpdateButton() {
806
+ await this.reviewUpdateButton.click({ timeout: 60000 });
807
+ }
808
+ async performClusterUpdate(targetVersion) {
809
+ await this.clickReviewUpdateButton();
810
+ // When multiple target generations are available, Console inserts a
811
+ // "Select target version" step before "Update available". The desired
812
+ // version is otherwise not guaranteed to be the pre-selected one, so
813
+ // pick it explicitly before proceeding.
814
+ const hasTargetVersionStep = await this.selectTargetVersionDialog
815
+ .waitFor({ state: 'visible', timeout: 10000 })
816
+ .then(() => true)
817
+ .catch(() => false);
818
+ if (hasTargetVersionStep) {
819
+ const version = targetVersion ?? process.env.CLUSTER_VERSION;
820
+ if (version) {
821
+ await this.targetVersionOption(version).click({ timeout: 30000 });
822
+ }
823
+ await this.nextButton.click({ timeout: 60000 });
824
+ }
825
+ await (0, test_1.expect)(this.updateAvailableDialog).toBeVisible({ timeout: 30000 });
826
+ await this.updateButton.click({ timeout: 60000 });
827
+ }
828
+ async checkMcpSupportToggle() {
829
+ if (!(await this.mcpSupportToggle.isVisible())) {
830
+ throw new Error('MCP Support toggle is not visible');
831
+ }
832
+ // Only click if not already enabled to avoid disabling on reruns
833
+ if (!(await this.mcpSupportToggle.isChecked())) {
834
+ await this.mcpSupportToggle.click({ force: true });
835
+ // Enabling MCP support restarts the cluster, so Console now surfaces a
836
+ // "Restart required" confirmation dialog. The setting is only applied
837
+ // (and the toggle only commits to checked) once it is confirmed.
838
+ await (0, test_1.expect)(this.restartConfirmButton).toBeVisible({ timeout: 30000 });
839
+ await this.restartConfirmButton.click();
840
+ }
841
+ await (0, test_1.expect)(this.mcpSupportToggle).toBeChecked({ timeout: 60000 });
842
+ }
843
+ async clickMCPTab() {
844
+ await (0, test_1.expect)(this.mcpTab).toBeVisible({ timeout: 60000 });
845
+ await this.mcpTab.click();
846
+ }
847
+ async getMcpConfigurationText() {
848
+ // CI (PR #3629, "Create Agentic Orchestration Cluster") showed the MCP
849
+ // panel's config block still not rendered 60s after clickMCPTab()
850
+ // reported a successful click -- the same "click landed but the panel
851
+ // never switched" race already seen on the Connector Secrets tab.
852
+ // Re-click the tab and retry rather than failing on the first miss.
853
+ const maxAttempts = 3;
854
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
855
+ try {
856
+ await (0, test_1.expect)(this.mcpConfigBlock).toBeVisible({ timeout: 60000 });
857
+ return await this.mcpConfigBlock.innerText();
858
+ }
859
+ catch (error) {
860
+ if (attempt === maxAttempts) {
861
+ throw error;
862
+ }
863
+ console.warn(`getMcpConfigurationText: MCP panel did not render (attempt ${attempt}/${maxAttempts}); re-clicking the MCP tab and retrying. ${error}`);
864
+ await this.clickMCPTab();
865
+ }
866
+ }
867
+ throw new Error('getMcpConfigurationText: unreachable');
868
+ }
869
+ async createMCPClientAndReturnVariables(name, setEnvVariables = true) {
870
+ await this.createAPIClient(name);
871
+ await this.clickMCPTab();
872
+ const mcpConfigText = await this.getMcpConfigurationText();
873
+ const mcpConfig = JSON.parse(mcpConfigText);
874
+ const env = Object.values(mcpConfig.servers)[0].env;
875
+ const credentials = {
876
+ baseURL: env.CAMUNDA_BASE_URL,
877
+ clientID: env.CAMUNDA_CLIENT_ID,
878
+ clientSecret: env.CAMUNDA_CLIENT_SECRET,
879
+ OauthURL: env.CAMUNDA_OAUTH_URL,
880
+ tokenAudience: env.CAMUNDA_TOKEN_AUDIENCE,
881
+ };
882
+ if (setEnvVariables) {
883
+ process.env.MCP_BASE_URL = credentials.baseURL;
884
+ process.env.MCP_CLIENT_ID = credentials.clientID;
885
+ process.env.MCP_CLIENT_SECRET = credentials.clientSecret;
886
+ process.env.MCP_OAUTH_URL = credentials.OauthURL;
887
+ process.env.MCP_TOKEN_AUDIENCE = credentials.tokenAudience;
888
+ }
889
+ return credentials;
890
+ }
891
+ }
892
+ exports.ClusterDetailsPage = ClusterDetailsPage;