@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.
- package/.github/c8_versions.json +1 -0
- package/README.md +1 -0
- package/dist/fixtures/8.11.d.ts +83 -0
- package/dist/fixtures/8.11.js +203 -0
- package/dist/pages/8.11/AppsPage.d.ts +60 -0
- package/dist/pages/8.11/AppsPage.js +1060 -0
- package/dist/pages/8.11/AuditLogPage.d.ts +14 -0
- package/dist/pages/8.11/AuditLogPage.js +69 -0
- package/dist/pages/8.11/Authorization.d.ts +44 -0
- package/dist/pages/8.11/Authorization.js +409 -0
- package/dist/pages/8.11/ClientCredentialsDetailsPage.d.ts +12 -0
- package/dist/pages/8.11/ClientCredentialsDetailsPage.js +36 -0
- package/dist/pages/8.11/ClusterDetailsPage.d.ts +107 -0
- package/dist/pages/8.11/ClusterDetailsPage.js +892 -0
- package/dist/pages/8.11/ClusterPage.d.ts +96 -0
- package/dist/pages/8.11/ClusterPage.js +657 -0
- package/dist/pages/8.11/ClusterSecretsPage.d.ts +48 -0
- package/dist/pages/8.11/ClusterSecretsPage.js +406 -0
- package/dist/pages/8.11/ConnectorMarketplacePage.d.ts +29 -0
- package/dist/pages/8.11/ConnectorMarketplacePage.js +156 -0
- package/dist/pages/8.11/ConnectorSettingsPage.d.ts +39 -0
- package/dist/pages/8.11/ConnectorSettingsPage.js +150 -0
- package/dist/pages/8.11/ConnectorTemplatePage.d.ts +11 -0
- package/dist/pages/8.11/ConnectorTemplatePage.js +34 -0
- package/dist/pages/8.11/ConsoleOrganizationPage.d.ts +77 -0
- package/dist/pages/8.11/ConsoleOrganizationPage.js +457 -0
- package/dist/pages/8.11/DataFiltersPage.d.ts +30 -0
- package/dist/pages/8.11/DataFiltersPage.js +135 -0
- package/dist/pages/8.11/FormJsPage.d.ts +38 -0
- package/dist/pages/8.11/FormJsPage.js +283 -0
- package/dist/pages/8.11/HomePage.d.ts +29 -0
- package/dist/pages/8.11/HomePage.js +176 -0
- package/dist/pages/8.11/IdpCreatePage.d.ts +118 -0
- package/dist/pages/8.11/IdpCreatePage.js +514 -0
- package/dist/pages/8.11/LoginPage.d.ts +45 -0
- package/dist/pages/8.11/LoginPage.js +214 -0
- package/dist/pages/8.11/ModelerCreatePage.d.ts +256 -0
- package/dist/pages/8.11/ModelerCreatePage.js +2272 -0
- package/dist/pages/8.11/ModelerHomePage.d.ts +100 -0
- package/dist/pages/8.11/ModelerHomePage.js +1168 -0
- package/dist/pages/8.11/ModelerUserInvitePage.d.ts +29 -0
- package/dist/pages/8.11/ModelerUserInvitePage.js +136 -0
- package/dist/pages/8.11/OCIdentityAuthorizationsPage.d.ts +11 -0
- package/dist/pages/8.11/OCIdentityAuthorizationsPage.js +25 -0
- package/dist/pages/8.11/OCIdentityClusterVariablesPage.d.ts +21 -0
- package/dist/pages/8.11/OCIdentityClusterVariablesPage.js +128 -0
- package/dist/pages/8.11/OCIdentityGroupsPage.d.ts +38 -0
- package/dist/pages/8.11/OCIdentityGroupsPage.js +176 -0
- package/dist/pages/8.11/OCIdentityHomePage.d.ts +21 -0
- package/dist/pages/8.11/OCIdentityHomePage.js +111 -0
- package/dist/pages/8.11/OCIdentityMappingRulesPage.d.ts +23 -0
- package/dist/pages/8.11/OCIdentityMappingRulesPage.js +124 -0
- package/dist/pages/8.11/OCIdentityRolesPage.d.ts +43 -0
- package/dist/pages/8.11/OCIdentityRolesPage.js +236 -0
- package/dist/pages/8.11/OperateHomePage.d.ts +28 -0
- package/dist/pages/8.11/OperateHomePage.js +150 -0
- package/dist/pages/8.11/OperateProcessInstancePage.d.ts +43 -0
- package/dist/pages/8.11/OperateProcessInstancePage.js +893 -0
- package/dist/pages/8.11/OperateProcessesPage.d.ts +28 -0
- package/dist/pages/8.11/OperateProcessesPage.js +153 -0
- package/dist/pages/8.11/OptimizeCollectionsPage.d.ts +30 -0
- package/dist/pages/8.11/OptimizeCollectionsPage.js +175 -0
- package/dist/pages/8.11/OptimizeDashboardPage.d.ts +11 -0
- package/dist/pages/8.11/OptimizeDashboardPage.js +71 -0
- package/dist/pages/8.11/OptimizeHomePage.d.ts +17 -0
- package/dist/pages/8.11/OptimizeHomePage.js +171 -0
- package/dist/pages/8.11/OptimizeReportPage.d.ts +49 -0
- package/dist/pages/8.11/OptimizeReportPage.js +184 -0
- package/dist/pages/8.11/OptimizeSharePage.d.ts +16 -0
- package/dist/pages/8.11/OptimizeSharePage.js +100 -0
- package/dist/pages/8.11/PlayPage.d.ts +17 -0
- package/dist/pages/8.11/PlayPage.js +157 -0
- package/dist/pages/8.11/ProcessApplicationPage.d.ts +32 -0
- package/dist/pages/8.11/ProcessApplicationPage.js +496 -0
- package/dist/pages/8.11/SettingsPage.d.ts +10 -0
- package/dist/pages/8.11/SettingsPage.js +53 -0
- package/dist/pages/8.11/SignUpPage.d.ts +42 -0
- package/dist/pages/8.11/SignUpPage.js +134 -0
- package/dist/pages/8.11/TaskDetailsPage.d.ts +77 -0
- package/dist/pages/8.11/TaskDetailsPage.js +324 -0
- package/dist/pages/8.11/TaskPanelPage.d.ts +26 -0
- package/dist/pages/8.11/TaskPanelPage.js +245 -0
- package/dist/pages/8.11/TaskProcessesPage.d.ts +18 -0
- package/dist/pages/8.11/TaskProcessesPage.js +134 -0
- package/dist/pages/8.11/UtilitiesPage.d.ts +56 -0
- package/dist/pages/8.11/UtilitiesPage.js +1024 -0
- package/dist/pages/8.11/WorkspaceMembersPage.d.ts +21 -0
- package/dist/pages/8.11/WorkspaceMembersPage.js +268 -0
- package/dist/tests/8.11/access-user-role-management.spec.d.ts +1 -0
- package/dist/tests/8.11/access-user-role-management.spec.js +487 -0
- package/dist/tests/8.11/agentic-ai-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/agentic-ai-user-flows.spec.js +209 -0
- package/dist/tests/8.11/aws-cluster-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/aws-cluster-user-flows.spec.js +188 -0
- package/dist/tests/8.11/aws-connectors-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/aws-connectors-user-flows.spec.js +167 -0
- package/dist/tests/8.11/cluster-variables.spec.d.ts +1 -0
- package/dist/tests/8.11/cluster-variables.spec.js +202 -0
- package/dist/tests/8.11/connectors-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/connectors-user-flows.spec.js +537 -0
- package/dist/tests/8.11/console-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/console-user-flows.spec.js +199 -0
- package/dist/tests/8.11/hto-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/hto-user-flows.spec.js +358 -0
- package/dist/tests/8.11/idp-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/idp-user-flows.spec.js +316 -0
- package/dist/tests/8.11/login-negative-tests.spec.d.ts +1 -0
- package/dist/tests/8.11/login-negative-tests.spec.js +29 -0
- package/dist/tests/8.11/login.spec.d.ts +1 -0
- package/dist/tests/8.11/login.spec.js +29 -0
- package/dist/tests/8.11/navigation.spec.d.ts +1 -0
- package/dist/tests/8.11/navigation.spec.js +59 -0
- package/dist/tests/8.11/operate-access-flow.spec.d.ts +1 -0
- package/dist/tests/8.11/operate-access-flow.spec.js +136 -0
- package/dist/tests/8.11/optimize-agentic-control-panel-api.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-agentic-control-panel-api.spec.js +96 -0
- package/dist/tests/8.11/optimize-agentic-control-panel-ui.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-agentic-control-panel-ui.spec.js +69 -0
- package/dist/tests/8.11/optimize-api-tests.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-api-tests.spec.js +1194 -0
- package/dist/tests/8.11/optimize-collections-api.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-collections-api.spec.js +184 -0
- package/dist/tests/8.11/optimize-collections-ui.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-collections-ui.spec.js +46 -0
- package/dist/tests/8.11/optimize-data-filters-api.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-data-filters-api.spec.js +195 -0
- package/dist/tests/8.11/optimize-data-filters-ui.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-data-filters-ui.spec.js +306 -0
- package/dist/tests/8.11/optimize-exporter-filters-importer-e2e.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-exporter-filters-importer-e2e.spec.js +316 -0
- package/dist/tests/8.11/optimize-sharing-alerts-export-api.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-sharing-alerts-export-api.spec.js +337 -0
- package/dist/tests/8.11/optimize-sharing-alerts-export-ui.spec.d.ts +1 -0
- package/dist/tests/8.11/optimize-sharing-alerts-export-ui.spec.js +198 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-audit-log.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-audit-log.spec.js +146 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-call-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-call-tools.spec.js +208 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-e2e-flow.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-e2e-flow.spec.js +151 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-list-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/api/mcp-processes-list-tools.spec.js +242 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-cluster-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-cluster-tools.spec.js +75 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-incident-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-incident-tools.spec.js +123 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-user-task-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-user-task-tools.spec.js +151 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-variable-tools.spec.d.ts +1 -0
- package/dist/tests/8.11/orchestration-cluster-mcp-server/mcp-variable-tools.spec.js +123 -0
- package/dist/tests/8.11/play.spec.d.ts +1 -0
- package/dist/tests/8.11/play.spec.js +93 -0
- package/dist/tests/8.11/rba-enabled-v2-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/rba-enabled-v2-user-flows.spec.js +495 -0
- package/dist/tests/8.11/saas-migration-path-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/saas-migration-path-user-flows.spec.js +133 -0
- package/dist/tests/8.11/smoke-tests.spec.d.ts +1 -0
- package/dist/tests/8.11/smoke-tests.spec.js +339 -0
- package/dist/tests/8.11/test-setup.spec.d.ts +1 -0
- package/dist/tests/8.11/test-setup.spec.js +256 -0
- package/dist/tests/8.11/web-modeler-user-flows.spec.d.ts +1 -0
- package/dist/tests/8.11/web-modeler-user-flows.spec.js +523 -0
- package/dist/utils/clusterVersions.d.ts +2 -1
- package/dist/utils/clusterVersions.js +1 -0
- package/dist/utils/consoleApiHelpers.js +1 -0
- package/package.json +1 -1
- package/playwright.config.ts +10 -0
|
@@ -0,0 +1,1060 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppsPage = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
const sleep_1 = require("../../utils/sleep");
|
|
6
|
+
const UtilitiesPage_1 = require("../8.11/UtilitiesPage");
|
|
7
|
+
function escapeRegExp(value) {
|
|
8
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
9
|
+
}
|
|
10
|
+
class AppsPage {
|
|
11
|
+
page;
|
|
12
|
+
modelerLink;
|
|
13
|
+
tasklistLink;
|
|
14
|
+
adminLink;
|
|
15
|
+
operateLink;
|
|
16
|
+
optimizeButton;
|
|
17
|
+
adminButton;
|
|
18
|
+
tasklistButton;
|
|
19
|
+
operateButton;
|
|
20
|
+
operateListItem;
|
|
21
|
+
adminListItem;
|
|
22
|
+
optimizeListItem;
|
|
23
|
+
tasklistListItem;
|
|
24
|
+
appSwitcherButton;
|
|
25
|
+
optimizeLink;
|
|
26
|
+
consoleLink;
|
|
27
|
+
camundaComponentsButton;
|
|
28
|
+
camundaAppsButton;
|
|
29
|
+
contextSwitcherButton;
|
|
30
|
+
tasklistMenuItem;
|
|
31
|
+
optimizeMenuItem;
|
|
32
|
+
adminMenuItem;
|
|
33
|
+
operateMenuItem;
|
|
34
|
+
consoleMenuItem;
|
|
35
|
+
modelerMenuItem;
|
|
36
|
+
hubSidebar;
|
|
37
|
+
hubReturnUrl;
|
|
38
|
+
constructor(page) {
|
|
39
|
+
this.page = page;
|
|
40
|
+
// Camunda Hub's persistent "Main navigation" sidebar lists each cluster
|
|
41
|
+
// with its own apps (Operate/Tasklist/Optimize/Identity) as child links
|
|
42
|
+
// -- there is no per-app switcher panel to open on Hub (see
|
|
43
|
+
// clickCamundaApps below). Mirrors pages/8.9/AppsPage.ts.
|
|
44
|
+
this.hubSidebar = page.getByRole('navigation', { name: 'Main navigation' });
|
|
45
|
+
// Hub has no "Modeler" switcher entry; Modeler is Hub's home, behind the
|
|
46
|
+
// header logo link clickModeler() uses (NavShellDs.common.tsx).
|
|
47
|
+
this.modelerLink = page
|
|
48
|
+
.getByRole('link', { name: 'Modeler', exact: true })
|
|
49
|
+
.or(page
|
|
50
|
+
.locator('header[data-slot="app-header"]')
|
|
51
|
+
.getByRole('link', { name: /^Camunda (Modeler|Hub) home$/ }))
|
|
52
|
+
.first();
|
|
53
|
+
this.appSwitcherButton = page.getByLabel('App Switcher');
|
|
54
|
+
this.tasklistLink = page.getByRole('link', { name: 'Tasklist', exact: true });
|
|
55
|
+
this.adminLink = page.getByRole('link', { name: /^(Admin|Identity)$/ });
|
|
56
|
+
this.operateLink = page.getByRole('link', { name: 'Operate', exact: true });
|
|
57
|
+
this.optimizeLink = page.getByRole('link', { name: 'Optimize', exact: true });
|
|
58
|
+
this.consoleLink = page.getByRole('link', { name: 'Console', exact: true });
|
|
59
|
+
this.camundaComponentsButton = page.getByLabel('Camunda components');
|
|
60
|
+
this.camundaAppsButton = page.getByLabel('Camunda apps');
|
|
61
|
+
// Operate's Design System navigation ("nav V2", default-on since
|
|
62
|
+
// camunda/camunda `feat: enable Design System navigation in Operate`)
|
|
63
|
+
// swaps the legacy in-app apps flyout for a breadcrumb context switcher.
|
|
64
|
+
// Its trigger is labelled "Switch context" or "Switch application"
|
|
65
|
+
// depending on the breadcrumb configuration, and each target app is a
|
|
66
|
+
// `menuitemradio` rather than a link.
|
|
67
|
+
this.contextSwitcherButton = page
|
|
68
|
+
.getByRole('button', { name: 'Switch context' })
|
|
69
|
+
.or(page.getByRole('button', { name: 'Switch application' }));
|
|
70
|
+
this.tasklistMenuItem = page.getByRole('menuitemradio', { name: 'Tasklist' });
|
|
71
|
+
this.optimizeMenuItem = page.getByRole('menuitemradio', { name: 'Optimize' });
|
|
72
|
+
this.adminMenuItem = page.getByRole('menuitemradio', {
|
|
73
|
+
name: /^(Admin|Identity)$/, // Identity Should be removed after https://github.com/camunda/camunda/issues/46447 is fixed
|
|
74
|
+
});
|
|
75
|
+
// Admin is on nav V2 too now, so the switcher is also the way OUT of an
|
|
76
|
+
// app and not only the way in. Console and Modeler are org-level entries
|
|
77
|
+
// of the same dropdown (`CamundaAppKey` in @camunda/design-system covers
|
|
78
|
+
// operate | tasklist | optimize | admin | identity | modeler | console),
|
|
79
|
+
// so all three need the `menuitemradio` shape their link-role
|
|
80
|
+
// counterparts above no longer have.
|
|
81
|
+
this.operateMenuItem = page.getByRole('menuitemradio', { name: 'Operate' });
|
|
82
|
+
this.consoleMenuItem = page.getByRole('menuitemradio', { name: 'Console' });
|
|
83
|
+
this.modelerMenuItem = page.getByRole('menuitemradio', { name: 'Modeler' });
|
|
84
|
+
this.tasklistListItem = this.page
|
|
85
|
+
.getByRole('listitem')
|
|
86
|
+
.filter({ hasText: 'Tasklist' });
|
|
87
|
+
this.optimizeListItem = this.page
|
|
88
|
+
.getByRole('listitem')
|
|
89
|
+
.filter({ hasText: 'Optimize' });
|
|
90
|
+
this.operateListItem = this.page
|
|
91
|
+
.getByRole('listitem')
|
|
92
|
+
.filter({ hasText: 'Operate' });
|
|
93
|
+
this.adminListItem = this.page
|
|
94
|
+
.getByRole('listitem')
|
|
95
|
+
.filter({ hasText: /Admin|Identity/ }); // Identity Should be removed after https://github.com/camunda/camunda/issues/46447 is fixed
|
|
96
|
+
this.operateButton = page.getByRole('button', {
|
|
97
|
+
name: 'Operate',
|
|
98
|
+
exact: true,
|
|
99
|
+
});
|
|
100
|
+
this.optimizeButton = page.getByRole('button', {
|
|
101
|
+
name: 'Optimize',
|
|
102
|
+
exact: true,
|
|
103
|
+
});
|
|
104
|
+
this.tasklistButton = page.getByRole('button', {
|
|
105
|
+
name: 'Tasklist',
|
|
106
|
+
exact: true,
|
|
107
|
+
});
|
|
108
|
+
this.adminButton = page.getByRole('button', {
|
|
109
|
+
name: /^(Admin|Identity)$/, // Identity Should be removed after https://github.com/camunda/camunda/issues/46447 is fixed
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
// Recovery step of the app hand-off loops below (`clickTasklist`,
|
|
113
|
+
// `clickOperate`, `clickOptimize`). Each of those clicks starts the cluster
|
|
114
|
+
// SSO hand-off, so when the attempt fails the tab usually still has a
|
|
115
|
+
// navigation in flight — and a reload that races one fails with
|
|
116
|
+
// `net::ERR_ABORTED; maybe frame was detached?`. Called unguarded from
|
|
117
|
+
// inside the loop's own `catch`, that rejection escaped the very loop that
|
|
118
|
+
// was about to re-click the link, so the run ended on the RECOVERY step
|
|
119
|
+
// with no failing assertion and no named hop. That is the signature three
|
|
120
|
+
// consecutive 8.10 nightlies reported from `clickOperate` (runs
|
|
121
|
+
// 31477774469, 31667751303, 31770471935) and the one the smoke flow failed
|
|
122
|
+
// 3/3 on. Let the in-flight hand-off settle first, then treat a
|
|
123
|
+
// re-navigation that still fails as one spent attempt: a link that
|
|
124
|
+
// genuinely never opens the app still fails through each loop's own
|
|
125
|
+
// attempt limit and its existing "Failed to click the <app> link after N
|
|
126
|
+
// attempts" diagnostic. The same guarding pattern is already used in
|
|
127
|
+
// `OptimizeHomePage.assertProcessImportedWithRetry`,
|
|
128
|
+
// `OperateProcessesPage.returnToProcessesList` and
|
|
129
|
+
// `OperateProcessInstancePage.reload`.
|
|
130
|
+
async reloadForRecovery(whileDoing) {
|
|
131
|
+
if (this.page.isClosed()) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
try {
|
|
135
|
+
await this.page.waitForLoadState('load', { timeout: 20000 });
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
console.warn(`Page did not settle before reloading while ${whileDoing}: ${error}`);
|
|
139
|
+
}
|
|
140
|
+
try {
|
|
141
|
+
await this.page.reload();
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
console.warn(`Could not reload while ${whileDoing}: ${error}`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// Boolean probe for "did an apps-menu entry render?", with the same window
|
|
148
|
+
// the `expect(...).toBeVisible({timeout: 30000})` calls it replaces used —
|
|
149
|
+
// so a slow legacy flyout still gets its full 30s before any caller decides
|
|
150
|
+
// the entry is absent rather than merely late.
|
|
151
|
+
async entryAppeared(entry) {
|
|
152
|
+
return entry
|
|
153
|
+
.waitFor({ state: 'visible', timeout: 30000 })
|
|
154
|
+
.then(() => true)
|
|
155
|
+
.catch(() => false);
|
|
156
|
+
}
|
|
157
|
+
// Camunda Hub's sidebar groups by cluster, not by app: each cluster row
|
|
158
|
+
// expands to reveal its own per-app child links (Operate/Tasklist/...).
|
|
159
|
+
// camunda-hub's own nav-shell-ds.spec.saas.tsx documents the shape: "the
|
|
160
|
+
// design system splits the group row into a label control and a chevron
|
|
161
|
+
// control, both labelled by the cluster name; either one opens it" -- and
|
|
162
|
+
// the child links do not exist in the DOM at all until expanded (not just
|
|
163
|
+
// hidden), and are not nested under any container matchable by cluster
|
|
164
|
+
// name once expanded. So: find the toggle by the cluster's own name
|
|
165
|
+
// (`.first()` because both controls share that name), click it, then look
|
|
166
|
+
// up the app link sidebar-wide rather than scoped to a "group" container
|
|
167
|
+
// that doesn't reliably exist -- which is why every OTHER expanded group
|
|
168
|
+
// must be collapsed first, below. Ported from pages/8.7/AppsPage.ts
|
|
169
|
+
// (expandHubClusterGroup), which itself fixed the exact bug an unscoped
|
|
170
|
+
// sidebar-wide lookup has: with more than one cluster in the org, a
|
|
171
|
+
// DIFFERENT cluster's group can already be expanded (left over from an
|
|
172
|
+
// earlier action on the same page), and `.first()` would then silently
|
|
173
|
+
// resolve to THAT cluster's app link instead of throwing.
|
|
174
|
+
async expandHubClusterGroup(clusterName) {
|
|
175
|
+
// Anchored at the start: the row's accessible name can carry more than
|
|
176
|
+
// the bare cluster name (e.g. an environment badge), and a plain
|
|
177
|
+
// substring match also hits "UI Test Cluster", which this suite creates
|
|
178
|
+
// too and which can precede "Test Cluster" in the sidebar.
|
|
179
|
+
const toggle = this.hubSidebar
|
|
180
|
+
.getByRole('button', { name: new RegExp(`^${escapeRegExp(clusterName)}`) })
|
|
181
|
+
.first();
|
|
182
|
+
// The diagram editor, where callers land after "Deploy & run", has no
|
|
183
|
+
// "Main navigation" sidebar at all, and a page freshly reached after a
|
|
184
|
+
// re-login can render the sidebar before this cluster's group. Go home
|
|
185
|
+
// through clickModeler() in both cases. Leave the rail as Hub renders it:
|
|
186
|
+
// opening a collapsed rail first makes the group click that follows miss
|
|
187
|
+
// (pages/8.9 a84128e), and collapsed, the group trigger opens its flyout.
|
|
188
|
+
const sidebarReady = (await this.hubSidebar.isVisible({ timeout: 5000 }).catch(() => false)) &&
|
|
189
|
+
(await toggle
|
|
190
|
+
.waitFor({ state: 'visible', timeout: 10000 })
|
|
191
|
+
.then(() => true)
|
|
192
|
+
.catch(() => false));
|
|
193
|
+
if (!sidebarReady) {
|
|
194
|
+
await this.clickModeler();
|
|
195
|
+
await (0, test_1.expect)(this.hubSidebar).toBeVisible({ timeout: 30000 });
|
|
196
|
+
// Hub's Workspaces overview defaults to "My workspaces" (camunda-hub
|
|
197
|
+
// #28956), where a role-flow user who is no explicit member of the
|
|
198
|
+
// shared workspace never gets this cluster's group in the sidebar.
|
|
199
|
+
await this.showAllWorkspaces(5000);
|
|
200
|
+
await (0, test_1.expect)(toggle).toBeVisible({ timeout: 30000 });
|
|
201
|
+
}
|
|
202
|
+
// Check THIS cluster's own toggle state via aria-expanded, not "is any
|
|
203
|
+
// app link with this name visible anywhere in the sidebar" -- the latter
|
|
204
|
+
// is exactly the unscoped check that let a different, already-expanded
|
|
205
|
+
// cluster's link satisfy it.
|
|
206
|
+
const alreadyExpanded = (await toggle.getAttribute('aria-expanded').catch(() => null)) === 'true';
|
|
207
|
+
if (!alreadyExpanded) {
|
|
208
|
+
// This is the only expansion action in the Hub path -- swallowing its
|
|
209
|
+
// failure made a broken expansion look successful and left the caller
|
|
210
|
+
// to burn the full 30s below waiting on an app link that could never
|
|
211
|
+
// appear, hiding the actionable error behind an unrelated timeout.
|
|
212
|
+
await toggle.click({ timeout: 10000 });
|
|
213
|
+
}
|
|
214
|
+
// Collapse every other expanded group, so an earlier action on the same
|
|
215
|
+
// page cannot leave a second cluster's links next to this one's. Match by
|
|
216
|
+
// accessible name, excluding any name containing clusterName, since the
|
|
217
|
+
// expanded chevron can carry its name in aria-label only. The rail's own
|
|
218
|
+
// "Collapse sidebar" toggle is also an expanded button in this nav:
|
|
219
|
+
// clicking it collapses the rail and takes the inline app links with it
|
|
220
|
+
// (the 8.8 nightly after #3746), so exclude it.
|
|
221
|
+
const otherExpandedToggles = this.hubSidebar
|
|
222
|
+
.getByRole('button', {
|
|
223
|
+
expanded: true,
|
|
224
|
+
name: new RegExp(`^(?!.*${escapeRegExp(clusterName)}).+$`),
|
|
225
|
+
})
|
|
226
|
+
.and(this.page.locator(':not([data-slot="app-sidebar-collapse-toggle"])'));
|
|
227
|
+
for (let i = 0; i < 5 && (await otherExpandedToggles.count()) > 0; i++) {
|
|
228
|
+
// Let a failed collapse throw rather than swallowing it: failing at the
|
|
229
|
+
// actual cause is more useful than at the wrong-link symptom below.
|
|
230
|
+
await otherExpandedToggles.first().click({ timeout: 10000 });
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
// Widens Hub's Workspaces scope filter to "All workspaces". Duplicated from
|
|
234
|
+
// ModelerHomePage.showAllWorkspaces() rather than imported, as in
|
|
235
|
+
// pages/8.9: ModelerHomePage constructs page objects of its own. The
|
|
236
|
+
// control is absent for non-elevated users, where a membership-scoped list
|
|
237
|
+
// is already correct, so a missing control is a no-op.
|
|
238
|
+
async showAllWorkspaces(probeTimeout) {
|
|
239
|
+
const switchButton = this.page.getByRole('button', {
|
|
240
|
+
name: 'Switch to All workspaces',
|
|
241
|
+
});
|
|
242
|
+
const scopeFilter = this.page.getByRole('combobox', {
|
|
243
|
+
name: 'Filter workspaces',
|
|
244
|
+
});
|
|
245
|
+
const appeared = await switchButton
|
|
246
|
+
.or(scopeFilter)
|
|
247
|
+
.first()
|
|
248
|
+
.waitFor({ state: 'visible', timeout: probeTimeout })
|
|
249
|
+
.then(() => true)
|
|
250
|
+
.catch(() => false);
|
|
251
|
+
if (!appeared) {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
if (await switchButton.isVisible().catch(() => false)) {
|
|
255
|
+
await switchButton.click({ timeout: 10000 });
|
|
256
|
+
await (0, test_1.expect)(switchButton).toBeHidden({ timeout: 10000 });
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if ((await scopeFilter.innerText()).includes('All workspaces')) {
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
await scopeFilter.click({ timeout: 10000 });
|
|
263
|
+
await this.page
|
|
264
|
+
.getByRole('option', { name: 'All workspaces' })
|
|
265
|
+
.click({ timeout: 10000 });
|
|
266
|
+
await (0, test_1.expect)(scopeFilter).toContainText('All workspaces', {
|
|
267
|
+
timeout: 10000,
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
// When the sidebar is collapsed (the default on a fresh session), the
|
|
271
|
+
// group toggle opens a Radix popover -- a role="dialog" labelled with the
|
|
272
|
+
// cluster name and portalled OUTSIDE the "Main navigation" <nav> -- so a
|
|
273
|
+
// sidebar-scoped lookup finds nothing there. Look in that popover first;
|
|
274
|
+
// keep the sidebar-scoped lookup for the expanded-sidebar layout, where the
|
|
275
|
+
// links render inline.
|
|
276
|
+
//
|
|
277
|
+
// Hub names every app link "<app> in <environment>", plus " (opens in a
|
|
278
|
+
// new tab)" when it leads to the live app (camunda-hub
|
|
279
|
+
// environment-sidebar-rows.ts). Anchor both halves: the flyout's first link
|
|
280
|
+
// is "Details of <environment>", so for "Admin Role Cluster" a bare
|
|
281
|
+
// /Admin|Identity/ picked that link, and inline it picked "Operate in Admin
|
|
282
|
+
// Role Cluster (opens in a new tab)". Anchoring also keeps "Test Cluster"
|
|
283
|
+
// from matching "UI Test Cluster".
|
|
284
|
+
hubAppLink(clusterName, appName) {
|
|
285
|
+
const appPattern = typeof appName === 'string' ? escapeRegExp(appName) : appName.source;
|
|
286
|
+
const cluster = escapeRegExp(clusterName);
|
|
287
|
+
const appLinkName = new RegExp(`^(?:${appPattern}) in ${cluster}(?: \\(opens in a new tab\\))?$`);
|
|
288
|
+
return this.page
|
|
289
|
+
.getByRole('dialog', { name: clusterName, exact: true })
|
|
290
|
+
.getByRole('link', { name: appLinkName })
|
|
291
|
+
.or(this.hubSidebar.getByRole('link', { name: appLinkName }))
|
|
292
|
+
.first();
|
|
293
|
+
}
|
|
294
|
+
async clickHubClusterApp(clusterName, appName) {
|
|
295
|
+
await this.expandHubClusterGroup(clusterName);
|
|
296
|
+
const appLink = this.hubAppLink(clusterName, appName);
|
|
297
|
+
await (0, test_1.expect)(appLink).toBeVisible({ timeout: 30000 });
|
|
298
|
+
// Hub's cluster-app links carry target="_blank", so clicking them opens
|
|
299
|
+
// the app in a new tab while every caller keeps asserting on this.page.
|
|
300
|
+
// Follow the href in the current tab instead, matching the same-tab
|
|
301
|
+
// navigation the Console app switcher gave these callers.
|
|
302
|
+
const href = await appLink.getAttribute('href');
|
|
303
|
+
if (href) {
|
|
304
|
+
this.hubReturnUrl = this.page.url();
|
|
305
|
+
await this.page.goto(new URL(href, this.page.url()).toString());
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
await appLink.click({ timeout: 10000 });
|
|
309
|
+
}
|
|
310
|
+
// Hub's replacement for the app switcher check: a cluster's apps are the
|
|
311
|
+
// child links of its sidebar group.
|
|
312
|
+
async assertHubClusterAppPresent(clusterName, appName, shouldBeVisible) {
|
|
313
|
+
if (clusterName === undefined) {
|
|
314
|
+
throw new Error(`Hub has no app switcher: pass the cluster name to check ${appName} in its sidebar group.`);
|
|
315
|
+
}
|
|
316
|
+
const appLink = this.hubAppLink(clusterName, appName);
|
|
317
|
+
// Not expanded for an absence check: expandHubClusterGroup throws when
|
|
318
|
+
// the user cannot see the environment at all, which is a pass here.
|
|
319
|
+
if (!shouldBeVisible) {
|
|
320
|
+
await (0, test_1.expect)(appLink).toBeHidden({ timeout: 30000 });
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
await this.expandHubClusterGroup(clusterName);
|
|
324
|
+
await (0, test_1.expect)(appLink).toBeVisible({ timeout: 30000 });
|
|
325
|
+
}
|
|
326
|
+
async clickCluster(component, name) {
|
|
327
|
+
// Cluster names are not unique in an org, so this app's sub-menu can list
|
|
328
|
+
// the same name twice; pick the first entry (same row the Console cluster
|
|
329
|
+
// list resolves to) rather than strict-mode failing on the hand-off.
|
|
330
|
+
const cluster = component
|
|
331
|
+
.getByRole('link', { name: name, exact: true })
|
|
332
|
+
.first();
|
|
333
|
+
await (0, test_1.expect)(cluster).toBeVisible({ timeout: 30000 });
|
|
334
|
+
await cluster.click();
|
|
335
|
+
}
|
|
336
|
+
// Returns from an app that clickHubClusterApp opened. page.goBack() alone
|
|
337
|
+
// can stop on one of the app's own login-redirect entries, and the next
|
|
338
|
+
// Hub sidebar lookup then runs against the app instead of Hub.
|
|
339
|
+
async goBackToHub() {
|
|
340
|
+
await this.page.goBack();
|
|
341
|
+
if (this.hubReturnUrl &&
|
|
342
|
+
!new URL(this.page.url()).hostname.startsWith('hub.')) {
|
|
343
|
+
await this.page.goto(this.hubReturnUrl);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
async clickModeler() {
|
|
347
|
+
const maxRetries = 5;
|
|
348
|
+
const modelerErrorPage = this.page
|
|
349
|
+
.getByText(/local_rate_limited/i)
|
|
350
|
+
.or(this.page.getByText(/Well, that's awkward/i))
|
|
351
|
+
.first();
|
|
352
|
+
// nav V2 breadcrumb switcher: Modeler is a `menuitemradio`, the legacy
|
|
353
|
+
// apps flyout renders it as a link. Resolve whichever this build shows.
|
|
354
|
+
const modelerEntry = this.modelerMenuItem.or(this.modelerLink).first();
|
|
355
|
+
// Camunda Hub (hub.*) replaced Console + Web Modeler on SaaS and has no
|
|
356
|
+
// app switcher. Its home is the Modeler/Workspaces home, but a hostname
|
|
357
|
+
// check alone can't tell whether we're already there -- Hub's cluster
|
|
358
|
+
// pages are on the same hub.* hostname, and a no-op here would leave a
|
|
359
|
+
// caller that reaches clickModeler() from a cluster/API-client page
|
|
360
|
+
// stranded with the next locator running against the wrong page.
|
|
361
|
+
// Navigate home through the header logo link instead, same as
|
|
362
|
+
// ModelerHomePage.clickHomeBreadcrumb -- clicking it when already on the
|
|
363
|
+
// Modeler home is a harmless in-SPA no-op. Ported from
|
|
364
|
+
// pages/8.9/AppsPage.ts.
|
|
365
|
+
//
|
|
366
|
+
// An 8.10 cluster app that clickHubClusterApp opened has no way back to
|
|
367
|
+
// Modeler: its nav V2 switcher lists only the cluster's own apps. Return
|
|
368
|
+
// to the Hub page the hop started from instead.
|
|
369
|
+
if (this.hubReturnUrl &&
|
|
370
|
+
!new URL(this.page.url()).hostname.startsWith('hub.')) {
|
|
371
|
+
await this.page.goto(this.hubReturnUrl, { waitUntil: 'domcontentloaded' });
|
|
372
|
+
}
|
|
373
|
+
if (new URL(this.page.url()).hostname.startsWith('hub.')) {
|
|
374
|
+
const header = this.page.locator('header[data-slot="app-header"]');
|
|
375
|
+
// The href stays literally "/login" until the client's auth state
|
|
376
|
+
// catches up just after login (camunda-hub NavShellDs.common.tsx) --
|
|
377
|
+
// clicking it in that window would log the test out instead of
|
|
378
|
+
// navigating home, so exclude that href and wait for the authenticated
|
|
379
|
+
// one rather than racing it.
|
|
380
|
+
const homeLink = header
|
|
381
|
+
.getByRole('link', { name: 'Camunda Modeler home' })
|
|
382
|
+
.and(this.page.locator(':not([href$="/login"])'))
|
|
383
|
+
.or(header
|
|
384
|
+
.getByRole('link', { name: 'Camunda Hub home' })
|
|
385
|
+
.and(this.page.locator(':not([href$="/login"])')))
|
|
386
|
+
.first();
|
|
387
|
+
await (0, test_1.expect)(homeLink).toBeVisible({ timeout: 30000 });
|
|
388
|
+
await homeLink.click({ timeout: 30000 });
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
for (let retries = 0; retries < maxRetries; retries++) {
|
|
392
|
+
try {
|
|
393
|
+
if (retries > 0) {
|
|
394
|
+
await this.clickCamundaApps();
|
|
395
|
+
}
|
|
396
|
+
if (!(await this.entryAppeared(modelerEntry))) {
|
|
397
|
+
// Nothing to click, because the nav V2 breadcrumb switcher lists
|
|
398
|
+
// only the cluster's OWN webapps. Modeler is org-level, so unlike
|
|
399
|
+
// Operate it has no entry there at all. Re-enter through Console,
|
|
400
|
+
// whose apps flyout does list it — the same recovery the
|
|
401
|
+
// `open*WithRetry` helpers below use.
|
|
402
|
+
await this.page.goto('/', { waitUntil: 'domcontentloaded' });
|
|
403
|
+
await this.clickCamundaApps();
|
|
404
|
+
await (0, test_1.expect)(modelerEntry).toBeVisible({ timeout: 30000 });
|
|
405
|
+
}
|
|
406
|
+
await modelerEntry.click();
|
|
407
|
+
// After clicking, the browser is redirected through
|
|
408
|
+
// modeler.ultrawombat.com/login which can return 429
|
|
409
|
+
// (`local_rate_limited`) or a generic "Well, that's awkward" error
|
|
410
|
+
// page when the Modeler backend is being rate-limited by SaaS infra.
|
|
411
|
+
// Detect those pages and trigger a clean retry instead of letting
|
|
412
|
+
// the caller's banner-visibility assertion burn its timeout.
|
|
413
|
+
if (await modelerErrorPage.isVisible({ timeout: 5000 }).catch(() => false)) {
|
|
414
|
+
throw new Error('MODELER_RATE_LIMIT: navigation landed on a rate-limit / error page');
|
|
415
|
+
}
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
catch (error) {
|
|
419
|
+
const rateLimited = String(error).includes('MODELER_RATE_LIMIT');
|
|
420
|
+
console.warn(`Click attempt ${retries + 1} failed: ${error}`);
|
|
421
|
+
if (rateLimited) {
|
|
422
|
+
// Modeler login throttling windows commonly need 30-60s to clear.
|
|
423
|
+
await this.page.context().clearCookies();
|
|
424
|
+
await new Promise((resolve) => setTimeout(resolve, 45000));
|
|
425
|
+
await this.page
|
|
426
|
+
.goto('/', { waitUntil: 'domcontentloaded', timeout: 60000 })
|
|
427
|
+
.catch(() => { });
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
await new Promise((resolve) => setTimeout(resolve, 10000));
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
throw new Error(`Failed to click the modeler link after ${maxRetries} attempts.`);
|
|
435
|
+
}
|
|
436
|
+
// True while the tab is still inside the Modeler's OAuth hand-off rather
|
|
437
|
+
// than on a Modeler page: `modeler.<host>/login` bounces through the IdP and
|
|
438
|
+
// commits `/login-callback?code=...` before the app itself renders.
|
|
439
|
+
isModelerAuthTransit() {
|
|
440
|
+
try {
|
|
441
|
+
const { hostname, pathname } = new URL(this.page.url());
|
|
442
|
+
return (hostname.startsWith('modeler.') &&
|
|
443
|
+
/^\/login(-callback)?\/?$/.test(pathname));
|
|
444
|
+
}
|
|
445
|
+
catch {
|
|
446
|
+
// Not a parsable URL yet (e.g. a tab still on about:blank).
|
|
447
|
+
return false;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
// The Modeler OAuth handshake occasionally stalls on
|
|
451
|
+
// `modeler.<host>/login-callback?code=...`: the tab stays on the callback
|
|
452
|
+
// URL and the Modeler banner never renders. Reloading cannot recover it —
|
|
453
|
+
// the `code` is single use — so re-enter through the Camunda apps menu,
|
|
454
|
+
// which starts a fresh handshake.
|
|
455
|
+
//
|
|
456
|
+
// `ready` is an optional second gate for callers that need proof of a
|
|
457
|
+
// Modeler SESSION rather than proof of the Modeler shell. The banner is not
|
|
458
|
+
// that proof -- Modeler renders it on its own login page too -- and the
|
|
459
|
+
// hand-off can still fail after the shell is up: when
|
|
460
|
+
// `POST /api/internal/login` returns 500, hub's
|
|
461
|
+
// auth-service.handleRedirectCallback() falls into its catch and calls
|
|
462
|
+
// logout(), bouncing the tab through Auth0's /v2/logout back to
|
|
463
|
+
// `modeler.<host>/login` about half a minute AFTER the banner became
|
|
464
|
+
// visible. The banner assertion passes in that window, the spec then hunts
|
|
465
|
+
// for its project tile on a login screen, and the failure surfaces minutes
|
|
466
|
+
// later and nowhere near its cause ("Failed to click locator
|
|
467
|
+
// getByTitle('Cross Component Test Project') ... after N attempts"). Pass
|
|
468
|
+
// something only an authenticated Modeler renders -- the projects list's
|
|
469
|
+
// create button -- and a logged-out tab is caught here instead, where the
|
|
470
|
+
// retry re-runs the handshake and with it the internal login.
|
|
471
|
+
async openModelerWithRetry(banner, timeout = 60000, maxRetries = 3, ready, beforeReady) {
|
|
472
|
+
const modelerReady = async () => {
|
|
473
|
+
if (beforeReady) {
|
|
474
|
+
// After the Camunda Hub rebrand the Modeler home greets a first visit
|
|
475
|
+
// with a "Welcome to Camunda Hub" onboarding dialog that mounts a beat
|
|
476
|
+
// after routing and marks the app shell inert, so the banner leaves the
|
|
477
|
+
// accessibility tree until the dialog is dismissed. Run beforeReady
|
|
478
|
+
// (the dialog dismissal) each interval so a dialog that mounts after the
|
|
479
|
+
// first pass is still cleared, instead of burning the whole timeout on a
|
|
480
|
+
// banner the overlay is holding out of reach.
|
|
481
|
+
await (0, test_1.expect)(async () => {
|
|
482
|
+
await beforeReady();
|
|
483
|
+
await (0, test_1.expect)(banner).toBeVisible({ timeout: 15000 });
|
|
484
|
+
if (ready) {
|
|
485
|
+
await (0, test_1.expect)(ready).toBeVisible({ timeout: 15000 });
|
|
486
|
+
}
|
|
487
|
+
}).toPass({ timeout, intervals: [1000, 2000, 5000] });
|
|
488
|
+
return;
|
|
489
|
+
}
|
|
490
|
+
await (0, test_1.expect)(banner).toBeVisible({ timeout });
|
|
491
|
+
if (ready) {
|
|
492
|
+
await (0, test_1.expect)(ready).toBeVisible({ timeout });
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
496
|
+
// Camunda Hub (hub.*) replaced Console + Web Modeler on SaaS and has no
|
|
497
|
+
// app switcher: its home already is the Modeler home.
|
|
498
|
+
if (!new URL(this.page.url()).hostname.startsWith('hub.')) {
|
|
499
|
+
await this.clickCamundaApps();
|
|
500
|
+
await this.clickModeler();
|
|
501
|
+
}
|
|
502
|
+
try {
|
|
503
|
+
await modelerReady();
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
catch (error) {
|
|
507
|
+
// Never tear down a hand-off that is still in flight. `modeler
|
|
508
|
+
// .<host>/login` runs an invisible reCAPTCHA before it even reaches
|
|
509
|
+
// the IdP, so on SaaS the tab routinely leaves `/login` for
|
|
510
|
+
// `/login-callback?code=...` only just AFTER this window lapses.
|
|
511
|
+
// Re-entering through the apps menu at that moment aborts an exchange
|
|
512
|
+
// that was about to finish and starts an identical one, which is then
|
|
513
|
+
// cut at the very same mark — three attempts, three restarts, and the
|
|
514
|
+
// banner never renders even though nothing was actually wrong. The
|
|
515
|
+
// trace of such a run shows `/login` committing `/login-callback`
|
|
516
|
+
// 60.3s into a 60s wait, three times over. Give a hand-off that is
|
|
517
|
+
// still in transit one more window to settle before treating the
|
|
518
|
+
// attempt as failed; a tab that is genuinely wedged spends it and
|
|
519
|
+
// falls through to the re-entry below exactly as before.
|
|
520
|
+
if (this.isModelerAuthTransit()) {
|
|
521
|
+
try {
|
|
522
|
+
await modelerReady();
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
catch (settleError) {
|
|
526
|
+
console.warn(`Modeler hand-off did not settle within the extra window: ` +
|
|
527
|
+
`${settleError}`);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
if (attempt === maxRetries - 1) {
|
|
531
|
+
throw error;
|
|
532
|
+
}
|
|
533
|
+
console.warn(`Modeler banner not visible on attempt ${attempt + 1}; ` +
|
|
534
|
+
're-entering through the apps menu.');
|
|
535
|
+
await this.page.goto('/', { waitUntil: 'domcontentloaded' });
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
// The hand-off into Operate can resolve without the app ever coming up:
|
|
540
|
+
// `clickOperate` returns as soon as its click resolves, so a click that
|
|
541
|
+
// landed while the apps menu was being torn down — or a cluster hand-off
|
|
542
|
+
// that stalls on the proxy — leaves the tab on whatever app it started from.
|
|
543
|
+
// The caller then looks for Operate's nav on a page that is not Operate, and
|
|
544
|
+
// because Tasklist ships a "Processes" link of its own that lookup can even
|
|
545
|
+
// SUCCEED: the click goes to Tasklist's Processes tab, and the wait for
|
|
546
|
+
// Operate's own Processes view (`expanded-panel` > "Process") afterwards can
|
|
547
|
+
// never resolve. That is what reported "Failed to click locator
|
|
548
|
+
// getByRole('link', { name: 'Processes', exact: true })" on one hand and
|
|
549
|
+
// "Failed to assert visibility locator getByTestId('expanded-panel')
|
|
550
|
+
// .getByText('Process', { exact: true })" on the other. Gate on Operate's
|
|
551
|
+
// banner and re-enter through the apps menu when it never renders — the same
|
|
552
|
+
// recovery `openModelerWithRetry` uses for the identical Modeler
|
|
553
|
+
// `login-callback` stall.
|
|
554
|
+
async openOperateWithRetry(banner, clusterName, timeout = 60000, maxRetries = 3) {
|
|
555
|
+
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
556
|
+
await this.clickCamundaApps();
|
|
557
|
+
await this.clickOperate(clusterName);
|
|
558
|
+
try {
|
|
559
|
+
await (0, test_1.expect)(banner).toBeVisible({ timeout });
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
catch (error) {
|
|
563
|
+
if (attempt === maxRetries - 1) {
|
|
564
|
+
throw error;
|
|
565
|
+
}
|
|
566
|
+
console.warn(`Operate banner not visible on attempt ${attempt + 1}; ` +
|
|
567
|
+
're-entering through the apps menu.');
|
|
568
|
+
await this.page.goto('/', { waitUntil: 'domcontentloaded' });
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
async clickTasklist(clusterName) {
|
|
573
|
+
// Camunda Hub replaced the global app switcher with a per-cluster
|
|
574
|
+
// sidebar; ported from pages/8.9/AppsPage.ts.
|
|
575
|
+
if (new URL(this.page.url()).hostname.startsWith('hub.')) {
|
|
576
|
+
await this.clickHubClusterApp(clusterName, 'Tasklist');
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
const maxRetries = 3;
|
|
580
|
+
for (let retries = 0; retries < maxRetries; retries++) {
|
|
581
|
+
try {
|
|
582
|
+
if (retries > 0) {
|
|
583
|
+
await this.clickCamundaApps();
|
|
584
|
+
}
|
|
585
|
+
// The apps menu renders asynchronously after clickCamundaApps —
|
|
586
|
+
// wait until the panel has actually populated (any of the app
|
|
587
|
+
// entries shows up) before probing for the Tasklist link with a
|
|
588
|
+
// short timeout. A bare 5s wait on tasklistLink alone races the
|
|
589
|
+
// menu animation on slower setups.
|
|
590
|
+
const anyAppEntry = this.tasklistLink
|
|
591
|
+
.or(this.tasklistButton)
|
|
592
|
+
.or(this.tasklistMenuItem)
|
|
593
|
+
.or(this.modelerLink)
|
|
594
|
+
.or(this.operateLink)
|
|
595
|
+
.or(this.consoleLink);
|
|
596
|
+
await anyAppEntry
|
|
597
|
+
.first()
|
|
598
|
+
.waitFor({ state: 'visible', timeout: 30000 })
|
|
599
|
+
.catch(() => { });
|
|
600
|
+
if (await this.tasklistMenuItem.isVisible({ timeout: 5000 })) {
|
|
601
|
+
// nav V2 breadcrumb switcher: apps are menuitemradio entries that
|
|
602
|
+
// hop to the same cluster's app directly, no cluster sub-select.
|
|
603
|
+
await this.tasklistMenuItem.click({ timeout: 10000 });
|
|
604
|
+
}
|
|
605
|
+
else if (await this.tasklistLink.isVisible({ timeout: 5000 })) {
|
|
606
|
+
//Single cluster
|
|
607
|
+
await this.tasklistLink.click({ timeout: 10000 });
|
|
608
|
+
}
|
|
609
|
+
else {
|
|
610
|
+
//Multiple clusters
|
|
611
|
+
await this.doClickClusterInTasklist(clusterName);
|
|
612
|
+
}
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
catch (error) {
|
|
616
|
+
console.warn(`Click attempt ${retries + 1} failed: ${error}`);
|
|
617
|
+
if (!this.page.isClosed()) {
|
|
618
|
+
await this.reloadForRecovery('opening Tasklist');
|
|
619
|
+
await (0, sleep_1.sleep)(20000);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
throw new Error(`Failed to click the tasklist link after ${maxRetries} attempts.`);
|
|
624
|
+
}
|
|
625
|
+
// Same hand-off failure `openOperateWithRetry` above exists to catch, on the
|
|
626
|
+
// other app: `clickTasklist` returns as soon as its click resolves, so a
|
|
627
|
+
// click that landed while the apps menu was being torn down — or a cluster
|
|
628
|
+
// hand-off that stalls on the proxy — leaves the tab on the app it started
|
|
629
|
+
// from. The caller then polls THAT page for a task row which can never be
|
|
630
|
+
// there, and the reload each polling round performs cannot recover a
|
|
631
|
+
// hand-off that never happened — it re-renders the same wrong app. That is
|
|
632
|
+
// what reported `Task <name> did not open from "Available tasks"` on a run
|
|
633
|
+
// whose instance was already confirmed ACTIVE in Operate one step earlier.
|
|
634
|
+
// Gate on Tasklist's own banner and re-enter through the apps menu when it
|
|
635
|
+
// never renders.
|
|
636
|
+
async openTasklistWithRetry(banner, clusterName, timeout = 60000, maxRetries = 3) {
|
|
637
|
+
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
638
|
+
await this.clickCamundaApps();
|
|
639
|
+
await this.clickTasklist(clusterName);
|
|
640
|
+
try {
|
|
641
|
+
await (0, test_1.expect)(banner).toBeVisible({ timeout });
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
catch (error) {
|
|
645
|
+
if (attempt === maxRetries - 1) {
|
|
646
|
+
throw error;
|
|
647
|
+
}
|
|
648
|
+
console.warn(`Tasklist banner not visible on attempt ${attempt + 1}; ` +
|
|
649
|
+
're-entering through the apps menu.');
|
|
650
|
+
await this.page.goto('/', { waitUntil: 'domcontentloaded' });
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
// The third instance of the hand-off failure `openOperateWithRetry` and
|
|
655
|
+
// `openTasklistWithRetry` above exist to catch — and the only app hop in the
|
|
656
|
+
// smoke flow that was still ungated. `clickOptimize` returns as soon as its
|
|
657
|
+
// click resolves, so a hand-off that stalled (or that landed on Optimize's
|
|
658
|
+
// `/login` SSO bounce rather than the app) leaves the tab somewhere that can
|
|
659
|
+
// never render a process definition. The caller's import poll then spends
|
|
660
|
+
// its ENTIRE budget — the longest single wait in the flow, 20 minutes —
|
|
661
|
+
// reloading that page, and a reload cannot recover a hand-off that never
|
|
662
|
+
// happened. Gating here fails in 3 x 60s with a diagnostic naming the hop
|
|
663
|
+
// instead. Every other 8.10 spec already asserts `optimizeBanner` right
|
|
664
|
+
// after `clickOptimize` for exactly this reason; only the smoke flow did
|
|
665
|
+
// not.
|
|
666
|
+
// `totalTimeout` is what makes the stated budget true. Retrying on a thrown
|
|
667
|
+
// hand-off (rather than escaping on the first throw) is correct, but it also
|
|
668
|
+
// multiplies the cost: a worst-case attempt here is clickCamundaApps (~188s
|
|
669
|
+
// when it has to hunt for a trigger) + clickOptimize (~456s across its own
|
|
670
|
+
// three retries) + the banner wait, so four attempts could reach ~43 min and
|
|
671
|
+
// blow the 36-minute test.slow() budget of the specs that call this. Checked
|
|
672
|
+
// between attempts, so the real ceiling is the deadline plus at most one
|
|
673
|
+
// attempt -- bounded, which "N x timeout" arithmetic alone never was.
|
|
674
|
+
async openOptimizeWithRetry(banner, clusterName, timeout = 60000, maxRetries = 3, totalTimeout = 600000) {
|
|
675
|
+
const start = Date.now();
|
|
676
|
+
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
677
|
+
try {
|
|
678
|
+
// Inside the try, not before it: `clickOptimize` throws after its own
|
|
679
|
+
// retries, and `clickCamundaApps` can throw on a click timeout. With
|
|
680
|
+
// those calls outside, the first such throw escaped this helper before
|
|
681
|
+
// it ever reached the `page.goto('/')` below -- so in exactly the dead
|
|
682
|
+
// page case this wrapper exists for, the recovery was skipped and the
|
|
683
|
+
// remaining attempts never ran.
|
|
684
|
+
await this.clickCamundaApps();
|
|
685
|
+
await this.clickOptimize(clusterName);
|
|
686
|
+
await (0, test_1.expect)(banner).toBeVisible({ timeout });
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
catch (error) {
|
|
690
|
+
const elapsed = Date.now() - start;
|
|
691
|
+
if (attempt === maxRetries - 1 || elapsed >= totalTimeout) {
|
|
692
|
+
throw error;
|
|
693
|
+
}
|
|
694
|
+
console.warn(`Optimize hand-off failed on attempt ${attempt + 1} ` +
|
|
695
|
+
`(${Math.round(elapsed / 1000)}s elapsed); re-entering through ` +
|
|
696
|
+
`the apps menu. ${error}`);
|
|
697
|
+
await this.page.goto('/', { waitUntil: 'domcontentloaded' });
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
async clickAdmin(clusterName) {
|
|
702
|
+
// Camunda Hub replaced the global app switcher with a per-cluster
|
|
703
|
+
// sidebar; ported from pages/8.9/AppsPage.ts. hubAppLink anchors the
|
|
704
|
+
// alternation into the full "<app> in <environment>" link name.
|
|
705
|
+
if (new URL(this.page.url()).hostname.startsWith('hub.')) {
|
|
706
|
+
await this.clickHubClusterApp(clusterName, /Admin|Identity/);
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
const maxRetries = 5;
|
|
710
|
+
for (let retries = 0; retries < maxRetries; retries++) {
|
|
711
|
+
try {
|
|
712
|
+
if (retries === 0) {
|
|
713
|
+
if (await this.adminMenuItem.isVisible({ timeout: 5000 })) {
|
|
714
|
+
// nav V2 breadcrumb switcher: apps are menuitemradio entries that
|
|
715
|
+
// hop to the same cluster's app directly, no cluster sub-select.
|
|
716
|
+
await this.adminMenuItem.click({ timeout: 10000 });
|
|
717
|
+
}
|
|
718
|
+
else if (await this.adminLink.isVisible({ timeout: 5000 })) {
|
|
719
|
+
//Single cluster
|
|
720
|
+
await this.adminLink.click({ timeout: 10000 });
|
|
721
|
+
}
|
|
722
|
+
else {
|
|
723
|
+
//Multiple clusters
|
|
724
|
+
await this.doClickClusterInAdmin(clusterName);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
else {
|
|
728
|
+
await this.clickCamundaApps();
|
|
729
|
+
if (await this.adminMenuItem.isVisible({ timeout: 5000 })) {
|
|
730
|
+
await this.adminMenuItem.click({ timeout: 10000 });
|
|
731
|
+
}
|
|
732
|
+
else if (await this.adminLink.isVisible({ timeout: 5000 })) {
|
|
733
|
+
await this.adminLink.click({ timeout: 10000 });
|
|
734
|
+
}
|
|
735
|
+
else {
|
|
736
|
+
await this.doClickClusterInAdmin(clusterName);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
catch (error) {
|
|
742
|
+
console.warn(`Click attempt ${retries + 1} failed: ${error}`);
|
|
743
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(this.page);
|
|
744
|
+
await this.page.reload();
|
|
745
|
+
await (0, sleep_1.sleep)(20000);
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
throw new Error(`Failed to click the Identity link after ${maxRetries} attempts.`);
|
|
749
|
+
}
|
|
750
|
+
async doClickClusterInOperate(clusterName) {
|
|
751
|
+
if (await this.operateListItem
|
|
752
|
+
.getByRole('button', {
|
|
753
|
+
expanded: true,
|
|
754
|
+
})
|
|
755
|
+
.isHidden({ timeout: 5000 })) {
|
|
756
|
+
await this.operateButton.click({ timeout: 10000 });
|
|
757
|
+
}
|
|
758
|
+
await this.clickCluster(this.operateListItem, clusterName);
|
|
759
|
+
}
|
|
760
|
+
async doClickClusterInTasklist(clusterName) {
|
|
761
|
+
if (await this.tasklistListItem
|
|
762
|
+
.getByRole('button', {
|
|
763
|
+
expanded: true,
|
|
764
|
+
})
|
|
765
|
+
.isHidden({ timeout: 5000 })) {
|
|
766
|
+
await this.tasklistButton.click({ timeout: 10000 });
|
|
767
|
+
}
|
|
768
|
+
await this.clickCluster(this.tasklistListItem, clusterName);
|
|
769
|
+
}
|
|
770
|
+
async doClickClusterInAdmin(clusterName) {
|
|
771
|
+
if (await this.adminListItem
|
|
772
|
+
.getByRole('button', {
|
|
773
|
+
expanded: true,
|
|
774
|
+
})
|
|
775
|
+
.isHidden({ timeout: 5000 })) {
|
|
776
|
+
await this.adminButton.click({ timeout: 10000 });
|
|
777
|
+
}
|
|
778
|
+
await this.clickCluster(this.adminListItem, clusterName);
|
|
779
|
+
}
|
|
780
|
+
async doClickClusterInOptimize(clusterName) {
|
|
781
|
+
if (await this.optimizeListItem
|
|
782
|
+
.getByRole('button', {
|
|
783
|
+
expanded: true,
|
|
784
|
+
})
|
|
785
|
+
.isHidden({ timeout: 5000 })) {
|
|
786
|
+
await this.optimizeButton.click({ timeout: 10000 });
|
|
787
|
+
}
|
|
788
|
+
await this.clickCluster(this.optimizeListItem, clusterName);
|
|
789
|
+
}
|
|
790
|
+
async clickOperate(clusterName) {
|
|
791
|
+
// Camunda Hub replaced the global app switcher with a per-cluster
|
|
792
|
+
// sidebar; ported from pages/8.9/AppsPage.ts.
|
|
793
|
+
if (new URL(this.page.url()).hostname.startsWith('hub.')) {
|
|
794
|
+
await this.clickHubClusterApp(clusterName, 'Operate');
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
797
|
+
const maxRetries = 3;
|
|
798
|
+
for (let retries = 0; retries < maxRetries; retries++) {
|
|
799
|
+
try {
|
|
800
|
+
if (retries > 0) {
|
|
801
|
+
await this.clickCamundaApps();
|
|
802
|
+
}
|
|
803
|
+
if (await this.operateMenuItem.isVisible({ timeout: 5000 })) {
|
|
804
|
+
// nav V2 breadcrumb switcher: apps are menuitemradio entries that
|
|
805
|
+
// hop to the same cluster's app directly, no cluster sub-select.
|
|
806
|
+
await this.operateMenuItem.click({ timeout: 10000 });
|
|
807
|
+
}
|
|
808
|
+
else if (await this.operateLink.isVisible({ timeout: 5000 })) {
|
|
809
|
+
//Single Cluster
|
|
810
|
+
await this.operateLink.click({ timeout: 10000 });
|
|
811
|
+
}
|
|
812
|
+
else {
|
|
813
|
+
//Multiple Cluster
|
|
814
|
+
await this.doClickClusterInOperate(clusterName);
|
|
815
|
+
}
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
818
|
+
catch (error) {
|
|
819
|
+
console.warn(`Click attempt ${retries + 1} failed: ${error}`);
|
|
820
|
+
await this.reloadForRecovery('opening Operate');
|
|
821
|
+
await (0, sleep_1.sleep)(20000);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
throw new Error(`Failed to click the operate link after ${maxRetries} attempts.`);
|
|
825
|
+
}
|
|
826
|
+
async clickOptimize(clusterName) {
|
|
827
|
+
// Camunda Hub replaced the global app switcher with a per-cluster
|
|
828
|
+
// sidebar; ported from pages/8.9/AppsPage.ts.
|
|
829
|
+
if (new URL(this.page.url()).hostname.startsWith('hub.')) {
|
|
830
|
+
await this.clickHubClusterApp(clusterName, 'Optimize');
|
|
831
|
+
return;
|
|
832
|
+
}
|
|
833
|
+
const maxRetries = 3;
|
|
834
|
+
for (let retries = 0; retries < maxRetries; retries++) {
|
|
835
|
+
try {
|
|
836
|
+
if (retries === 0) {
|
|
837
|
+
if (await this.optimizeMenuItem.isVisible({ timeout: 10000 })) {
|
|
838
|
+
// nav V2 breadcrumb switcher: apps are menuitemradio entries that
|
|
839
|
+
// hop to the same cluster's app directly, no cluster sub-select.
|
|
840
|
+
await this.optimizeMenuItem.click({ timeout: 10000 });
|
|
841
|
+
}
|
|
842
|
+
else if (await this.optimizeLink.isVisible({ timeout: 10000 })) {
|
|
843
|
+
//Single cluster
|
|
844
|
+
await this.optimizeLink.click({ timeout: 10000 });
|
|
845
|
+
}
|
|
846
|
+
else {
|
|
847
|
+
//Multiple clusters
|
|
848
|
+
await this.doClickClusterInOptimize(clusterName);
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
else {
|
|
852
|
+
await this.clickCamundaApps();
|
|
853
|
+
if (await this.optimizeMenuItem.isVisible({ timeout: 5000 })) {
|
|
854
|
+
await this.optimizeMenuItem.click({ timeout: 10000 });
|
|
855
|
+
}
|
|
856
|
+
else if (await this.optimizeLink.isVisible({ timeout: 5000 })) {
|
|
857
|
+
await this.optimizeLink.click({ timeout: 10000 });
|
|
858
|
+
}
|
|
859
|
+
else {
|
|
860
|
+
await this.doClickClusterInOptimize(clusterName);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
catch (error) {
|
|
866
|
+
console.warn(`Click attempt ${retries + 1} failed: ${error}`);
|
|
867
|
+
await this.reloadForRecovery('opening Optimize');
|
|
868
|
+
await (0, sleep_1.sleep)(20000);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
throw new Error(`Failed to click the optimize link after ${maxRetries} attempts.`);
|
|
872
|
+
}
|
|
873
|
+
async clickCamundaApps(maxRetries = 3) {
|
|
874
|
+
// Camunda Hub's rewritten shells have no app-switcher button to open --
|
|
875
|
+
// Modeler is already Hub's home area and the other apps are reached
|
|
876
|
+
// per-cluster via the persistent sidebar, not through a global switcher
|
|
877
|
+
// panel. Mirrors the same hostname guard in clickModeler() above. Ported
|
|
878
|
+
// from pages/8.9/AppsPage.ts.
|
|
879
|
+
if (new URL(this.page.url()).hostname.startsWith('hub.')) {
|
|
880
|
+
return;
|
|
881
|
+
}
|
|
882
|
+
await (0, sleep_1.sleep)(2000);
|
|
883
|
+
const appButtons = [
|
|
884
|
+
this.camundaComponentsButton,
|
|
885
|
+
this.camundaAppsButton,
|
|
886
|
+
this.appSwitcherButton,
|
|
887
|
+
this.contextSwitcherButton,
|
|
888
|
+
];
|
|
889
|
+
for (let retries = 0; retries < maxRetries; retries++) {
|
|
890
|
+
for (const appButton of appButtons) {
|
|
891
|
+
if (await appButton.isVisible({ timeout: 20000 })) {
|
|
892
|
+
await appButton.click({ timeout: 30000 });
|
|
893
|
+
return;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
async clickConsoleLink() {
|
|
899
|
+
// Camunda Hub folded Console into the same persistent shell as
|
|
900
|
+
// Modeler/home: Console's Dashboard/Clusters/Organization links are just
|
|
901
|
+
// another section of the same "Main navigation" sidebar, not a separate
|
|
902
|
+
// app to switch into. Its header banner (homePage.consoleBanner, via
|
|
903
|
+
// hubHeader) is already visible from any Hub page, so there is no
|
|
904
|
+
// navigation action needed here -- mirrors the same hostname guard in
|
|
905
|
+
// clickModeler(). Ported from pages/8.9/AppsPage.ts. The diagram editor
|
|
906
|
+
// is the exception: it has no "Main navigation" sidebar, so a caller
|
|
907
|
+
// arriving from Deploy & run would find no Clusters/Environments link.
|
|
908
|
+
if (new URL(this.page.url()).hostname.startsWith('hub.')) {
|
|
909
|
+
if (!(await this.hubSidebar.isVisible().catch(() => false))) {
|
|
910
|
+
await this.clickModeler();
|
|
911
|
+
await (0, test_1.expect)(this.hubSidebar).toBeVisible({ timeout: 30000 });
|
|
912
|
+
}
|
|
913
|
+
return;
|
|
914
|
+
}
|
|
915
|
+
const maxRetries = 3;
|
|
916
|
+
// nav V2 breadcrumb switcher: Console is a `menuitemradio`, the legacy
|
|
917
|
+
// apps flyout renders it as a link. Resolve whichever this build shows.
|
|
918
|
+
const consoleEntry = this.consoleMenuItem.or(this.consoleLink).first();
|
|
919
|
+
for (let retries = 0; retries < maxRetries; retries++) {
|
|
920
|
+
try {
|
|
921
|
+
if (retries > 0) {
|
|
922
|
+
await this.clickCamundaApps();
|
|
923
|
+
}
|
|
924
|
+
if (await this.entryAppeared(consoleEntry)) {
|
|
925
|
+
await consoleEntry.click();
|
|
926
|
+
return;
|
|
927
|
+
}
|
|
928
|
+
// Nothing to click, because the nav V2 breadcrumb switcher lists only
|
|
929
|
+
// the cluster's OWN webapps (Operate, Tasklist, Optimize, Admin) —
|
|
930
|
+
// which is why `clickOperate` resolves from Admin through
|
|
931
|
+
// `operateMenuItem` and this does not. Console is org-level and has no
|
|
932
|
+
// entry there, but it IS what `baseURL` points at, so navigate to it
|
|
933
|
+
// directly rather than re-opening a menu that will never list it.
|
|
934
|
+
await this.page.goto('/', { waitUntil: 'domcontentloaded' });
|
|
935
|
+
return;
|
|
936
|
+
}
|
|
937
|
+
catch (error) {
|
|
938
|
+
console.warn(`Click attempt ${retries + 1} failed: ${error}`);
|
|
939
|
+
// The other three app hand-offs (`clickTasklist`, `clickOperate`,
|
|
940
|
+
// `clickOptimize`) all reload here; this one only slept, and a slept
|
|
941
|
+
// retry re-opens the very same apps menu that just failed to list
|
|
942
|
+
// Console. When the shell is the thing that did not finish rendering
|
|
943
|
+
// -- the tab is still mid SSO hand-off, or `clickCamundaApps` found
|
|
944
|
+
// none of its four triggers and returned without opening anything --
|
|
945
|
+
// nothing changes between attempts and all three burn their 30s wait
|
|
946
|
+
// on an entry that was never going to appear. Re-render the shell
|
|
947
|
+
// instead, then let the loop re-open the menu.
|
|
948
|
+
await this.reloadForRecovery('opening Console');
|
|
949
|
+
await (0, sleep_1.sleep)(10000);
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
throw new Error(`Failed to click the console link after ${maxRetries} attempts.`);
|
|
953
|
+
}
|
|
954
|
+
// On Hub the cluster name scopes the lookup: there is no app switcher,
|
|
955
|
+
// only each cluster's own sidebar group.
|
|
956
|
+
async assertOperatePresent(clusterName, shouldBeVisible = true) {
|
|
957
|
+
if (new URL(this.page.url()).hostname.startsWith('hub.')) {
|
|
958
|
+
await this.assertHubClusterAppPresent(clusterName, 'Operate', shouldBeVisible);
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
const maxRetries = 3;
|
|
962
|
+
for (let retries = 0; retries < maxRetries; retries++) {
|
|
963
|
+
try {
|
|
964
|
+
const isVisible = await this.operateLink.isVisible({ timeout: 5000 });
|
|
965
|
+
if (shouldBeVisible) {
|
|
966
|
+
if (isVisible) {
|
|
967
|
+
// Single Cluster
|
|
968
|
+
await (0, test_1.expect)(this.operateLink).toBeVisible();
|
|
969
|
+
}
|
|
970
|
+
else if (await this.operateListItem
|
|
971
|
+
.getByRole('button', { expanded: true })
|
|
972
|
+
.isHidden({ timeout: 5000 })) {
|
|
973
|
+
// Multiple Cluster
|
|
974
|
+
await (0, test_1.expect)(this.operateButton).toBeVisible();
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
else {
|
|
978
|
+
await (0, test_1.expect)(this.operateLink).not.toBeVisible();
|
|
979
|
+
}
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
catch (error) {
|
|
983
|
+
console.warn(`Click attempt ${retries + 1} failed: ${error}`);
|
|
984
|
+
await new Promise((resolve) => setTimeout(resolve, 10000));
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
throw new Error(`Failed to assert the operate link visibility after ${maxRetries} attempts.`);
|
|
988
|
+
}
|
|
989
|
+
// On Hub the cluster name scopes the lookup: there is no app switcher,
|
|
990
|
+
// only each cluster's own sidebar group.
|
|
991
|
+
async assertTasklistPresent(clusterName, shouldBeVisible = true) {
|
|
992
|
+
if (new URL(this.page.url()).hostname.startsWith('hub.')) {
|
|
993
|
+
await this.assertHubClusterAppPresent(clusterName, 'Tasklist', shouldBeVisible);
|
|
994
|
+
return;
|
|
995
|
+
}
|
|
996
|
+
const maxRetries = 3;
|
|
997
|
+
for (let retries = 0; retries < maxRetries; retries++) {
|
|
998
|
+
try {
|
|
999
|
+
const isVisible = await this.tasklistLink.isVisible({ timeout: 5000 });
|
|
1000
|
+
if (shouldBeVisible) {
|
|
1001
|
+
if (isVisible) {
|
|
1002
|
+
// Single Cluster
|
|
1003
|
+
await (0, test_1.expect)(this.tasklistLink).toBeVisible();
|
|
1004
|
+
}
|
|
1005
|
+
else if (await this.tasklistListItem
|
|
1006
|
+
.getByRole('button', { expanded: true })
|
|
1007
|
+
.isHidden({ timeout: 5000 })) {
|
|
1008
|
+
// Multiple Cluster
|
|
1009
|
+
await (0, test_1.expect)(this.tasklistButton).toBeVisible();
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
else {
|
|
1013
|
+
await (0, test_1.expect)(this.tasklistLink).not.toBeVisible();
|
|
1014
|
+
}
|
|
1015
|
+
return;
|
|
1016
|
+
}
|
|
1017
|
+
catch (error) {
|
|
1018
|
+
console.warn(`Click attempt ${retries + 1} failed: ${error}`);
|
|
1019
|
+
await new Promise((resolve) => setTimeout(resolve, 10000));
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
throw new Error(`Failed to assert the tasklist link visibility after ${maxRetries} attempts.`);
|
|
1023
|
+
}
|
|
1024
|
+
// On Hub the cluster name scopes the lookup: there is no app switcher,
|
|
1025
|
+
// only each cluster's own sidebar group.
|
|
1026
|
+
async assertOptimizePresent(clusterName, shouldBeVisible = true) {
|
|
1027
|
+
if (new URL(this.page.url()).hostname.startsWith('hub.')) {
|
|
1028
|
+
await this.assertHubClusterAppPresent(clusterName, 'Optimize', shouldBeVisible);
|
|
1029
|
+
return;
|
|
1030
|
+
}
|
|
1031
|
+
const maxRetries = 3;
|
|
1032
|
+
for (let retries = 0; retries < maxRetries; retries++) {
|
|
1033
|
+
try {
|
|
1034
|
+
const isVisible = await this.optimizeLink.isVisible({ timeout: 5000 });
|
|
1035
|
+
if (shouldBeVisible) {
|
|
1036
|
+
if (isVisible) {
|
|
1037
|
+
// Single Cluster
|
|
1038
|
+
await (0, test_1.expect)(this.optimizeLink).toBeVisible();
|
|
1039
|
+
}
|
|
1040
|
+
else if (await this.optimizeListItem
|
|
1041
|
+
.getByRole('button', { expanded: true })
|
|
1042
|
+
.isHidden({ timeout: 5000 })) {
|
|
1043
|
+
// Multiple Cluster
|
|
1044
|
+
await (0, test_1.expect)(this.optimizeButton).toBeVisible();
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
else {
|
|
1048
|
+
await (0, test_1.expect)(this.optimizeLink).not.toBeVisible();
|
|
1049
|
+
}
|
|
1050
|
+
return;
|
|
1051
|
+
}
|
|
1052
|
+
catch (error) {
|
|
1053
|
+
console.warn(`Click attempt ${retries + 1} failed: ${error}`);
|
|
1054
|
+
await new Promise((resolve) => setTimeout(resolve, 10000));
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
throw new Error(`Failed to assert the optimize link visibility after ${maxRetries} attempts.`);
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
exports.AppsPage = AppsPage;
|