@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.
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,657 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ClusterPage = 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
+ class ClusterPage {
8
+ page;
9
+ defaultClusterType = 'G3-Dev';
10
+ belgiumRegion;
11
+ londonRegion;
12
+ ohioRegion;
13
+ finlandRegion;
14
+ testInfo;
15
+ createNewClusterButton;
16
+ clusterNameInput;
17
+ createClusterButton;
18
+ clusterCreatingStatusText;
19
+ clusterHealthyStatusText;
20
+ clusterHealthyIndicatorSelector;
21
+ clusterGenerationCompleteMessage;
22
+ clustersBreadcrumb;
23
+ deleteClusterButton;
24
+ confirmDeleteInput;
25
+ dangerDeleteButton;
26
+ testClusterLink;
27
+ connectorSecretsTab;
28
+ createAClusterButton;
29
+ clusterVersionOption;
30
+ generationSearchInput;
31
+ g3DevClusterType;
32
+ alphaTab;
33
+ devTab;
34
+ stableTab;
35
+ qaGenerationsTab;
36
+ gcpRegion;
37
+ clustersList;
38
+ tasklistV1Api;
39
+ tasklistV2Api;
40
+ cluster;
41
+ clusterRow;
42
+ clusterHealthiness;
43
+ clusterLink;
44
+ dialog;
45
+ clusterVersion;
46
+ constructor(page, testInfo) {
47
+ this.page = page;
48
+ this.testInfo = testInfo;
49
+ this.createNewClusterButton = this.createNewClusterButton = page
50
+ .getByRole('button', {
51
+ name: 'Create new cluster',
52
+ })
53
+ .or(this.page.getByRole('button', {
54
+ name: 'Create cluster',
55
+ }));
56
+ this.clusterNameInput = page.getByPlaceholder('Enter a name for the cluster');
57
+ this.createClusterButton = page.getByRole('button', {
58
+ name: 'Create cluster',
59
+ });
60
+ this.clusterCreatingStatusText = page.getByText('Creating', { exact: true });
61
+ this.clusterHealthyStatusText = page.getByText('Healthy', { exact: true });
62
+ this.clusterHealthyIndicatorSelector = '[class="healthy healthIndicator"]';
63
+ this.clusterGenerationCompleteMessage = page.getByText('Test Cluster is healthy and ready to use');
64
+ this.clustersBreadcrumb = page
65
+ .getByLabel('Breadcrumb')
66
+ .getByText('Clusters', { exact: true });
67
+ this.deleteClusterButton = page.getByRole('button', { name: 'Delete' });
68
+ this.confirmDeleteInput = page.getByRole('textbox', {
69
+ name: 'Type the word DELETE to confirm',
70
+ });
71
+ this.dangerDeleteButton = page
72
+ .getByRole('dialog')
73
+ .getByRole('button', { name: 'Delete' });
74
+ this.testClusterLink = page.getByRole('link', { name: 'Test Cluster' });
75
+ this.connectorSecretsTab = page
76
+ .getByRole('tab', {
77
+ name: 'Cluster secrets',
78
+ })
79
+ .or(page.getByRole('tab', {
80
+ name: 'Connector Secrets',
81
+ }));
82
+ // Camunda Hub's create-cluster form replaced the Carbon tiles (a
83
+ // <label> per option) and tabs with design-system choice cards and toggle
84
+ // groups, all exposed as role="radio" named by their title. Each locator
85
+ // below accepts either shape via this helper. Ported from
86
+ // pages/8.9/ClusterPage.ts.
87
+ const choice = (legacy, name) => legacy.or(page.getByRole('radio', { name, exact: true }));
88
+ this.belgiumRegion = choice(page.locator('label').filter({
89
+ hasText: 'Chaos, Belgium, Europe (europe-west1)',
90
+ }), 'Chaos, Belgium, Europe (europe-west1)');
91
+ this.londonRegion = choice(page.locator('label').filter({ hasText: 'London, Europe (europe-west2)' }), 'London, Europe (europe-west2)');
92
+ this.ohioRegion = choice(page.locator('label').filter({
93
+ hasText: 'Ohio, North America (us-east-2)',
94
+ }), 'Ohio, North America (us-east-2)');
95
+ this.finlandRegion = choice(page.locator('label').filter({
96
+ hasText: 'Finland, Europe (europe-north1)',
97
+ }), 'Finland, Europe (europe-north1)');
98
+ this.createAClusterButton = page.getByRole('button', {
99
+ name: 'Create a Cluster',
100
+ });
101
+ this.clusterVersionOption = page.getByText(`${process.env.CLUSTER_VERSION}`, { exact: true });
102
+ this.generationSearchInput = page.getByPlaceholder('Search generations');
103
+ this.g3DevClusterType = choice(page.locator('label').filter({ hasText: this.defaultClusterType }), this.defaultClusterType);
104
+ this.alphaTab = choice(page.getByRole('tab', { name: 'Alpha' }), 'Alpha');
105
+ this.devTab = choice(page.getByRole('tab', { name: 'Internal Dev' }), 'Internal Dev');
106
+ this.stableTab = choice(page.getByRole('tab', { name: 'Stable' }), 'Stable');
107
+ this.qaGenerationsTab = choice(page.getByRole('tab', { name: 'QA Generations' }), 'QA Generations');
108
+ this.gcpRegion = choice(page.getByRole('tab', { name: 'GCP' }), 'GCP');
109
+ this.clustersList = page
110
+ .getByRole('row')
111
+ .filter({ hasNotText: 'Generation' }); //Filter out header row
112
+ this.tasklistV1Api = page.getByText('Tasklist API v1 (legacy)');
113
+ this.tasklistV2Api = page.getByText('Tasklist API v2');
114
+ // The Console does not enforce unique cluster names, so an org can end up
115
+ // holding several clusters under the same name (a create that was retried
116
+ // after the list-fetch race in clickClustersBreadcrumb, or two runs of the
117
+ // same spec overlapping on the long-lived RBA clusters). Every name-scoped
118
+ // locator below is derived from this one, so without .first() a single
119
+ // leftover duplicate turns each of them into a strict-mode violation and
120
+ // the spec dies in beforeEach instead of reusing the healthy cluster.
121
+ // Resolving to the first matching row keeps this accessor singular, which
122
+ // is how every caller already uses it (isVisible/waitFor/click). Callers
123
+ // that must act on *all* same-named rows (deleteCluster) re-query in a
124
+ // loop, so they still walk the duplicates one by one.
125
+ this.cluster = (clusterName) => this.clustersList.filter({
126
+ has: page.getByRole('link', { name: clusterName, exact: true }),
127
+ });
128
+ // The Console only enforces cluster-name uniqueness per region, so the
129
+ // org can hold several rows with the same name (parallel workers sharing
130
+ // a fixed cluster name do produce them). `cluster()` stays the full set --
131
+ // deleteCluster needs it -- while everything that means "the one cluster
132
+ // under test" goes through this single row, so a duplicate can no longer
133
+ // turn an ordinary visibility check into a strict-mode violation.
134
+ this.clusterRow = (clusterName) => this.cluster(clusterName).first();
135
+ this.clusterHealthiness = (clusterName) => this.clusterRow(clusterName).getByText(`Healthy`, {
136
+ exact: true,
137
+ });
138
+ this.clusterLink = (clusterName) => this.clusterRow(clusterName).getByRole('link', {
139
+ name: clusterName,
140
+ exact: true,
141
+ });
142
+ this.dialog = page.getByRole('dialog');
143
+ this.clusterVersion = (clusterName, versionText) => this.clusterRow(clusterName).getByText(versionText, { exact: false });
144
+ }
145
+ async clickClusterBanner() {
146
+ // Camunda Hub has no `banner` landmark; "Clusters" instead lives in its
147
+ // persistent "Main navigation" sidebar, and once the org has environments
148
+ // enabled that link is further renamed "Environments" (same rollout
149
+ // HomePage.clusterTab handles).
150
+ const clusterLink = this.page
151
+ .getByRole('banner')
152
+ .getByRole('link', { name: 'Clusters' })
153
+ .or(this.page
154
+ .getByRole('navigation', { name: 'Main navigation' })
155
+ .getByRole('link', { name: 'Clusters', exact: true }))
156
+ .or(this.page
157
+ .getByRole('navigation', { name: 'Main navigation' })
158
+ .getByRole('link', { name: 'Environments', exact: true }));
159
+ await clusterLink.click({ timeout: 60000 });
160
+ // Landing on Hub's Environments overview (see above) renders clusters as
161
+ // cards, not the getByRole('row') table this page's own locators expect
162
+ // -- route through the page's own "Clusters" tab to reach the classic
163
+ // route. Same fix as HomePage.clickClusters().
164
+ const clustersPageTab = this.page
165
+ .getByRole('navigation', { name: 'Environments views' })
166
+ .getByRole('link', { name: 'Clusters', exact: true });
167
+ // On Hub this tab is required -- the row-based locators callers use right
168
+ // after this method return nothing on the card-based Environments
169
+ // overview, so a slow render must not be treated as "tab doesn't exist"
170
+ // the way the legacy (non-Hub) shell's 5s probe is allowed to.
171
+ if (new URL(this.page.url()).hostname.startsWith('hub.')) {
172
+ await (0, test_1.expect)(clustersPageTab).toBeVisible({ timeout: 30000 });
173
+ await clustersPageTab.click({ timeout: 15000 });
174
+ }
175
+ else if (await clustersPageTab.isVisible({ timeout: 5000 }).catch(() => false)) {
176
+ await clustersPageTab.click({ timeout: 15000 });
177
+ }
178
+ }
179
+ async confirmClusterDeletion() {
180
+ await (0, test_1.expect)(this.dialog).toBeVisible({ timeout: 60000 });
181
+ await (0, test_1.expect)(this.confirmDeleteInput).toBeVisible({ timeout: 60000 });
182
+ await this.confirmDeleteInput.click({ force: true, timeout: 60000 });
183
+ await this.confirmDeleteInput.fill('DELETE', { timeout: 60000 });
184
+ const dangerDeleteButtons = await this.dangerDeleteButton.all();
185
+ const lastDangerDeleteButton = dangerDeleteButtons[dangerDeleteButtons.length - 1];
186
+ await lastDangerDeleteButton.click();
187
+ await (0, test_1.expect)(this.page.getByText('Deleting...')).not.toBeVisible({
188
+ timeout: 60000,
189
+ });
190
+ await (0, test_1.expect)(this.dialog).not.toBeVisible({ timeout: 60000 });
191
+ }
192
+ async dismissOpenDialog() {
193
+ const cancelButton = this.dialog
194
+ .first()
195
+ .getByRole('button', { name: 'Cancel' });
196
+ const cancelVisible = await cancelButton
197
+ .isVisible({ timeout: 2000 })
198
+ .catch(() => false);
199
+ if (cancelVisible) {
200
+ await cancelButton.click({ timeout: 10000 }).catch(() => false);
201
+ }
202
+ }
203
+ async deleteCluster(name) {
204
+ await this.page.waitForTimeout(1000);
205
+ const clusterInstance = this.cluster(name).first();
206
+ if ((await clusterInstance.count()) <= 0) {
207
+ console.log(`No clusters found with name ${name}, skipping deletion.`);
208
+ return;
209
+ }
210
+ await clusterInstance.waitFor({ timeout: 10000 });
211
+ let deleteButtons = this.cluster(name).getByRole('button', {
212
+ name: 'Delete',
213
+ });
214
+ while ((await deleteButtons.count()) > 0) {
215
+ const deleteButton = deleteButtons.nth(0);
216
+ if (await deleteButton.isVisible()) {
217
+ try {
218
+ await deleteButton.click({ force: true, timeout: 60000 });
219
+ }
220
+ catch (error) {
221
+ await this.clickClusterBanner();
222
+ await (0, test_1.expect)(deleteButton).toBeVisible({ timeout: 60000 });
223
+ await deleteButton.click({ force: true, timeout: 60000 });
224
+ }
225
+ await this.confirmClusterDeletion();
226
+ // Refresh the list of delete buttons
227
+ deleteButtons = this.cluster(name).getByRole('button', {
228
+ name: 'Delete',
229
+ });
230
+ }
231
+ }
232
+ await this.page.waitForTimeout(500);
233
+ }
234
+ async clickClusterTab() {
235
+ await Promise.race([
236
+ this.page.waitForURL(/\/clusters/, {
237
+ timeout: 60000,
238
+ }),
239
+ this.clickClusterBanner(),
240
+ ]);
241
+ }
242
+ async clickCreateNewClusterButton() {
243
+ await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.createNewClusterButton, {
244
+ visibilityTimeout: 20000,
245
+ totalTimeout: 80000,
246
+ postAction: async () => {
247
+ await this.clickClusterBanner();
248
+ },
249
+ });
250
+ }
251
+ async clickClusterNameInput() {
252
+ await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.clusterNameInput, {
253
+ postAction: async () => {
254
+ await this.clickClusterBanner();
255
+ },
256
+ });
257
+ }
258
+ async fillClusterNameInput(name) {
259
+ await this.clusterNameInput.fill(name);
260
+ }
261
+ extractClusterIdFromUrl(url) {
262
+ const clusterIdMatch = url.match(/\/cluster\/([a-f0-9-]+)/);
263
+ return clusterIdMatch ? clusterIdMatch[1] : null;
264
+ }
265
+ async logClusterCreationInfo(clusterName) {
266
+ try {
267
+ await this.page.waitForURL(/\/cluster\/[a-f0-9-]+$/, { timeout: 60000 });
268
+ const currentUrl = this.page.url();
269
+ const clusterId = this.extractClusterIdFromUrl(currentUrl);
270
+ console.log(`🎉 Cluster "${clusterName}" created successfully with ID: ${clusterId || 'Unknown'} at ${new Date().toISOString()}`);
271
+ }
272
+ catch (error) {
273
+ console.warn(`⚠️ Could not extract cluster info for "${clusterName}": ${error}`);
274
+ }
275
+ }
276
+ async createCluster(name, region = 'GCP', tasklistV1Api) {
277
+ await this.clickClusterTab();
278
+ await this.deleteCluster(name);
279
+ await this.clickCreateNewClusterButton();
280
+ await this.clickClusterNameInput();
281
+ await this.fillClusterNameInput(name);
282
+ await this.clickClusterType();
283
+ // Same design-system role="radio" fallback as the choice()-wrapped
284
+ // locators above -- `region` is a runtime parameter ('GCP'/'AWS') so
285
+ // this can't reuse a named locator directly. Ported from
286
+ // pages/8.9/ClusterPage.ts.
287
+ await this.page
288
+ .getByRole('tab', { name: region })
289
+ .or(this.page.getByRole('radio', { name: region, exact: true }))
290
+ .click();
291
+ await this.selectSubRegion(region);
292
+ await this.clickClusterOption();
293
+ await this.determineTasklistAPI(tasklistV1Api);
294
+ await this.clickCreateClusterButton();
295
+ await this.logClusterCreationInfo(name);
296
+ await this.clickClustersBreadcrumb(name);
297
+ }
298
+ async determineTasklistAPI(tasklistV1Api) {
299
+ // Determine tasklistV1Api from project name if not explicitly provided
300
+ if (tasklistV1Api === undefined) {
301
+ const projectName = this.testInfo?.project.name || '';
302
+ tasklistV1Api =
303
+ projectName.includes('v1') || projectName.includes('8.11-v1');
304
+ console.log(`Auto-detected Tasklist API version from project '${projectName}': ${tasklistV1Api ? 'V1' : 'V2'}`);
305
+ }
306
+ if (tasklistV1Api) {
307
+ await this.clickTasklistV1Api();
308
+ }
309
+ }
310
+ async clickClusterType() {
311
+ if (process.env.IS_PROD !== 'true') {
312
+ await (0, test_1.expect)(this.g3DevClusterType).toBeVisible({ timeout: 60000 });
313
+ await this.g3DevClusterType.click();
314
+ }
315
+ }
316
+ async clickCreateClusterButton() {
317
+ await this.createClusterButton.click();
318
+ }
319
+ async clickClustersBreadcrumb(clusterName) {
320
+ // Scope the status check to the cluster's own row instead of matching the
321
+ // status text anywhere on the page: a page-wide `getByText` regex also
322
+ // matches every ancestor whose combined text spans the name and a status
323
+ // (the whole app shell does, once a second row carries the same name),
324
+ // which turns this wait into a strict-mode violation.
325
+ const clusterRow = this.clusterRow(clusterName);
326
+ const creatingRow = clusterRow.getByText('Creating', { exact: true });
327
+ const clusterRowVisible = creatingRow.or(clusterRow.getByText('Healthy', { exact: true }));
328
+ try {
329
+ await (0, test_1.expect)(this.clustersBreadcrumb).toBeVisible({ timeout: 60000 });
330
+ await this.clustersBreadcrumb.click({ timeout: 60000 });
331
+ await (0, test_1.expect)(creatingRow).toBeVisible({
332
+ timeout: 30000,
333
+ });
334
+ return;
335
+ }
336
+ catch (error) {
337
+ await this.clickClusterBanner();
338
+ const seenViaBanner = await clusterRowVisible
339
+ .isVisible({ timeout: 30000 })
340
+ .catch(() => false);
341
+ if (seenViaBanner)
342
+ return;
343
+ // The Clusters list sometimes serves a stale page after a create that
344
+ // didn't propagate yet (parallel setup workers, list-fetch race).
345
+ // Reload once and give the list a longer window before giving up.
346
+ console.warn(`clickClustersBreadcrumb: '${clusterName}' not visible after banner nav; reloading and extending wait to 90s.`);
347
+ await this.page.reload({ waitUntil: 'domcontentloaded' }).catch(() => { });
348
+ await (0, test_1.expect)(clusterRowVisible).toBeVisible({ timeout: 90000 });
349
+ }
350
+ }
351
+ async clickClusterLink(name) {
352
+ await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.clusterLink(name), {
353
+ postAction: async () => {
354
+ await this.clickClusterBanner();
355
+ },
356
+ });
357
+ }
358
+ async clickConnectorSecretsTab(clusterName) {
359
+ await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.connectorSecretsTab, {
360
+ postAction: async () => {
361
+ await this.clickClusterBanner();
362
+ await this.clickClusterLink(clusterName);
363
+ },
364
+ });
365
+ }
366
+ async clickLatestStableForMinorVersion() {
367
+ const minorVersion = process.env.MINOR_VERSION;
368
+ if (!minorVersion) {
369
+ throw new Error('MINOR_VERSION env var is required for auto-detecting the latest stable generation');
370
+ }
371
+ const escapedVersion = minorVersion.replace('.', '\\.');
372
+ const stableOption = this.page
373
+ .getByText(new RegExp(`^Camunda ${escapedVersion}\\+`))
374
+ .first();
375
+ await this.clickStableTab();
376
+ await (0, test_1.expect)(stableOption).toBeVisible({ timeout: 60000 });
377
+ console.log(`Auto-selecting latest stable generation for Camunda ${minorVersion}`);
378
+ await stableOption.click({ timeout: 60000 });
379
+ }
380
+ async clickClusterOption() {
381
+ if (!process.env.CLUSTER_VERSION) {
382
+ await this.clickLatestStableForMinorVersion();
383
+ return;
384
+ }
385
+ const tabs = [
386
+ this.clickDevTab,
387
+ this.clickQAGenerationsTab,
388
+ this.clickStableTab,
389
+ this.clickAlphaTab,
390
+ ];
391
+ // The channel tabs no longer list every generation — the list is filtered
392
+ // by a "Search generations" box, and switching tabs clears that box. So on
393
+ // each channel we must (re)type the generation name before its option
394
+ // renders. A generation created via the API moments earlier can also take
395
+ // time to surface, so cycle through every channel repeatedly within a
396
+ // bounded budget (maxCycles * tabs * perTabTimeout) rather than a single
397
+ // pass, giving a late-propagating generation multiple chances on any channel.
398
+ const maxCycles = 6;
399
+ // Increased from 12 s: search results can take longer to render, especially
400
+ // on first load or when the backend is slow.
401
+ const perTabTimeout = 30000;
402
+ for (let cycle = 0; cycle < maxCycles; cycle++) {
403
+ for (const clickTab of tabs) {
404
+ try {
405
+ await clickTab.call(this);
406
+ // Some tabs (e.g. Stable, Alpha) show a flat list with no search box.
407
+ // Use a short isVisible() probe instead of a hard toBeVisible() assert
408
+ // so we still try clicking the option on those tabs.
409
+ const searchInputVisible = await this.generationSearchInput
410
+ .isVisible({ timeout: 3000 })
411
+ .catch(() => false);
412
+ if (searchInputVisible) {
413
+ await this.generationSearchInput.fill(`${process.env.CLUSTER_VERSION}`);
414
+ }
415
+ await this.clusterVersionOption.click({ timeout: perTabTimeout });
416
+ return;
417
+ }
418
+ catch (error) {
419
+ console.error(`Cycle ${cycle + 1}/${maxCycles}: cluster generation not found on this tab yet:`, error);
420
+ }
421
+ }
422
+ }
423
+ throw new Error('Failed to find cluster generation');
424
+ }
425
+ /**
426
+ * Counts the clusters carrying `clusterName`. The clusters table renders
427
+ * asynchronously after a navigation or reload, so a bare `count()` can read
428
+ * zero rows off a list that is merely still loading -- and the caller would
429
+ * then create a second cluster with the same name. Give the row a chance to
430
+ * appear before trusting a zero.
431
+ */
432
+ async countClusters(clusterName) {
433
+ await this.clusterRow(clusterName)
434
+ .waitFor({ state: 'visible', timeout: 30000 })
435
+ .catch(() => false);
436
+ return this.cluster(clusterName).count();
437
+ }
438
+ /**
439
+ * Deletes the surplus rows when several clusters share `clusterName`, so the
440
+ * name identifies exactly one cluster again. Duplicates are created when
441
+ * concurrent workers run the same spec against a fixed cluster name: both
442
+ * see "no such cluster" and both create one (each in its own random region,
443
+ * which the Console accepts). Leaving them in place is not an option -- the
444
+ * cluster name is what every later step resolves the cluster by, in the
445
+ * Console list, in the apps menu, and in the Modeler deployment dialog, and
446
+ * those lists do not have to agree on ordering, so the flow could enable RBA
447
+ * on one cluster and then assert against the other.
448
+ *
449
+ * Always removes the trailing row so the surviving cluster stays the one
450
+ * `clusterRow()` resolves to, and a concurrent worker pruning the same list
451
+ * targets the same row rather than the survivor.
452
+ */
453
+ async pruneDuplicateClusters(clusterName) {
454
+ const rows = this.cluster(clusterName);
455
+ const maxAttempts = 4;
456
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
457
+ const total = await this.countClusters(clusterName);
458
+ if (total <= 1)
459
+ return;
460
+ console.warn(`pruneDuplicateClusters: found ${total} clusters named '${clusterName}'; deleting the surplus row (attempt ${attempt}/${maxAttempts}).`);
461
+ try {
462
+ await rows
463
+ .nth(total - 1)
464
+ .getByRole('button', { name: 'Delete' })
465
+ .click({ force: true, timeout: 60000 });
466
+ await this.confirmClusterDeletion();
467
+ }
468
+ catch (error) {
469
+ console.warn(`pruneDuplicateClusters: could not delete the surplus '${clusterName}' row: ${error}`);
470
+ await this.dismissOpenDialog();
471
+ }
472
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
473
+ }
474
+ const remaining = await this.countClusters(clusterName);
475
+ if (remaining > 1) {
476
+ throw new Error(`Could not reduce the ${remaining} clusters named '${clusterName}' to a single one after ${maxAttempts} attempts; the cluster name no longer identifies one cluster.`);
477
+ }
478
+ }
479
+ async createClusterIfNotExists(clusterName, region = 'GCP') {
480
+ await (0, sleep_1.sleep)(15000);
481
+ await this.pruneDuplicateClusters(clusterName);
482
+ if ((await this.countClusters(clusterName)) === 0) {
483
+ await this.createCluster(clusterName, region);
484
+ await this.assertClusterHealthyStatusWithRetry(clusterName, 120000, 600000);
485
+ return;
486
+ }
487
+ if (await this.clusterHealthiness(clusterName).isVisible({ timeout: 20000 })) {
488
+ console.log(`${clusterName} exists and is healthy.`);
489
+ return;
490
+ }
491
+ // The cluster exists but is not Healthy yet -- typically still Creating
492
+ // from a concurrent worker, or briefly status-less right after a reload.
493
+ // Wait for it to come up instead of deleting and recreating it: tearing
494
+ // down a cluster mid-provisioning is what leaves the "Delete cluster"
495
+ // dialog hanging open on a delete the backend rejects.
496
+ console.log(`${clusterName} exists but is not Healthy yet; waiting for it to come up.`);
497
+ await this.assertClusterHealthyStatusWithRetry(clusterName, 120000, 600000);
498
+ }
499
+ isSessionLost() {
500
+ try {
501
+ return /^(weblogin|login|auth)\./.test(new URL(this.page.url()).host);
502
+ }
503
+ catch {
504
+ return false;
505
+ }
506
+ }
507
+ async assertClusterHealthyStatusWithRetry(name, visibilityTimeout = 100000, totalTimeout = 500000, recoverSession) {
508
+ const unhealthy = this.clusterRow(name).getByText('Unhealthy', {
509
+ exact: true,
510
+ });
511
+ const start = Date.now();
512
+ // The loop is bounded by `totalTimeout` alone; it used to also stop at a
513
+ // hardcoded `maxRetries = 5`. What that cap changed is the *reload* rate,
514
+ // not the budget: with `visibilityTimeout` at 120s (what
515
+ // createClusterIfNotExists passes) five attempts of ~123s each already
516
+ // consumed the full 600s, so the old loop was not giving budget back.
517
+ //
518
+ // What it did do is reload the cluster list only 5 times across those 600s.
519
+ // `pollTimeout` caps how long any single `waitFor` blocks, which raises that
520
+ // to ~33 reloads for the same wall clock. That matters because the Healthy
521
+ // badge is only re-read after a reload -- a `waitFor` sitting on an
522
+ // already-rendered page cannot observe a status that changed server-side,
523
+ // so the effective polling resolution is the reload interval (~123s before,
524
+ // ~18s now), not the `waitFor` timeout.
525
+ //
526
+ // Worth knowing if you touch this: if the cluster list ever starts
527
+ // live-updating its status without a reload, this change stops buying
528
+ // anything, because then the old loop's long `waitFor` would already notice
529
+ // the transition the moment it happened.
530
+ const pollTimeout = Math.min(visibilityTimeout, 15000);
531
+ let attempt = 0;
532
+ // Unhealthy is confirmed by how long it persists, not by a poll count: a
533
+ // cluster mid-provisioning can flash through Unhealthy during the
534
+ // Unhealthy -> Creating -> Healthy transition. The old "2 consecutive
535
+ // polls" gate was poll-rate dependent -- at a `visibilityTimeout`-long
536
+ // interval it meant roughly 2 x visibilityTimeout of Unhealthy -- so now
537
+ // that we poll every 15s it has to be expressed as elapsed time, or the
538
+ // tolerance silently shrinks to 30s.
539
+ //
540
+ // It is derived from the caller's `visibilityTimeout` rather than fixed, so
541
+ // each caller keeps the tolerance it had: createClusterIfNotExists (120s)
542
+ // gets 4 minutes, and console-user-flows' cluster-creation check (300s,
543
+ // with a 25-minute total budget) keeps its ~10 minutes instead of being cut
544
+ // to 2. The floor matters for callers that pass a small visibilityTimeout.
545
+ const unhealthyConfirmMs = Math.max(2 * visibilityTimeout, 120000);
546
+ let unhealthySince = null;
547
+ let lastErr;
548
+ while (Date.now() - start < totalTimeout) {
549
+ attempt++;
550
+ try {
551
+ // Once the Console session drops the tab sits on the identity
552
+ // provider's login form, and reloading only re-renders it.
553
+ if (recoverSession && this.isSessionLost()) {
554
+ await recoverSession();
555
+ }
556
+ else {
557
+ await this.page.reload();
558
+ }
559
+ await (0, test_1.expect)(this.clusterRow(name)).toBeVisible({ timeout: 10000 });
560
+ // Only treat Unhealthy as terminal once it has persisted for
561
+ // `unhealthyConfirmMs`. A cluster mid-provisioning can flash through
562
+ // Unhealthy briefly during the Unhealthy → Creating → Healthy
563
+ // transition and we don't want a transient reading to abort the whole
564
+ // helper — earlier versions gated on `attempt > 1`, then on two
565
+ // consecutive polls, both of which are poll-rate dependent.
566
+ const isUnhealthy = await unhealthy
567
+ .isVisible({ timeout: 2000 })
568
+ .catch(() => false);
569
+ if (isUnhealthy) {
570
+ unhealthySince ??= Date.now();
571
+ const unhealthyFor = Date.now() - unhealthySince;
572
+ if (unhealthyFor >= unhealthyConfirmMs) {
573
+ throw new Error(`Cluster "${name}" reached terminal Unhealthy state after ${Math.round((Date.now() - start) / 1000)}s (Unhealthy continuously for ${Math.round(unhealthyFor / 1000)}s); aborting Healthy poll.`);
574
+ }
575
+ }
576
+ else {
577
+ unhealthySince = null;
578
+ }
579
+ await this.clusterHealthiness(name).waitFor({
580
+ state: 'visible',
581
+ timeout: pollTimeout,
582
+ });
583
+ console.log('Cluster is healthy:', name);
584
+ return;
585
+ }
586
+ catch (err) {
587
+ if (err instanceof Error &&
588
+ err.message.includes('terminal Unhealthy state')) {
589
+ throw err;
590
+ }
591
+ lastErr = err;
592
+ // Only log every 8th attempt now that we poll every 15s: the previous
593
+ // one-line-per-attempt output was 4 lines, it would otherwise be ~40
594
+ // identical lines per cluster and this suite creates several.
595
+ if (attempt === 1 || attempt % 8 === 0) {
596
+ console.log(`Attempt ${attempt} failed for cluster "${name}" Healthy check ` +
597
+ `(${Math.round((Date.now() - start) / 1000)}s elapsed), retrying...`, err instanceof Error ? err.message : err);
598
+ }
599
+ await this.page.waitForTimeout(500);
600
+ }
601
+ }
602
+ throw new Error(`Cluster "${name}" did not become Healthy within ${Math.round(totalTimeout / 1000)}s (${attempt} polls). Last error: ${lastErr instanceof Error ? lastErr.message : lastErr}`);
603
+ }
604
+ async clickAlphaTab() {
605
+ await this.alphaTab.click();
606
+ }
607
+ async clickDevTab() {
608
+ await this.devTab.click();
609
+ }
610
+ async clickStableTab() {
611
+ await this.stableTab.click();
612
+ }
613
+ async clickQAGenerationsTab() {
614
+ await this.qaGenerationsTab.click();
615
+ }
616
+ async selectSubRegion(region) {
617
+ if (region === 'GCP') {
618
+ if (process.env.IS_PROD == 'true') {
619
+ await (0, test_1.expect)(this.londonRegion).toBeVisible({ timeout: 20000 });
620
+ await this.londonRegion.click();
621
+ }
622
+ else {
623
+ const regions = [
624
+ { name: 'Belgium', locator: this.belgiumRegion },
625
+ { name: 'Finland', locator: this.finlandRegion },
626
+ ];
627
+ const chosen = regions[Math.floor(Math.random() * regions.length)];
628
+ console.log(`Selected region: ${chosen.name}`);
629
+ await (0, test_1.expect)(chosen.locator).toBeVisible({ timeout: 20000 });
630
+ await chosen.locator.click();
631
+ }
632
+ }
633
+ else if (region === 'AWS' && process.env.IS_PROD == 'true') {
634
+ // The AWS region tile has no default selection, unlike GCP's tiles.
635
+ // Only prod creates AWS clusters through this UI flow.
636
+ await (0, test_1.expect)(this.ohioRegion).toBeVisible({ timeout: 20000 });
637
+ await this.ohioRegion.click();
638
+ }
639
+ }
640
+ async clickGCPRegion() {
641
+ const regionSelectionEnabled = process.env.REGION_SELECTION === 'true';
642
+ if (regionSelectionEnabled) {
643
+ await (0, test_1.expect)(this.gcpRegion).toBeVisible({ timeout: 40000 });
644
+ await this.gcpRegion.click();
645
+ }
646
+ }
647
+ async clickTasklistV1Api() {
648
+ try {
649
+ await (0, test_1.expect)(this.tasklistV1Api).toBeVisible({ timeout: 60000 });
650
+ await this.tasklistV1Api.click({ timeout: 30000 });
651
+ }
652
+ catch {
653
+ return;
654
+ }
655
+ }
656
+ }
657
+ exports.ClusterPage = ClusterPage;