@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,1168 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ModelerHomePage = 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 randomName_1 = require("../../utils/randomName");
8
+ const ProcessApplicationPage_1 = require("./ProcessApplicationPage");
9
+ const sessionRecovery_1 = require("../../utils/sessionRecovery");
10
+ const modelerCluster_1 = require("../../utils/modelerCluster");
11
+ class ModelerHomePage {
12
+ defaultFolderName = 'Cross Component Test Project';
13
+ // The default cluster test-setup.spec.ts's "Create Default Cluster" test
14
+ // provisions for the whole suite -- assigned to the shared workspace's
15
+ // Environments step so downstream specs can deploy to it without a manual
16
+ // assignment step first.
17
+ defaultClusterName = 'Test Cluster';
18
+ // The name hub gives a project on create, before the inline rename commits.
19
+ defaultNewProjectName = 'New project';
20
+ page;
21
+ // Since camunda/camunda-hub#25831 files and folders cannot sit at a
22
+ // workspace ("project" in today's UI) root -- only process applications and
23
+ // IDP applications can. The container is therefore entered lazily, at the
24
+ // point a resource is created, and remembered for the lifetime of this page
25
+ // object (one instance per test, see fixtures/8.10.ts). Specs that only need
26
+ // the workspace itself -- collaborators, IDP applications -- never trigger
27
+ // the hop.
28
+ processApplicationPage;
29
+ // Load-bearing: hub renders no process-application breadcrumb on a diagram
30
+ // page at container root, so the remembered URL -- not a breadcrumb click --
31
+ // is how we get back. Hub's own Playwright suite does the same.
32
+ processApplicationUrl;
33
+ processApplicationName;
34
+ modelerPageBanner;
35
+ createNewProjectButton;
36
+ createWorkspaceButton;
37
+ workspaceWizardNameInput;
38
+ workspaceWizardSubmitButton;
39
+ workspaceWizardMembersStep;
40
+ workspaceWizardEnvironmentsHeading;
41
+ projectNameInput;
42
+ formNameInput;
43
+ chooseBpmnTemplateButton;
44
+ diagramTypeDropdown;
45
+ bpmnTemplateOption;
46
+ formTemplateOption;
47
+ projectBreadcrumb;
48
+ workspaceBreadcrumb;
49
+ openOrganizationsButton;
50
+ manageButton;
51
+ crossComponentProjectFolder;
52
+ homeBreadcrumb;
53
+ rows;
54
+ uploadFilesButton;
55
+ messageBanner;
56
+ idpTemplateOption;
57
+ idpEmptyStateButton;
58
+ idpProjectsTab;
59
+ createIdpProjectButton;
60
+ createActionDropdown;
61
+ idpApplicationNameInput;
62
+ createIdpApplicationButton;
63
+ dialog;
64
+ closeButton;
65
+ blockingDialog;
66
+ blockingDialogDismiss;
67
+ optionsButton;
68
+ formNameBreadcrumb;
69
+ formBreadcrumbButton;
70
+ formActionsButton;
71
+ renameFormMenuItem;
72
+ renameInput;
73
+ renameSubmitButton;
74
+ breadcrumbProjectMenu;
75
+ renameProjectMenuItem;
76
+ defaultNamedProjectRow;
77
+ renameMenuItem;
78
+ constructor(page) {
79
+ this.page = page;
80
+ this.processApplicationPage = new ProcessApplicationPage_1.ProcessApplicationPage(page);
81
+ // Hub's design-system shell renders the app header as a role=banner with no
82
+ // accessible name after the Camunda Hub rebrand, so the classic
83
+ // name-matched banner no longer resolves; the Modeler logo link inside it
84
+ // carries "Camunda Hub home" when the org has workspacesEnabled, else
85
+ // "Camunda Modeler home" (camunda-hub NavShellDs.common.tsx) -- match
86
+ // either. Keep the legacy named-banner branch for shells where the rename
87
+ // has not shipped yet.
88
+ this.modelerPageBanner = page
89
+ .getByRole('banner', {
90
+ name: 'Camunda Modeler',
91
+ })
92
+ .or(page
93
+ .getByRole('link', { name: 'Camunda Hub home' })
94
+ .and(page.locator(':not([href$="/login"])')))
95
+ .or(page
96
+ .getByRole('link', { name: 'Camunda Modeler home' })
97
+ .and(page.locator(':not([href$="/login"])')))
98
+ .first();
99
+ // Hub renamed this button to "Create project" on both the classic and the
100
+ // design-system shell. The legacy label is kept so the flow still works
101
+ // against Modeler builds where the rename has not shipped yet. exact:true
102
+ // keeps the new label off the split button's "Create project options".
103
+ this.createNewProjectButton = page
104
+ .getByRole('button', {
105
+ name: 'New project',
106
+ })
107
+ .or(page.getByRole('button', {
108
+ name: 'Create project',
109
+ exact: true,
110
+ }));
111
+ // Camunda Hub, which replaced Console + Web Modeler on SaaS, tops the
112
+ // hierarchy with a Workspaces overview whose "Create workspace" CTA opens a
113
+ // wizard (General -> Members) that names the workspace up front. Same
114
+ // hooks as pages/SM-8.10/ModelerHomePage.ts. exact:true keeps the split
115
+ // button's options chevron out of the match.
116
+ this.createWorkspaceButton = page.getByRole('button', {
117
+ name: 'Create workspace',
118
+ exact: true,
119
+ });
120
+ this.workspaceWizardNameInput = page.locator('#workspace-name');
121
+ this.workspaceWizardSubmitButton = page.locator('[data-test="workspace-wizard-submit"]');
122
+ this.workspaceWizardMembersStep = page.locator('[data-test="step-members"]');
123
+ // When the org has environments enabled, an "Assign environments" step is
124
+ // inserted after Members -- camunda-hub's own
125
+ // e2e-playwright/pages/CreateWorkspacePage.ts detects it the same way.
126
+ this.workspaceWizardEnvironmentsHeading = page.getByRole('heading', {
127
+ name: 'Assign environments',
128
+ });
129
+ this.projectNameInput = page.locator('[data-test="editable-input"]');
130
+ this.formNameInput = page.locator('[data-test="editable-input"]');
131
+ // Hub's workspace projects page renamed IDP applications to "IDP projects"
132
+ // (camunda-hub CreateIdpApplicationModal.common.tsx).
133
+ this.idpApplicationNameInput = page
134
+ .getByPlaceholder('New IDP Application')
135
+ .or(page.getByPlaceholder('New IDP project'))
136
+ .first();
137
+ this.createIdpApplicationButton = page.getByRole('button', {
138
+ name: 'Create',
139
+ exact: true,
140
+ });
141
+ this.chooseBpmnTemplateButton = page.getByRole('button', {
142
+ name: 'Choose BPMN template',
143
+ });
144
+ this.idpTemplateOption = page
145
+ .locator('[data-test="create-idp-application"]')
146
+ .getByText('IDP Application');
147
+ this.idpEmptyStateButton = page.getByRole('button', {
148
+ name: 'Create IDP application',
149
+ });
150
+ // Hub's workspace projects page (camunda-hub WorkspaceProjects.tsx) has no
151
+ // create menu at the root: IDP projects live on their own tab, created
152
+ // through its "Create IDP project" split button (header or empty state).
153
+ this.idpProjectsTab = page.locator('[data-test="tab-idp-applications"]');
154
+ this.createIdpProjectButton = page
155
+ .getByRole('button', { name: 'Create IDP project', exact: true })
156
+ .first();
157
+ this.diagramTypeDropdown = page.locator('[data-test="diagram-dropdown"]');
158
+ // Hub's design-system create menu (camunda-hub CreateActionDs.tsx), which
159
+ // an empty process application renders instead of the folder explorer's
160
+ // diagram-dropdown. Matched by test id: a "Create new" name also matches
161
+ // other buttons on the page.
162
+ this.createActionDropdown = page.locator('[data-test="create-action-dropdown"]');
163
+ // Matched on the test id alone: hub's design-system variant of the create
164
+ // menu renders "BPMN diagram" (lowercase d), so a text filter breaks the
165
+ // day that variant ships.
166
+ this.bpmnTemplateOption = page.locator('[data-test="create-bpmn-diagram"]');
167
+ this.formTemplateOption = page.locator('[data-test="create-form"]');
168
+ this.projectBreadcrumb = page.locator('[data-test="breadcrumb-project"]');
169
+ // Kept separate from projectBreadcrumb, which now means "the container my
170
+ // resources live in". When hub's workspaces terminology flag flips,
171
+ // breadcrumb-project comes to denote the process application, so the
172
+ // workspace level needs its own name from the start.
173
+ this.workspaceBreadcrumb = page
174
+ .locator('[data-test="breadcrumb-project"]')
175
+ .or(page.locator('[data-test="breadcrumb-workspace"]'))
176
+ .first();
177
+ this.homeBreadcrumb = page.locator('[data-test="breadcrumb-home"]');
178
+ this.openOrganizationsButton = page.getByLabel('Open Organizations');
179
+ this.manageButton = page.getByRole('menuitem', { name: 'Manage' });
180
+ // `.first()` keeps this usable in an org that already accumulated more
181
+ // than one project with this name — an unscoped by-title match throws a
182
+ // strict-mode violation the moment a duplicate exists, which fails every
183
+ // later run in that org rather than just the run that created it.
184
+ // On the Camunda Hub Workspaces overview the folder is a workspace tile
185
+ // whose "Open workspace <name>" button navigates into it; a list-view row
186
+ // opens it through a link of the same name.
187
+ this.crossComponentProjectFolder = page
188
+ .getByRole('button', { name: `Open workspace ${this.defaultFolderName}` })
189
+ .or(page.getByRole('link', {
190
+ name: `Open workspace ${this.defaultFolderName}`,
191
+ }))
192
+ .or(page.getByTitle(this.defaultFolderName, {
193
+ exact: true,
194
+ }))
195
+ .first();
196
+ this.rows = page.getByRole('row');
197
+ this.uploadFilesButton = page.getByRole('menuitem', { name: 'Upload files' });
198
+ this.messageBanner = page.locator('[data-test="close-top-banner"]');
199
+ this.dialog = page.getByRole('dialog');
200
+ // Both announcement modals hub stacks over the projects list dismiss
201
+ // through a "Got it…" footer button: the What's New modal's reads
202
+ // "Got it - Dismiss", and the migration notice added in camunda-hub
203
+ // #27819 ("Your projects have a new structure") reads just "Got it".
204
+ //
205
+ // Matched as a visible button rather than by role/name: the What's New
206
+ // modal stays mounted with `open={false}` after it is closed, so its
207
+ // dismiss button remains in the DOM but hidden, and an `.or(...).first()`
208
+ // union would resolve to that hidden button in DOM order and report
209
+ // "nothing to dismiss" while the migration notice is still covering the
210
+ // projects list.
211
+ this.closeButton = page
212
+ .locator('button:visible', { hasText: /^Got it/ })
213
+ .first();
214
+ // Not every modal hub stacks over the projects list carries a "Got it"
215
+ // control. When one does not, the `closeButton` probe above finds nothing
216
+ // and `dismissBlockingDialog` returns having dismissed *nothing*, so the
217
+ // caller clicks straight into an overlay that is still there. Run
218
+ // 35102164337 lost 9 tests that way: the project link resolved "visible,
219
+ // enabled and stable", then the click retried 116 times against a modal
220
+ // reported as intercepting pointer events.
221
+ //
222
+ // Anchored on the visible dialog so an announcement nobody has catalogued
223
+ // yet is still cleared, rather than on one more label. `:visible` matters —
224
+ // the Modeler home page keeps several `role="dialog"` containers mounted
225
+ // and hidden, which is why the label-first lookup above exists at all.
226
+ this.blockingDialog = page.locator('[role="dialog"]:visible').first();
227
+ // Only unambiguous dismissals. Deliberately NOT "Cancel": that is a form
228
+ // action on the dialogs specs open on purpose (cluster select, deploy), and
229
+ // clicking it would break a working test rather than unblock a stuck one.
230
+ this.blockingDialogDismiss = this.blockingDialog
231
+ .getByRole('button', { name: /^(Got it|Close|Dismiss)/i })
232
+ .first();
233
+ this.optionsButton = page.getByRole('button', { name: 'Options' });
234
+ // The legacy breadcrumb shows the name directly; Hub's newer nav
235
+ // (isNavV2) embeds it in the current crumb's kebab ("<name> actions").
236
+ this.formNameBreadcrumb = (formName) => page
237
+ .locator('button[data-test="breadcrumb-form"]', {
238
+ hasText: formName,
239
+ })
240
+ .or(page.getByRole('button', { name: `${formName} actions` }))
241
+ .first();
242
+ this.formBreadcrumbButton = page.locator('button[data-test="breadcrumb-form"]');
243
+ // Nav-v2 moves Rename/Duplicate/Delete behind a kebab next to the current
244
+ // (last) crumb (camunda-hub use-file-page-actions.ts); same locator as
245
+ // camunda-hub's own e2e BasePage.breadcrumbActionsButton.
246
+ this.formActionsButton = page
247
+ .getByRole('navigation', { name: 'Context navigation' })
248
+ .or(page.getByRole('navigation', { name: 'Breadcrumb', exact: true }))
249
+ .getByRole('button', { name: / actions$/ })
250
+ .last();
251
+ this.renameFormMenuItem = page
252
+ .locator('[data-test="rename-form"]')
253
+ .or(page.getByRole('menuitem', { name: 'Rename', exact: true }))
254
+ .first();
255
+ // Nav-v2's Rename opens a modal dialog (camunda-hub RenameDialogDs.tsx)
256
+ // instead of the legacy inline breadcrumb editor.
257
+ this.renameInput = page.locator('[data-test="rename-input"]');
258
+ this.renameSubmitButton = page.locator('[data-test="rename-submit"]');
259
+ this.breadcrumbProjectMenu = page.locator('[data-test="breadcrumb-project-menu"]');
260
+ this.renameProjectMenuItem = page.locator('[data-test="rename-project"]');
261
+ // EntityTable stamps `entity-<row id>` on the row, and on the projects list
262
+ // the row id is the project's name (camunda-hub
263
+ // frontend/apps/hub/src/components/entity-table/EntityTable.tsx), so this
264
+ // addresses the still-unnamed project the create flow just added.
265
+ this.defaultNamedProjectRow = page.locator(`[data-test="entity-${this.defaultNewProjectName}"]`);
266
+ this.renameMenuItem = page.getByRole('menuitem', { name: 'Rename' });
267
+ }
268
+ async dismissOverlays() {
269
+ // Before the generic pass, for the same reason
270
+ // clickCrossComponentProjectFolder dismisses the dialog first: the loop
271
+ // below closes whichever overlay it finds and moves on, so a single pass
272
+ // leaves a stacked announcement dialog open, and every caller that relies
273
+ // on dismissOverlays() to clear the page then clicks into it.
274
+ await this.dismissBlockingDialog();
275
+ for (const locator of [
276
+ this.closeButton,
277
+ this.page.getByRole('button', { name: 'Close' }).first(),
278
+ this.messageBanner,
279
+ ]) {
280
+ await locator
281
+ .waitFor({ state: 'visible', timeout: 3000 })
282
+ .then(() => locator.click())
283
+ .catch(() => { });
284
+ }
285
+ }
286
+ async clickCreateNewProjectButton() {
287
+ await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.createNewProjectButton, {
288
+ preAction: async () => {
289
+ await this.dismissOverlays();
290
+ },
291
+ totalTimeout: 120000,
292
+ visibilityTimeout: 10000,
293
+ });
294
+ }
295
+ async enterNewProjectName(name) {
296
+ // The inline rename silently drops the value when the editable title field
297
+ // is not yet in edit mode as fill() runs, leaving the project named
298
+ // "New project". Re-enter until the field reflects the requested name.
299
+ //
300
+ // Once the rename commits, the editable input unmounts and the name
301
+ // renders as static text: on the projects list as a `[title="<name>"]`
302
+ // link, and on the project detail page (where this inline rename runs) as
303
+ // the breadcrumb project button's text. Matching only `[title]` missed the
304
+ // detail-page case, so after a successful rename the retry kept clicking a
305
+ // `[data-test="editable-input"]` that had already unmounted and hung for
306
+ // the full click timeout. Treat either committed-name rendering as success,
307
+ // and wait for it after Enter — the breadcrumb briefly shows "Loading..."
308
+ // until the change is persisted.
309
+ const committedProjectName = this.page
310
+ .getByTitle(name, { exact: true })
311
+ .or(this.page
312
+ .locator('[data-test="breadcrumb-project-menu"]')
313
+ .filter({ hasText: name }));
314
+ await (0, test_1.expect)(async () => {
315
+ if (await committedProjectName.first().isVisible()) {
316
+ return;
317
+ }
318
+ // The rename runs on a freshly created project, which is exactly when an
319
+ // announcement dialog mounts on top of it: it takes focus, the inline
320
+ // editor unmounts, and the probe below then reads "closed" and sends the
321
+ // recovery down a path that cannot reach an editor the dialog is
322
+ // covering.
323
+ await this.dismissBlockingDialog();
324
+ // Bounded, not instantaneous: the editor can still be mounting, and
325
+ // reading that as "closed" would send the recovery to the projects-list
326
+ // branch while the browser sits on the project page, where the row it
327
+ // wants does not exist.
328
+ if (!(await this.becameVisible(this.projectNameInput.first(), 10000))) {
329
+ await this.openProjectRenameEditor();
330
+ }
331
+ await this.projectNameInput.click({ timeout: 15000 });
332
+ await this.projectNameInput.fill(name);
333
+ // Confirm the value actually landed in the edit field before committing;
334
+ // if fill() ran before edit mode was active the input stays empty/default
335
+ // and this fails, so toPass retries with a fresh click.
336
+ await (0, test_1.expect)(this.projectNameInput).toHaveValue(name, { timeout: 5000 });
337
+ await this.projectNameInput.press('Enter');
338
+ await (0, sleep_1.sleep)(1000);
339
+ // Reload so the check reflects the PERSISTED server state, not the
340
+ // optimistic client render that can silently revert to "New project".
341
+ await this.page.reload();
342
+ await (0, test_1.expect)(committedProjectName.first()).toBeVisible({ timeout: 15000 });
343
+ }).toPass({ timeout: 120000 });
344
+ }
345
+ // Reopens the inline name editor when the create flow has left it closed.
346
+ // Two shapes, both hub's own (frontend/apps/hub/src/app/pages/project/
347
+ // ProjectHeader.tsx and .../home/features/projects-list/EntityAction.tsx):
348
+ // inside the project the breadcrumb dropdown carries a Rename item, and on
349
+ // the projects list the row's overflow menu carries one that toggles the row
350
+ // into edit mode. Both mount the same InlineEditable, so the caller keeps
351
+ // filling `[data-test="editable-input"]` either way.
352
+ //
353
+ // `breadcrumb-project-menu` and not `breadcrumb-project`: the latter is the
354
+ // loading/text fallback hub renders before the project has loaded, and
355
+ // clicking it opens nothing. Hub's own suite draws the same distinction.
356
+ async openProjectRenameEditor() {
357
+ if (await this.becameVisible(this.breadcrumbProjectMenu, 10000)) {
358
+ await this.breadcrumbProjectMenu.click({ timeout: 10000 });
359
+ await this.renameProjectMenuItem.click({ timeout: 10000 });
360
+ return;
361
+ }
362
+ // Still on the projects list: hub created the project but never navigated
363
+ // into it, so the breadcrumb editor was never mounted at all. Rename the
364
+ // row in place rather than clicking "New project" again, which would leave
365
+ // a second, permanently unnamed project behind in the org.
366
+ //
367
+ // Routed through clickLocatorWithRetry with a dialog-dismiss preAction --
368
+ // the same guard clickCreateNewProjectButton and the folder tile already
369
+ // use, and the one row control in this flow that was still a raw click.
370
+ // Creating a project mounts an announcement dialog over the projects list
371
+ // (see enterNewProjectName); it re-appears during the waits above and
372
+ // intercepts this context-dropdown, so the bare click timed out for its
373
+ // whole budget every toPass iteration. Dismissing right before each
374
+ // attempt clears the overlay the caller's earlier dismiss no longer
375
+ // covers.
376
+ await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.defaultNamedProjectRow.locator('[data-test="entity-context-dropdown"]'), {
377
+ totalTimeout: 90000,
378
+ visibilityTimeout: 15000,
379
+ preAction: async () => {
380
+ await this.dismissBlockingDialog();
381
+ },
382
+ });
383
+ await this.renameMenuItem.click({ timeout: 10000 });
384
+ }
385
+ async enterIdpApplicationName(name) {
386
+ await this.idpApplicationNameInput.click({ timeout: 60000 });
387
+ await this.idpApplicationNameInput.fill(name);
388
+ }
389
+ async clickChooseBpmnTemplateButton() {
390
+ await this.chooseBpmnTemplateButton.click();
391
+ }
392
+ async reload() {
393
+ await this.page.reload();
394
+ }
395
+ async getProjectNames(name) {
396
+ return this.rows
397
+ .filter({ hasText: name })
398
+ .getByTitle(name)
399
+ .evaluateAll((elements) => elements
400
+ .map((el) => el.textContent || '')
401
+ .filter((text) => text !== ''));
402
+ }
403
+ // Opens a resource where this test put it. Several specs leave Modeler
404
+ // entirely (to Operate, to Optimize) and come back via
405
+ // clickCrossComponentProjectFolder(), which lands at workspace root -- the
406
+ // resource is one level down, so re-enter the container first.
407
+ async clickProcessDiagram(name) {
408
+ await this.ensureInResourceContainer();
409
+ // A Design System table row opens through a link laid over the row, which
410
+ // sits on top of the title text and takes its clicks -- so click the link.
411
+ // The link comes before the title in DOM order, so `first()` picks it
412
+ // whenever it exists; the title stays as the fallback for the classic table.
413
+ const row = this.rows.filter({ hasText: name });
414
+ const process = row
415
+ .getByRole('link', { name })
416
+ .or(row.getByTitle(name))
417
+ .first();
418
+ await (0, test_1.expect)(process).toBeVisible({ timeout: 90000 });
419
+ await process.click();
420
+ }
421
+ // Opens the create menu inside this test's process application. The menu at
422
+ // workspace root no longer offers BPMN, Form or Upload -- those resources
423
+ // cannot live there -- so the container is entered first. Callers are
424
+ // unchanged, which is why the existing spec call sites need no edit.
425
+ async clickDiagramTypeDropdown() {
426
+ await this.enterResourceContainer();
427
+ const dropdown = this.processApplicationPage.folderExplorer
428
+ .locator('[data-test="diagram-dropdown"]')
429
+ .or(this.createActionDropdown)
430
+ .first();
431
+ // Navigation-class wait: the dropdown's render waits on the container's
432
+ // resource list, so a slow load otherwise fails with
433
+ // `element(s) not found`.
434
+ await (0, test_1.expect)(dropdown).toBeVisible({ timeout: 60000 });
435
+ await dropdown.click();
436
+ }
437
+ // Opens the create menu at workspace root, which is the only place process
438
+ // applications and IDP applications can be created. Everything else has to
439
+ // go through clickDiagramTypeDropdown().
440
+ async clickWorkspaceDiagramTypeDropdown() {
441
+ const dropdown = this.diagramTypeDropdown
442
+ .or(this.createActionDropdown)
443
+ .first();
444
+ await (0, test_1.expect)(dropdown).toBeVisible({
445
+ timeout: 60000,
446
+ });
447
+ await dropdown.click();
448
+ }
449
+ // The click landing is not proof the diagram was created: hub creates the
450
+ // resource and then navigates, so a create that fails server-side leaves the
451
+ // tab on the container with nothing but a toast. The caller goes straight on
452
+ // to model, and its wait for the editor can only expire -- reported as
453
+ // `locator('[data-group-id="group-general"]') ... element(s) not found`,
454
+ // three reloads later, on a page that was never a diagram. Reloading cannot
455
+ // conjure one, so confirm the editor URL here and re-issue the create
456
+ // instead. The caller's own editor wait stays the authority: this returns
457
+ // after the last attempt rather than throwing, so a genuinely broken create
458
+ // is still reported by the assertion that needs the editor.
459
+ async clickBpmnTemplateOption() {
460
+ const maxAttempts = 3;
461
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
462
+ await (0, test_1.expect)(this.bpmnTemplateOption).toBeVisible({
463
+ timeout: 15000,
464
+ });
465
+ await this.bpmnTemplateOption.click();
466
+ const opened = await this.page
467
+ .waitForURL(/\/diagrams\//, { timeout: 60000 })
468
+ .then(() => true)
469
+ .catch(() => false);
470
+ if (opened || attempt === maxAttempts) {
471
+ return;
472
+ }
473
+ console.warn(`No diagram opened on attempt ${attempt}; re-opening the create menu.`);
474
+ await this.clickDiagramTypeDropdown();
475
+ }
476
+ }
477
+ async clickFormOption() {
478
+ await this.formTemplateOption.click();
479
+ }
480
+ // The legacy shell opens a fresh form with its breadcrumb name in inline-edit
481
+ // mode. Nav-v2 has no inline editing: the form stays "New form" until renamed
482
+ // through the crumb's "<name> actions" kebab and the shared rename dialog.
483
+ // Retried as a unit, and confirmed on the crumb, because a re-render
484
+ // (post-create refetch, form store load) can drop the editor mid-fill.
485
+ async enterFormName(name) {
486
+ const maxAttempts = 3;
487
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
488
+ try {
489
+ if (await this.formNameBreadcrumb(name).isVisible()) {
490
+ return;
491
+ }
492
+ const editorOpen = await this.becameVisible(this.formNameInput.or(this.renameInput).first(), 15000);
493
+ if (!editorOpen) {
494
+ await this.openFormRenameEditor();
495
+ }
496
+ if (await this.renameInput.isVisible().catch(() => false)) {
497
+ await this.renameInput.fill(name, { timeout: 30000 });
498
+ await (0, test_1.expect)(this.renameInput).toHaveValue(name, { timeout: 5000 });
499
+ await this.renameSubmitButton.click({ timeout: 10000 });
500
+ await (0, test_1.expect)(this.renameInput).toBeHidden({ timeout: 30000 });
501
+ }
502
+ else {
503
+ await this.formNameInput.click({ timeout: 30000 });
504
+ await this.formNameInput.fill(name);
505
+ await this.formNameInput.press('Enter');
506
+ }
507
+ await (0, test_1.expect)(this.formNameBreadcrumb(name)).toBeVisible({
508
+ timeout: 30000,
509
+ });
510
+ return;
511
+ }
512
+ catch (error) {
513
+ if (attempt === maxAttempts) {
514
+ throw error;
515
+ }
516
+ console.warn(`Form rename to "${name}" did not commit ` +
517
+ `(attempt ${attempt}/${maxAttempts}): ${error}`);
518
+ }
519
+ }
520
+ }
521
+ async openFormRenameEditor() {
522
+ await (0, test_1.expect)(this.formBreadcrumbButton.or(this.formActionsButton).first()).toBeVisible({ timeout: 60000 });
523
+ if (await this.formActionsButton.isVisible().catch(() => false)) {
524
+ // Until the new form has loaded, nav-v2 keeps showing the previous
525
+ // page's crumbs (camunda-hub NavProvider), so the last kebab can still
526
+ // belong to the parent container. A fresh form is named "New form";
527
+ // wait for its own crumb before renaming anything.
528
+ await (0, test_1.expect)(this.formActionsButton).toHaveAccessibleName('New form actions', { timeout: 60000 });
529
+ await this.formActionsButton.click({ timeout: 30000 });
530
+ }
531
+ else {
532
+ await this.formBreadcrumbButton.click({ timeout: 60000 });
533
+ }
534
+ await this.renameFormMenuItem.click({ timeout: 30000 });
535
+ }
536
+ // Kept for the smoke spec's call site. enterFormName() now retries and
537
+ // confirms the rename on the breadcrumb itself, so a second retry layer here
538
+ // would only multiply its budget past the test timeout.
539
+ async enterFormNameWithRetry(name) {
540
+ await this.enterFormName(name);
541
+ }
542
+ // Kept under its original name because it is what the existing call sites
543
+ // already mean: "go back to where my resources live". That is now the
544
+ // process application, not the workspace root.
545
+ async clickProjectBreadcrumb() {
546
+ await this.returnToResourceContainer();
547
+ }
548
+ // The workspace ("project") level itself, for the surfaces that genuinely
549
+ // live there -- collaborators, IDP applications, published element
550
+ // templates.
551
+ async clickWorkspaceBreadcrumb() {
552
+ await this.workspaceBreadcrumb.click({ timeout: 60000 });
553
+ }
554
+ // Creates, once per test, the process application that holds this test's
555
+ // resources, and leaves the browser inside it. Idempotent: called again while
556
+ // already in the container it is a no-op, so a spec that creates several
557
+ // resources in a row pays for the container once.
558
+ //
559
+ // One container per test rather than one shared with the seeded workspace:
560
+ // deploying is process-application-wide, so a shared container would let one
561
+ // spec's deploy pick up every other spec's half-modelled diagram.
562
+ async enterResourceContainer(name) {
563
+ if (this.processApplicationUrl) {
564
+ const stillInside = await this.becameVisible(this.processApplicationPage.breadcrumb, 5000);
565
+ if (!stillInside) {
566
+ await this.returnToResourceContainer();
567
+ }
568
+ return;
569
+ }
570
+ this.processApplicationName =
571
+ name ??
572
+ (await (0, randomName_1.randomNameAgregator)('Cross Component Process Application'));
573
+ console.log(`Creating process application ${this.processApplicationName} inside ${this.defaultFolderName}`);
574
+ await this.createResourceContainer(this.processApplicationName);
575
+ this.processApplicationUrl = this.page.url();
576
+ // Remember the container; its stage cluster is bound on the first deploy,
577
+ // by ProcessApplicationPage.ensureStageCluster, which -- unlike this point
578
+ // in the flow -- knows which cluster the test is going to deploy to.
579
+ this.processApplicationPage.rememberResourceContainer(this.processApplicationUrl);
580
+ }
581
+ // Creates this test's process application, retrying when the creation does
582
+ // not land.
583
+ //
584
+ // A closed creation modal does NOT mean the application exists. Hub's
585
+ // processApplicationStore.finalizeCreation() catches its own failure: it
586
+ // toasts "Couldn't create your project. Please try again later." and never
587
+ // reaches the history.push() into the new application -- but
588
+ // CreationModal.performRequest() still calls closeModal(), so the submit
589
+ // looks like it worked while the browser is simply left on the workspace
590
+ // root. The single wait for the process-application breadcrumb that followed
591
+ // could then only ever time out
592
+ // ("breadcrumb-process-application-menu ... element(s) not found"), which was
593
+ // the largest single source of failures in this spec. The product itself
594
+ // asks for a retry in that toast, so retry.
595
+ //
596
+ // A creation that DID land but rendered slowly must not become a duplicate
597
+ // container, so every retry first adopts an application already carrying
598
+ // this name before creating another one.
599
+ async createResourceContainer(name) {
600
+ const workspaceUrl = this.page.url();
601
+ const maxAttempts = 3;
602
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
603
+ const lastAttempt = attempt === maxAttempts;
604
+ if (attempt > 1) {
605
+ await this.page.goto(workspaceUrl, { waitUntil: 'domcontentloaded' });
606
+ if (await this.processApplicationPage.openByNameIfPresent(name)) {
607
+ return;
608
+ }
609
+ // The adopt probe may have clicked into an application that then
610
+ // failed to render, so come back to the workspace root: the create
611
+ // controls this attempt needs only exist there.
612
+ await this.page.goto(workspaceUrl, { waitUntil: 'domcontentloaded' });
613
+ }
614
+ try {
615
+ await this.clickCreateProcessApplication();
616
+ await this.processApplicationPage.nameNewProcessApplication(name, lastAttempt ? 90000 : 45000);
617
+ return;
618
+ }
619
+ catch (error) {
620
+ if (lastAttempt) {
621
+ throw error;
622
+ }
623
+ console.warn(`Process application "${name}" did not open ` +
624
+ `on attempt ${attempt}/${maxAttempts}; retrying the creation.`);
625
+ }
626
+ }
627
+ }
628
+ // Which control creates a process application depends on the hub version
629
+ // under test. Since camunda/camunda-hub#25831 it is a plain primary button on
630
+ // the workspace root, and the "Create new" menu explicitly hides the item
631
+ // (hideProcessApplication) because a process application is no longer just
632
+ // another resource. Before that change the menu item was the only way in.
633
+ // Race both entry points so neither version pays a full timeout, then use
634
+ // whichever one rendered.
635
+ async clickCreateProcessApplication() {
636
+ const button = this.processApplicationPage.createProcessApplicationButton;
637
+ const rootLoaded = await this.becameVisible(button.or(this.diagramTypeDropdown).first(), 60000);
638
+ if (!rootLoaded) {
639
+ await this.page.reload();
640
+ await this.page.waitForLoadState('domcontentloaded');
641
+ // Re-run the joint probe after the reload. The short confirmation below
642
+ // assumes the workspace root has already rendered one of the two entry
643
+ // points, which straight after a reload it has not: probing the button
644
+ // alone for 5s there reported "absent" on a root that was merely still
645
+ // loading, sent the flow down the create-menu branch, and waited out its
646
+ // full 60s on a `[data-test="diagram-dropdown"]` that the empty-state
647
+ // root never renders.
648
+ await this.becameVisible(button.or(this.diagramTypeDropdown).first(), 60000);
649
+ }
650
+ // Short: the joint probe above already settled which branch rendered, and
651
+ // hub renders exactly one of them (EntityTable renders the toolbar's create
652
+ // menu OR the empty state, never both), so this only confirms which.
653
+ if (await this.becameVisible(button, 5000)) {
654
+ await this.processApplicationPage.clickCreateProcessApplicationButton();
655
+ return;
656
+ }
657
+ await this.clickWorkspaceDiagramTypeDropdown();
658
+ await this.processApplicationPage.clickCreateProcessApplicationOption();
659
+ }
660
+ // Re-enters this test's container if it already has one, without creating
661
+ // one: opening an existing resource must not have the side effect of
662
+ // creating a container for a spec that never asked for it.
663
+ async ensureInResourceContainer() {
664
+ if (!this.processApplicationUrl) {
665
+ return;
666
+ }
667
+ await this.enterResourceContainer();
668
+ }
669
+ // Navigates back to this test's process application by the remembered URL
670
+ // rather than by a breadcrumb click: hub renders no process-application
671
+ // breadcrumb on a diagram page at container root, and the breadcrumb that
672
+ // does exist on the container page doubles as its rename control. Hub's own
673
+ // Playwright suite navigates back the same way.
674
+ async returnToResourceContainer() {
675
+ if (!this.processApplicationUrl) {
676
+ await this.clickWorkspaceBreadcrumb();
677
+ return;
678
+ }
679
+ // Every goto re-runs Hub's Auth0 hand-off, and CI runs show it stalling on
680
+ // /login-callback. Its code is single-use, so recover with a fresh goto,
681
+ // never a reload; any other failure still throws.
682
+ for (let attempt = 1;; attempt++) {
683
+ await this.page.goto(this.processApplicationUrl, {
684
+ waitUntil: 'domcontentloaded',
685
+ });
686
+ try {
687
+ await this.processApplicationPage.waitForProcessApplication(attempt === 1 ? 90000 : 150000);
688
+ break;
689
+ }
690
+ catch (error) {
691
+ const stalledInLogin = (await (0, sessionRecovery_1.restoreSessionIfLoggedOut)(this.page)) ||
692
+ this.isOnHubLoginRoute();
693
+ if (attempt === 2 || !stalledInLogin) {
694
+ throw error;
695
+ }
696
+ console.warn(`Hub's login hand-off stalled at ${this.page.url()}; ` +
697
+ 're-entering the process application.');
698
+ }
699
+ }
700
+ await this.dismissBlockingDialog();
701
+ }
702
+ // Hub's own /login and /login-callback routes render only a spinner
703
+ // (camunda-hub App.tsx); the identity provider's pages are not these.
704
+ isOnHubLoginRoute() {
705
+ if ((0, sessionRecovery_1.isAtIdentityProvider)(this.page)) {
706
+ return false;
707
+ }
708
+ return /^\/login(-callback)?\/?$/.test(new URL(this.page.url()).pathname);
709
+ }
710
+ // Single seam for "give me an empty BPMN diagram in this test's container".
711
+ // A process application always ships an auto-created main process; this adds
712
+ // a new diagram rather than adopting that one, so every existing modelling
713
+ // assertion keeps its current subject.
714
+ async startBlankBpmnDiagram() {
715
+ await this.clickDiagramTypeDropdown();
716
+ await this.clickBpmnTemplateOption();
717
+ }
718
+ // Boolean visibility probe. waitFor rather than isVisible, which resolves
719
+ // immediately and would report a false negative on a still-rendering page.
720
+ async becameVisible(locator, timeout) {
721
+ return locator
722
+ .waitFor({ state: 'visible', timeout })
723
+ .then(() => true)
724
+ .catch(() => false);
725
+ }
726
+ // Drives Camunda Hub's workspace-creation wizard. The name is entered on
727
+ // the General step, which enables "Next"; the same submit button then
728
+ // relabels itself through the remaining steps and finally reads "Create
729
+ // workspace" once it creates the workspace and routes the creator into its
730
+ // projects listing. Gate the Members-step click on that step becoming
731
+ // active so the shared submit button is not clicked twice while still on
732
+ // General.
733
+ async createWorkspaceViaWizard(name) {
734
+ await this.dismissOverlays();
735
+ await this.createWorkspaceButton.click({ timeout: 60000 });
736
+ await this.workspaceWizardNameInput.fill(name, { timeout: 60000 });
737
+ await this.workspaceWizardSubmitButton.click({ timeout: 60000 });
738
+ await (0, test_1.expect)(this.workspaceWizardMembersStep).toHaveAttribute('data-state', 'active', { timeout: 30000 });
739
+ await this.workspaceWizardSubmitButton.click({ timeout: 60000 });
740
+ // When the org has environments enabled, this only advances the wizard
741
+ // into an "Assign environments" step instead of submitting. Assign the
742
+ // suite's default cluster here rather than submitting with an empty
743
+ // selection -- otherwise this shared workspace starts with no
744
+ // environments and every downstream spec that deploys to it needs its
745
+ // own manual assignment first. Each card's accessible name is
746
+ // "Select <cluster name>" before it is picked (camunda-hub's own
747
+ // create-workspace-environments.spec.tsx asserts the same pattern).
748
+ // isVisible() only samples the current state -- if the wizard's step
749
+ // transition hasn't rendered yet at that exact instant, this would
750
+ // wrongly conclude the org has no environments step and immediately
751
+ // wait for the post-submit URL while the wizard is actually still open
752
+ // (mid-transition), timing out every workspace creation. Give the step
753
+ // transition a bounded wait instead of an instantaneous probe.
754
+ if (await this.becameVisible(this.workspaceWizardEnvironmentsHeading, 5000)) {
755
+ // "Create Default Cluster" runs in parallel with this flow
756
+ // (test-setup.spec.ts's mode: 'parallel'), so the cluster this picker
757
+ // lists may still be provisioning -- wait for it a generous 90s rather
758
+ // than sampling once. If it genuinely never appears (the cluster
759
+ // failed rather than just being slow), don't fail the whole shared
760
+ // workspace's setup over it: Hub's own recovery copy for this step
761
+ // ("Could not load environments. You can finish creating the
762
+ // workspace and assign them later.") confirms submitting unassigned
763
+ // is a supported, recoverable path, not a broken one.
764
+ const clusterOption = this.page.getByRole('button', {
765
+ name: new RegExp(`^Select ${this.defaultClusterName}`),
766
+ });
767
+ if (await this.becameVisible(clusterOption, 90000)) {
768
+ await clusterOption.click({ timeout: 10000 });
769
+ }
770
+ else {
771
+ console.warn(`"${this.defaultClusterName}" was not selectable on the Environments step; creating the workspace without it.`);
772
+ }
773
+ await this.workspaceWizardSubmitButton.click({ timeout: 60000 });
774
+ }
775
+ await this.page.waitForURL(/\/workspaces?\/[^/]+\/projects/, {
776
+ timeout: 120000,
777
+ });
778
+ }
779
+ async clickHomeBreadcrumb() {
780
+ // Camunda Hub has no Modeler home breadcrumb: its home is the Workspaces
781
+ // overview, reached through the header logo link so the SPA keeps its
782
+ // in-memory session (a full navigation re-runs the whole Auth0 hand-off).
783
+ // The link's accessible name is "Camunda Hub home" when the org has
784
+ // workspacesEnabled, else "Camunda Modeler home" (camunda-hub
785
+ // NavShellDs.common.tsx) -- match either.
786
+ if (new URL(this.page.url()).hostname.startsWith('hub.')) {
787
+ // The authenticated header can still expose this same link with its
788
+ // href pointed at /login while the header is mid-update (same race
789
+ // modelerPageBanner already guards against) -- clicking it then sends
790
+ // the flow back through Auth0 and drops the session.
791
+ await this.page
792
+ .locator('header[data-slot="app-header"]')
793
+ .getByRole('link', { name: 'Camunda Hub home' })
794
+ .and(this.page.locator(':not([href$="/login"])'))
795
+ .or(this.page
796
+ .locator('header[data-slot="app-header"]')
797
+ .getByRole('link', { name: 'Camunda Modeler home' })
798
+ .and(this.page.locator(':not([href$="/login"])')))
799
+ .first()
800
+ .click({ timeout: 30000 });
801
+ return;
802
+ }
803
+ try {
804
+ await this.homeBreadcrumb.click();
805
+ }
806
+ catch (error) {
807
+ await this.page.getByText('Home', { exact: true }).first().click();
808
+ }
809
+ }
810
+ // An announcement dialog covering the Modeler header makes every click on the
811
+ // org button bounce off the modal layer ("intercepts pointer events") until
812
+ // the timeout, so dismiss it before each attempt instead of waiting out a
813
+ // fixed sleep and hoping the header is clear.
814
+ async clickOpenOrganizationsButton() {
815
+ await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.openOrganizationsButton, {
816
+ preAction: async () => {
817
+ await this.dismissBlockingDialog();
818
+ },
819
+ totalTimeout: 120000,
820
+ visibilityTimeout: 30000,
821
+ });
822
+ }
823
+ async createForm(formName) {
824
+ await this.clickDiagramTypeDropdown();
825
+ await this.clickFormOption();
826
+ await this.enterFormName(formName);
827
+ await (0, sleep_1.sleep)(10000);
828
+ }
829
+ async clickCreateIdpApplicationButton() {
830
+ await this.createIdpApplicationButton.click();
831
+ }
832
+ async clickCrossComponentProjectFolder() {
833
+ await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.crossComponentProjectFolder, {
834
+ visibilityTimeout: 60000,
835
+ // Widened from 180s: dismissing the announcement dialog costs up to ~25s
836
+ // of settle-and-probe per attempt, which at 180s left room for barely one
837
+ // retry after an intercepted click had already burnt its 60s. 240s was
838
+ // still short of what maxRetries asks for -- preAction (~40s) plus the
839
+ // 60s visibility budget makes an attempt cost ~100s, so the helper gave
840
+ // up "after 3 attempts" with two retries left unused. Budget for the
841
+ // retries it is configured for, while still leaving room inside the test
842
+ // timeout for the helper's own error to be the one reported.
843
+ totalTimeout: 540000,
844
+ maxRetries: 5,
845
+ preAction: async () => {
846
+ // Dismiss the dialog BEFORE the banner: the Modeler home page can
847
+ // stack both at once, and clickMessageBanner resolves an
848
+ // `.or(...).first()` union in DOM order — the top banner comes first,
849
+ // so on its own it closes the banner and leaves the dialog open.
850
+ await this.dismissBlockingDialog();
851
+ await this.clickMessageBanner();
852
+ // postAction's reload resets Hub's scope filter to "My workspaces".
853
+ // Let a failed scope switch propagate like dismissBlockingDialog()
854
+ // and clickMessageBanner() above -- clickLocatorWithRetry's own
855
+ // preAction handling already logs and retries it; swallowing it here
856
+ // would otherwise leave the tile wait running against the wrong
857
+ // ("My workspaces") scope for its full visibilityTimeout.
858
+ await this.showAllWorkspaces(5000);
859
+ },
860
+ postAction: async () => {
861
+ // The project tile only renders on the Modeler home page. A failure
862
+ // that leaves the browser inside the project makes the tile unreachable
863
+ // by construction, so reloading the same URL cannot help and every
864
+ // remaining attempt just waits out its 60s visibility timeout before
865
+ // the helper throws. Step back out to home first.
866
+ const tileVisible = await this.becameVisible(this.crossComponentProjectFolder, 2000);
867
+ if (!tileVisible &&
868
+ (await this.becameVisible(this.homeBreadcrumb, 5000))) {
869
+ await this.homeBreadcrumb.click({ timeout: 15000 });
870
+ }
871
+ await this.page.reload();
872
+ await this.page.waitForLoadState('domcontentloaded');
873
+ },
874
+ });
875
+ }
876
+ // Hub's "Create workspace" CTA is a persistent toolbar button, rendered
877
+ // regardless of whether the existing-workspaces list has finished loading
878
+ // -- so a single slow or failed list fetch must not be read as "no
879
+ // workspace exists yet". Retry the wait once after a reload before
880
+ // concluding the folder is genuinely absent, since creating one when it
881
+ // already exists (just hadn't rendered) leaves a permanent duplicate that
882
+ // breaks every later run for that user.
883
+ async waitForCrossComponentProjectFolder() {
884
+ for (let attempt = 0; attempt < 2; attempt++) {
885
+ await this.showAllWorkspaces(10000);
886
+ const found = await this.crossComponentProjectFolder
887
+ .waitFor({ state: 'visible', timeout: 60000 })
888
+ .then(() => true)
889
+ .catch(() => false);
890
+ if (found)
891
+ return true;
892
+ if (attempt === 0) {
893
+ await this.page.reload();
894
+ // Bounded: Hub keeps background requests open, so an unbounded
895
+ // networkidle wait never settled and hung here for ~7 minutes until
896
+ // the test timeout (run 36372848529).
897
+ await this.page
898
+ .waitForLoadState('networkidle', { timeout: 15000 })
899
+ .catch(() => { });
900
+ }
901
+ }
902
+ return false;
903
+ }
904
+ // Since camunda-hub #28956 the Workspaces overview defaults org-elevated
905
+ // users to "My workspaces" -- only workspaces they are an explicit member
906
+ // of -- and resets to it on every load. The shared folder is created by
907
+ // whichever test user wins the race, so every other user sees "No
908
+ // workspaces match this filter" and never finds it. Widen the scope to
909
+ // "All workspaces" first. The control is absent outside Hub and for
910
+ // non-elevated users (their list is membership-scoped anyway), so a missing
911
+ // control is a no-op.
912
+ async showAllWorkspaces(probeTimeout) {
913
+ const scopeFilter = this.page.getByRole('combobox', {
914
+ name: 'Filter workspaces',
915
+ });
916
+ if (!(await this.becameVisible(scopeFilter, probeTimeout)))
917
+ return;
918
+ if ((await scopeFilter.innerText()).includes('All workspaces'))
919
+ return;
920
+ await scopeFilter.click({ timeout: 10000 });
921
+ await this.page
922
+ .getByRole('option', { name: 'All workspaces' })
923
+ .click({ timeout: 10000 });
924
+ await (0, test_1.expect)(scopeFilter).toContainText('All workspaces', {
925
+ timeout: 10000,
926
+ });
927
+ }
928
+ // Retries the whole detect-or-create sequence, not just its individual
929
+ // steps. Up to 27 test-user workers race to create/open this one shared
930
+ // workspace concurrently, and a losing worker can land on a workspace-root
931
+ // page that never finishes rendering (neither the folder tile nor a create
932
+ // control ever becomes visible) for reasons the per-step probes/reloads
933
+ // below cannot resolve on their own -- each step bounds itself, but their
934
+ // sum does not bound the whole method, and a single unlucky pass used to
935
+ // run long enough to hit the 12-minute test timeout outright (run
936
+ // 36110457453 lost 6 "Create Project Folder" tests this way, pending
937
+ // inside a reload with no error of its own -- the test timeout fired
938
+ // first). Mirrors the 8.9 sibling's outer retry loop, which this method
939
+ // lost when it grew its own per-step reload-retries in place of it.
940
+ async createCrossComponentProjectFolder() {
941
+ const maxAttempts = 3;
942
+ for (let attempt = 0; attempt < maxAttempts; attempt++) {
943
+ await this.dismissOverlays();
944
+ // The projects list renders asynchronously, so an instantaneous
945
+ // isVisible() reports "missing" whenever the list is still loading — and
946
+ // this method then creates a SECOND project with the same name. Those
947
+ // duplicates are permanent and break every subsequent run for that user,
948
+ // so wait for the folder to actually show up before concluding it is
949
+ // absent (this also replaces the blind 15s sleep the check relied on).
950
+ // Re-checked on every attempt: a sibling worker may finish creating the
951
+ // folder while this one is retrying.
952
+ const folderExists = await this.waitForCrossComponentProjectFolder();
953
+ if (folderExists) {
954
+ console.log('Cross Component Project folder already exists. Clicking into it');
955
+ await this.clickCrossComponentProjectFolder();
956
+ return;
957
+ }
958
+ try {
959
+ // Same joint-probe pattern as clickCreateProcessApplication above: a
960
+ // single ORed probe with a generous timeout settles which shell
961
+ // actually rendered (Hub's "Create workspace" empty state vs. the
962
+ // legacy "New project" / "Create project" button) before a short
963
+ // confirmation decides the branch. A live CI trace showed probing
964
+ // createWorkspaceButton alone for 5s racing Hub's slower loads under
965
+ // worker contention: the probe reported "absent" on a workspaces
966
+ // overview that was merely still loading, sending the flow down the
967
+ // legacy branch -- which that overview never renders.
968
+ const rootLoaded = await this.becameVisible(this.createWorkspaceButton.or(this.createNewProjectButton).first(), 60000);
969
+ if (!rootLoaded) {
970
+ // Mirrors clickCreateProcessApplication's own reload-retry: a reload
971
+ // gives one more 60s window in case the root was still loading
972
+ // rather than genuinely absent, instead of committing to the wrong
973
+ // branch.
974
+ await this.page.reload();
975
+ await this.page.waitForLoadState('domcontentloaded');
976
+ await this.becameVisible(this.createWorkspaceButton.or(this.createNewProjectButton).first(), 60000);
977
+ }
978
+ if (await this.becameVisible(this.createWorkspaceButton, 5000)) {
979
+ await this.createWorkspaceViaWizard(this.defaultFolderName);
980
+ return;
981
+ }
982
+ await this.clickCreateNewProjectButton();
983
+ await this.enterNewProjectName(this.defaultFolderName);
984
+ // Both branches must leave the browser inside the workspace: the
985
+ // callers go straight on to clickDiagramTypeDropdown(), whose create
986
+ // control only exists there. Creating normally navigates into the new
987
+ // project, but when hub leaves the browser on the projects list the
988
+ // rename happens in the row and no navigation follows.
989
+ //
990
+ // Keyed on "New project", which hub renders only on the projects list
991
+ // and never inside an open project, so it answers which view we are
992
+ // on directly. The folder tile is the wrong signal: on a slow list
993
+ // render it is still absent, which would read as "already inside" and
994
+ // skip a hop that was needed.
995
+ if (await this.becameVisible(this.createNewProjectButton, 5000)) {
996
+ await this.clickCrossComponentProjectFolder();
997
+ }
998
+ return;
999
+ }
1000
+ catch (error) {
1001
+ if (attempt >= maxAttempts - 1) {
1002
+ throw error;
1003
+ }
1004
+ // The stuck-root case above, or a wizard/rename step that threw, can
1005
+ // leave the browser on a half-loaded or errored page that retrying
1006
+ // in place cannot recover from. Return Home so the next attempt's
1007
+ // existence check starts clean, instead of retrying against the same
1008
+ // stuck page.
1009
+ await this.clickHomeBreadcrumb().catch(() => { });
1010
+ console.log(`createCrossComponentProjectFolder attempt ${attempt + 1} failed; retrying...`);
1011
+ }
1012
+ }
1013
+ }
1014
+ async clickManageButton(retries = 3) {
1015
+ await this.optionsButton.click({ timeout: 30000 });
1016
+ for (let i = 0; i < retries; i++) {
1017
+ try {
1018
+ await (0, sleep_1.sleep)(5000);
1019
+ if (await this.manageButton.isVisible({ timeout: 30000 })) {
1020
+ await this.manageButton.click({ timeout: 10000 });
1021
+ }
1022
+ else {
1023
+ await this.clickOpenOrganizationsButton();
1024
+ await this.optionsButton.click({ timeout: 30000 });
1025
+ await (0, test_1.expect)(this.manageButton).toBeVisible({ timeout: 30000 });
1026
+ await this.manageButton.click({ timeout: 30000 });
1027
+ }
1028
+ return;
1029
+ }
1030
+ catch (error) {
1031
+ await (0, sleep_1.sleep)(10000);
1032
+ }
1033
+ }
1034
+ throw new Error(`Failed to click manage button after ${retries} retries`);
1035
+ }
1036
+ async clickUploadFilesButton() {
1037
+ await this.uploadFilesButton.click({ timeout: 60000 });
1038
+ }
1039
+ // The release-announcement dialog ("New features" / "Check out our new
1040
+ // release") renders over the projects list and swallows every click on it:
1041
+ // Playwright reports the project link as visible, enabled and stable, then
1042
+ // times out with the modal overlay "intercepts pointer events". Pressing
1043
+ // Escape blindly does not help — Carbon only closes the dialog when focus is
1044
+ // inside it, and focus sits on the body after a page load — so close it via
1045
+ // its own controls and confirm it is gone before moving on.
1046
+ // Anchored on the dismiss button rather than on the dialog: the Modeler home
1047
+ // page keeps half a dozen `role="dialog"` containers mounted and hidden, so a
1048
+ // dialog-first lookup resolves to a hidden one and reports "nothing to
1049
+ // dismiss" while the announcement is still covering the projects list.
1050
+ //
1051
+ // The dialog is also mounted a beat after the projects list, so let the page
1052
+ // settle before looking for it: probing the instant a load finishes lost that
1053
+ // race on about half the attempts, and the dialog that appeared right after
1054
+ // then swallowed the click.
1055
+ async dismissBlockingDialog() {
1056
+ await this.page
1057
+ .waitForLoadState('networkidle', { timeout: 15000 })
1058
+ .catch(() => false);
1059
+ for (let attempt = 0; attempt < 3; attempt++) {
1060
+ const isOpen = await this.becameVisible(this.closeButton, 10000);
1061
+ // `break`, not `return`: a modal without a "Got it" control is exactly
1062
+ // the case the generic pass below exists for, and returning here is what
1063
+ // let it through.
1064
+ if (!isOpen)
1065
+ break;
1066
+ await this.closeButton.click({ timeout: 5000 }).catch(() => { });
1067
+ await this.closeButton
1068
+ .waitFor({ state: 'hidden', timeout: 5000 })
1069
+ .catch(() => false);
1070
+ }
1071
+ await this.dismissUncataloguedDialog();
1072
+ }
1073
+ // Second pass for a modal the label-based probe above cannot see. Kept cheap
1074
+ // because `dismissBlockingDialog` is called from a dozen places on the happy
1075
+ // path: when nothing is open this costs one 2s probe, so it cannot turn into
1076
+ // the kind of hidden budget the Optimize retry sizing did.
1077
+ async dismissUncataloguedDialog() {
1078
+ for (let attempt = 0; attempt < 2; attempt++) {
1079
+ if (!(await this.becameVisible(this.blockingDialog, 2000)))
1080
+ return;
1081
+ if (!(await this.becameVisible(this.blockingDialogDismiss, 2000))) {
1082
+ // Nothing safe to click. Leave it rather than guess: pressing Escape
1083
+ // blindly does not close a Carbon dialog (focus sits on the body after
1084
+ // a load), and clicking an unrecognised footer button could confirm
1085
+ // something. The caller's own assertion then reports the real blocker.
1086
+ return;
1087
+ }
1088
+ await this.blockingDialogDismiss.click({ timeout: 5000 }).catch(() => { });
1089
+ const closed = await this.blockingDialog
1090
+ .waitFor({ state: 'hidden', timeout: 5000 })
1091
+ .then(() => true)
1092
+ .catch(() => false);
1093
+ if (closed)
1094
+ return;
1095
+ }
1096
+ }
1097
+ async clickMessageBanner() {
1098
+ try {
1099
+ const button = this.messageBanner.or(this.closeButton).first();
1100
+ await (0, test_1.expect)(button).toBeVisible({ timeout: 15000 });
1101
+ await button.click();
1102
+ }
1103
+ catch {
1104
+ console.log('No banner or close button found to click');
1105
+ }
1106
+ }
1107
+ async selectCluster(clusterName) {
1108
+ //Select the correct cluster if multiple exist
1109
+ const baseClusterName = clusterName.split('(')[0].trim();
1110
+ // With Hub's Environments feature on (camunda-hub#29210) the IDP create
1111
+ // dialog picks an Environment row instead of a cluster toggle.
1112
+ const hasEnvironmentRow = await this.becameVisible(this.dialog.locator('[data-test^="environment-row-"]').first(), 10000);
1113
+ if (hasEnvironmentRow) {
1114
+ await (0, modelerCluster_1.selectDeployEnvironment)(this.dialog, baseClusterName);
1115
+ return;
1116
+ }
1117
+ const cluster = this.dialog.getByText(new RegExp(`^${baseClusterName}`));
1118
+ await (0, test_1.expect)(cluster).toBeVisible({
1119
+ timeout: 30000,
1120
+ });
1121
+ await cluster.click();
1122
+ await (0, test_1.expect)(this.dialog
1123
+ .locator('label')
1124
+ .filter({
1125
+ hasText: new RegExp(`^${clusterName}`),
1126
+ })
1127
+ .getByRole('switch')).toBeChecked({ timeout: 30000 });
1128
+ }
1129
+ async clickIdpApplicationTemplateOption() {
1130
+ await this.idpTemplateOption.click({ timeout: 120000 });
1131
+ }
1132
+ // Which control starts an IDP application depends on whether the workspace
1133
+ // root already holds a resource: hub's EntityTable renders the toolbar's
1134
+ // create menu OR the empty state, never both (the same split
1135
+ // clickCreateProcessApplication has to straddle). A workspace whose very
1136
+ // first resource is the IDP application only ever offers the empty state's
1137
+ // "Create IDP application" button, so waiting for the create menu there
1138
+ // times out on `[data-test="diagram-dropdown"]`. Hub's workspace projects
1139
+ // page has neither: IDP projects are created from their own tab. Race all
1140
+ // entry points, then use whichever one rendered.
1141
+ async startIdpApplicationCreation() {
1142
+ const rootLoaded = await this.becameVisible(this.idpEmptyStateButton
1143
+ .or(this.diagramTypeDropdown)
1144
+ .or(this.idpProjectsTab)
1145
+ .first(), 60000);
1146
+ if (!rootLoaded) {
1147
+ await this.page.reload();
1148
+ }
1149
+ if (await this.becameVisible(this.idpProjectsTab, 5000)) {
1150
+ await this.idpProjectsTab.click({ timeout: 30000 });
1151
+ await (0, test_1.expect)(this.createIdpProjectButton).toBeVisible({ timeout: 60000 });
1152
+ await this.createIdpProjectButton.click({ timeout: 30000 });
1153
+ return;
1154
+ }
1155
+ if (await this.becameVisible(this.idpEmptyStateButton, 5000)) {
1156
+ await this.idpEmptyStateButton.click({ timeout: 60000 });
1157
+ return;
1158
+ }
1159
+ await this.clickWorkspaceDiagramTypeDropdown();
1160
+ await this.clickIdpApplicationTemplateOption();
1161
+ }
1162
+ async assertFormBreadcrumbVisible(formName) {
1163
+ await (0, test_1.expect)(this.formNameBreadcrumb(formName)).toBeVisible({
1164
+ timeout: 120000,
1165
+ });
1166
+ }
1167
+ }
1168
+ exports.ModelerHomePage = ModelerHomePage;