@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,48 @@
|
|
|
1
|
+
import { Page, Locator } from '@playwright/test';
|
|
2
|
+
declare class ClusterSecretsPage {
|
|
3
|
+
private page;
|
|
4
|
+
readonly createNewSecretButton: Locator;
|
|
5
|
+
readonly keyInput: Locator;
|
|
6
|
+
readonly valueInput: Locator;
|
|
7
|
+
readonly createButton: Locator;
|
|
8
|
+
readonly optionsButton: Locator;
|
|
9
|
+
readonly deleteConnectorSecretButton: Locator;
|
|
10
|
+
readonly deleteConnectorSecretSubButton: Locator;
|
|
11
|
+
readonly dialog: Locator;
|
|
12
|
+
readonly importButton: Locator;
|
|
13
|
+
readonly fromFileButton: Locator;
|
|
14
|
+
readonly bulkImportTextArea: Locator;
|
|
15
|
+
readonly dialogImportButton: Locator;
|
|
16
|
+
readonly bulkImportCancelButton: Locator;
|
|
17
|
+
readonly bulkImportErrorBanner: Locator;
|
|
18
|
+
readonly secretsSearchBox: Locator;
|
|
19
|
+
readonly clusterBanner: Locator;
|
|
20
|
+
readonly clusterLink: (name: string) => Locator;
|
|
21
|
+
readonly clusterSecretTab: Locator;
|
|
22
|
+
readonly confirmDeleteInput: Locator;
|
|
23
|
+
constructor(page: Page);
|
|
24
|
+
deleteConnectorSecretsIfExist(): Promise<void>;
|
|
25
|
+
clickCreateNewSecretButton(cluster: string): Promise<void>;
|
|
26
|
+
clickClusterBanner(): Promise<void>;
|
|
27
|
+
clickCluster(name: string): Promise<void>;
|
|
28
|
+
clickKeyInput(): Promise<void>;
|
|
29
|
+
fillKeyInput(key: string): Promise<void>;
|
|
30
|
+
clickValueInput(): Promise<void>;
|
|
31
|
+
fillValueInput(value: string): Promise<void>;
|
|
32
|
+
clickCreateButton(): Promise<void>;
|
|
33
|
+
createNewSecret(key: string, value: string, cluster: string): Promise<void>;
|
|
34
|
+
createSetOfSecrets(cluster: string, secrets: {
|
|
35
|
+
name: string;
|
|
36
|
+
value: string;
|
|
37
|
+
}[]): Promise<void>;
|
|
38
|
+
assertSecretsOrCreate(cluster: string, secrets: {
|
|
39
|
+
name: string;
|
|
40
|
+
value: string;
|
|
41
|
+
}[]): Promise<void>;
|
|
42
|
+
clickImportButton(): Promise<void>;
|
|
43
|
+
bulkImportSecrets(secrets: {
|
|
44
|
+
name: string;
|
|
45
|
+
value: string;
|
|
46
|
+
}[]): Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
export { ClusterSecretsPage };
|
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClusterSecretsPage = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
const sleep_1 = require("../../utils/sleep");
|
|
6
|
+
const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
|
|
7
|
+
class ClusterSecretsPage {
|
|
8
|
+
page;
|
|
9
|
+
createNewSecretButton;
|
|
10
|
+
keyInput;
|
|
11
|
+
valueInput;
|
|
12
|
+
createButton;
|
|
13
|
+
optionsButton;
|
|
14
|
+
deleteConnectorSecretButton;
|
|
15
|
+
deleteConnectorSecretSubButton;
|
|
16
|
+
dialog;
|
|
17
|
+
importButton;
|
|
18
|
+
fromFileButton;
|
|
19
|
+
bulkImportTextArea;
|
|
20
|
+
dialogImportButton;
|
|
21
|
+
bulkImportCancelButton;
|
|
22
|
+
bulkImportErrorBanner;
|
|
23
|
+
secretsSearchBox;
|
|
24
|
+
clusterBanner;
|
|
25
|
+
clusterLink;
|
|
26
|
+
clusterSecretTab;
|
|
27
|
+
confirmDeleteInput;
|
|
28
|
+
constructor(page) {
|
|
29
|
+
this.page = page;
|
|
30
|
+
this.createNewSecretButton = page.getByRole('button', {
|
|
31
|
+
name: 'Create new secret',
|
|
32
|
+
});
|
|
33
|
+
this.keyInput = page.getByRole('dialog').getByLabel('Key');
|
|
34
|
+
this.valueInput = page
|
|
35
|
+
.getByRole('dialog')
|
|
36
|
+
.getByLabel('Value', { exact: true });
|
|
37
|
+
this.createButton = page.getByRole('button', { name: 'Create', exact: true });
|
|
38
|
+
this.optionsButton = page
|
|
39
|
+
.getByRole('cell', { name: 'Options' })
|
|
40
|
+
.getByRole('button');
|
|
41
|
+
this.deleteConnectorSecretButton = page.getByRole('menuitem', {
|
|
42
|
+
name: 'Delete',
|
|
43
|
+
exact: true,
|
|
44
|
+
});
|
|
45
|
+
this.deleteConnectorSecretSubButton = page.getByRole('button', {
|
|
46
|
+
name: 'danger Delete',
|
|
47
|
+
});
|
|
48
|
+
this.dialog = page.getByRole('dialog');
|
|
49
|
+
this.importButton = page.getByRole('button', { name: 'Import', exact: true });
|
|
50
|
+
this.fromFileButton = page.getByText('from File', { exact: true });
|
|
51
|
+
this.bulkImportTextArea = page.locator('[id="bulk-import-content"]');
|
|
52
|
+
this.dialogImportButton = this.page
|
|
53
|
+
.getByRole('dialog')
|
|
54
|
+
.getByRole('button', { name: 'Import', exact: true });
|
|
55
|
+
this.bulkImportCancelButton = this.dialog.getByRole('button', {
|
|
56
|
+
name: 'Cancel',
|
|
57
|
+
exact: true,
|
|
58
|
+
});
|
|
59
|
+
// Hub's Import secrets dialog reports partial failures as "Imported X of
|
|
60
|
+
// Y secrets. Not imported: <key> — a secret with this key already
|
|
61
|
+
// exists; ..." -- confirmed from the PR #3629 CI trace screenshot for
|
|
62
|
+
// "Create AWS Cluster". This page object is also still exercised on the
|
|
63
|
+
// legacy Console under IS_PROD (that shell reports "Imported X secrets, Y
|
|
64
|
+
// failed" instead), so match either rather than assuming every env has
|
|
65
|
+
// rolled Hub out.
|
|
66
|
+
this.bulkImportErrorBanner = this.dialog
|
|
67
|
+
.getByText(/Imported \d+ of \d+ secrets?\./)
|
|
68
|
+
.or(this.dialog.getByText(/Imported \d+ secrets?, \d+ failed/));
|
|
69
|
+
// "Filter table" was Carbon's default TableToolbarSearch label. Camunda
|
|
70
|
+
// Hub's rebranded panel renders a plain "Search" input instead, so the
|
|
71
|
+
// old exact-name match never resolves and assertSecretsOrCreate falls
|
|
72
|
+
// through to (re-)creating secrets that may already exist. Match either
|
|
73
|
+
// (see the 8.9 sibling fix, confirmed via a live trace).
|
|
74
|
+
this.secretsSearchBox = page
|
|
75
|
+
.getByRole('searchbox', { name: 'Filter table' })
|
|
76
|
+
.or(page.getByRole('searchbox', { name: 'Search' }))
|
|
77
|
+
.or(page.getByPlaceholder('Search'));
|
|
78
|
+
// Camunda Hub has no `banner` landmark; "Clusters" instead lives in its
|
|
79
|
+
// persistent "Main navigation" sidebar, and once the org has environments
|
|
80
|
+
// enabled that link is further renamed "Environments" (same rollout
|
|
81
|
+
// HomePage.clusterTab handles).
|
|
82
|
+
this.clusterBanner = this.page
|
|
83
|
+
.getByRole('banner')
|
|
84
|
+
.getByRole('link', { name: 'Clusters' })
|
|
85
|
+
.or(this.page
|
|
86
|
+
.getByRole('navigation', { name: 'Main navigation' })
|
|
87
|
+
.getByRole('link', { name: 'Clusters', exact: true }))
|
|
88
|
+
.or(this.page
|
|
89
|
+
.getByRole('navigation', { name: 'Main navigation' })
|
|
90
|
+
.getByRole('link', { name: 'Environments', exact: true }));
|
|
91
|
+
// Scope the cluster link to its row in the clusters table, the way
|
|
92
|
+
// ClusterPage.clusterLink already does (see the note on
|
|
93
|
+
// ClusterPage.clusterRow). A page-wide getByRole('link', {name}) matches
|
|
94
|
+
// two more things and turns an ordinary click into a strict-mode
|
|
95
|
+
// violation: Hub's sidebar entry for the same environment, and every
|
|
96
|
+
// extra row when the org holds several clusters under one name -- which
|
|
97
|
+
// it does as soon as a failed create is retried, because the Console
|
|
98
|
+
// enforces name uniqueness only per region. The comment on
|
|
99
|
+
// clickClusterBanner() below already describes this locator as
|
|
100
|
+
// row-based; now it is.
|
|
101
|
+
const clustersList = page
|
|
102
|
+
.getByRole('row')
|
|
103
|
+
.filter({ hasNotText: 'Generation' }); // Filter out header row
|
|
104
|
+
this.clusterLink = (name) => clustersList
|
|
105
|
+
.filter({ has: page.getByRole('link', { name: name, exact: true }) })
|
|
106
|
+
.first()
|
|
107
|
+
.getByRole('link', { name: name, exact: true });
|
|
108
|
+
// Some environments render this tab as "Cluster secrets" rather than
|
|
109
|
+
// "Connector Secrets" -- match either (see ClusterPage's identical
|
|
110
|
+
// connectorSecretsTab fallback; this page object has its own separate
|
|
111
|
+
// locator and was missing it).
|
|
112
|
+
this.clusterSecretTab = this.page
|
|
113
|
+
.getByRole('tab', { name: 'Cluster secrets' })
|
|
114
|
+
.or(this.page.getByRole('tab', { name: 'Connector Secrets' }));
|
|
115
|
+
this.confirmDeleteInput = page.getByRole('textbox', {
|
|
116
|
+
name: 'Type the word DELETE to confirm',
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
async deleteConnectorSecretsIfExist() {
|
|
120
|
+
try {
|
|
121
|
+
await (0, test_1.expect)(this.optionsButton.first()).toBeVisible({
|
|
122
|
+
timeout: 10000,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
return; //No Connector Secrets found in the list
|
|
127
|
+
}
|
|
128
|
+
try {
|
|
129
|
+
let options = await this.optionsButton.all();
|
|
130
|
+
while (options.length > 0) {
|
|
131
|
+
const operationButton = options[0];
|
|
132
|
+
if (await operationButton.isVisible()) {
|
|
133
|
+
await operationButton.click({ timeout: 60000 });
|
|
134
|
+
await this.deleteConnectorSecretButton.click({ timeout: 60000 });
|
|
135
|
+
await (0, test_1.expect)(this.dialog).toBeVisible({ timeout: 40000 });
|
|
136
|
+
await this.deleteConnectorSecretSubButton.click();
|
|
137
|
+
await (0, test_1.expect)(this.page.getByText('Deleting...')).not.toBeVisible({
|
|
138
|
+
timeout: 60000,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
142
|
+
await sleep(3000);
|
|
143
|
+
options = await this.optionsButton.all();
|
|
144
|
+
}
|
|
145
|
+
await (0, test_1.expect)(this.optionsButton).not.toBeVisible({
|
|
146
|
+
timeout: 30000,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
console.error('Error during Connector Secrets deletion: ', error);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
async clickCreateNewSecretButton(cluster) {
|
|
154
|
+
try {
|
|
155
|
+
await this.createNewSecretButton.click({ timeout: 60000 });
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
// fall through to the recovery path below
|
|
160
|
+
}
|
|
161
|
+
// CI (PR #3629, "Create Default Cluster" / "Create AWS Cluster") showed
|
|
162
|
+
// the "Connector Secrets" tab still not rendered 30s after navigating
|
|
163
|
+
// back to the cluster -- a single recovery attempt isn't always enough
|
|
164
|
+
// once the page is this slow to settle, so retry the whole
|
|
165
|
+
// banner->cluster->tab sequence rather than failing on the first miss.
|
|
166
|
+
const maxAttempts = 3;
|
|
167
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
168
|
+
await this.clickClusterBanner();
|
|
169
|
+
await this.clickCluster(cluster);
|
|
170
|
+
try {
|
|
171
|
+
await this.clusterSecretTab.click({ timeout: 30000 });
|
|
172
|
+
await this.createNewSecretButton.click({ timeout: 30000 });
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
catch (error) {
|
|
176
|
+
if (attempt === maxAttempts) {
|
|
177
|
+
throw error;
|
|
178
|
+
}
|
|
179
|
+
console.warn(`clickCreateNewSecretButton: recovery attempt ${attempt}/${maxAttempts} failed; retrying. ${error}`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
async clickClusterBanner() {
|
|
184
|
+
await (0, test_1.expect)(this.clusterBanner).toBeVisible({ timeout: 30000 });
|
|
185
|
+
await this.clusterBanner.click({ timeout: 60000 });
|
|
186
|
+
// Landing on Hub's Environments overview (see clusterBanner above) renders
|
|
187
|
+
// clusters as cards, not the getByRole('link') the clusterLink() locator
|
|
188
|
+
// below expects to find directly -- route through the page's own
|
|
189
|
+
// "Clusters" tab to reach the classic route. Same fix as
|
|
190
|
+
// HomePage.clickClusters().
|
|
191
|
+
const clustersPageTab = this.page
|
|
192
|
+
.getByRole('navigation', { name: 'Environments views' })
|
|
193
|
+
.getByRole('link', { name: 'Clusters', exact: true });
|
|
194
|
+
// On Hub this tab is required -- clickCluster()'s row-based clusterLink
|
|
195
|
+
// resolves nothing on the card-based Environments overview, so a slow
|
|
196
|
+
// render must not be treated as "tab doesn't exist" the way the legacy
|
|
197
|
+
// (non-Hub) shell's 5s probe is allowed to.
|
|
198
|
+
if (new URL(this.page.url()).hostname.startsWith('hub.')) {
|
|
199
|
+
await (0, test_1.expect)(clustersPageTab).toBeVisible({ timeout: 30000 });
|
|
200
|
+
await clustersPageTab.click({ timeout: 15000 });
|
|
201
|
+
}
|
|
202
|
+
else if (await clustersPageTab.isVisible({ timeout: 5000 }).catch(() => false)) {
|
|
203
|
+
await clustersPageTab.click({ timeout: 15000 });
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
async clickCluster(name) {
|
|
207
|
+
await (0, test_1.expect)(this.clusterLink(name)).toBeVisible({ timeout: 30000 });
|
|
208
|
+
await this.clusterLink(name).click();
|
|
209
|
+
}
|
|
210
|
+
async clickKeyInput() {
|
|
211
|
+
await (0, test_1.expect)(this.keyInput).toBeVisible({ timeout: 60000 });
|
|
212
|
+
await this.keyInput.click({ timeout: 30000 });
|
|
213
|
+
}
|
|
214
|
+
async fillKeyInput(key) {
|
|
215
|
+
await this.keyInput.fill(key, { timeout: 30000 });
|
|
216
|
+
}
|
|
217
|
+
async clickValueInput() {
|
|
218
|
+
await (0, test_1.expect)(this.valueInput).toBeVisible({ timeout: 60000 });
|
|
219
|
+
await this.valueInput.click({ timeout: 30000 });
|
|
220
|
+
}
|
|
221
|
+
async fillValueInput(value) {
|
|
222
|
+
const maxRetries = 3;
|
|
223
|
+
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
224
|
+
try {
|
|
225
|
+
await this.valueInput.fill(value, { timeout: 30000 });
|
|
226
|
+
const inputValue = await this.valueInput.inputValue();
|
|
227
|
+
if (inputValue === value) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
console.log(`Attempt ${attempt}: Value input not filled correctly. Expected: "${value}", Got: "${inputValue}"`);
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
console.log(`Attempt ${attempt}: Error filling value input:`, error);
|
|
234
|
+
}
|
|
235
|
+
if (attempt < maxRetries) {
|
|
236
|
+
await this.valueInput.clear();
|
|
237
|
+
await this.valueInput.click({ timeout: 30000 });
|
|
238
|
+
await (0, sleep_1.sleep)(1000);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
throw new Error(`Failed to fill value input after ${maxRetries} attempts`);
|
|
242
|
+
}
|
|
243
|
+
async clickCreateButton() {
|
|
244
|
+
await (0, test_1.expect)(this.createButton).toBeVisible({ timeout: 60000 });
|
|
245
|
+
await this.createButton.click({ timeout: 30000 });
|
|
246
|
+
}
|
|
247
|
+
async createNewSecret(key, value, cluster) {
|
|
248
|
+
await this.clickCreateNewSecretButton(cluster);
|
|
249
|
+
await this.clickKeyInput();
|
|
250
|
+
await this.fillKeyInput(key);
|
|
251
|
+
await (0, sleep_1.sleep)(1000);
|
|
252
|
+
await this.clickValueInput();
|
|
253
|
+
await this.fillValueInput(value);
|
|
254
|
+
await (0, sleep_1.sleep)(1000);
|
|
255
|
+
await this.clickCreateButton();
|
|
256
|
+
await (0, test_1.expect)(this.page.getByText('Creating...')).not.toBeVisible({
|
|
257
|
+
timeout: 60000,
|
|
258
|
+
});
|
|
259
|
+
const secretRow = this.page.getByRole('row', {
|
|
260
|
+
name: new RegExp(`^${key}\\b`, 'i'),
|
|
261
|
+
});
|
|
262
|
+
// Two separate CI runs (35854706213 with 7 secrets, and 36011511221 with
|
|
263
|
+
// 13) each showed 100% of secrets taking the reload path on attempt 1 --
|
|
264
|
+
// not an occasional race, and not even "near-universal": zero exceptions
|
|
265
|
+
// across 20 samples. A wait on the unreloaded panel was therefore never
|
|
266
|
+
// going to pay off, so reload unconditionally before the first check
|
|
267
|
+
// instead of probing a state that has never once been the real one.
|
|
268
|
+
await this.page.reload({ waitUntil: 'domcontentloaded' });
|
|
269
|
+
await this.clickClusterBanner();
|
|
270
|
+
await this.clickCluster(cluster);
|
|
271
|
+
await this.clusterSecretTab.click({ timeout: 30000 });
|
|
272
|
+
const maxAttempts = 3;
|
|
273
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
274
|
+
try {
|
|
275
|
+
await (0, test_1.expect)(this.createNewSecretButton).toBeVisible({
|
|
276
|
+
timeout: 60000,
|
|
277
|
+
});
|
|
278
|
+
// The button reappearing only proves the panel re-rendered, not that
|
|
279
|
+
// this specific secret was created -- a failed create request can
|
|
280
|
+
// leave the panel in the same state. Verify the row before
|
|
281
|
+
// returning: CI showed the row can lag briefly behind the button on
|
|
282
|
+
// a slow reload.
|
|
283
|
+
//
|
|
284
|
+
// Filter down to this key first: a live CI trace (run 36001802609,
|
|
285
|
+
// "Create Default Cluster") showed the unfiltered check time out on
|
|
286
|
+
// both attempts even though the key was confirmed present -- the
|
|
287
|
+
// create POST itself returned 409 (already exists) and the API's own
|
|
288
|
+
// list included it -- because the cluster's shared, reused secret set
|
|
289
|
+
// had grown past what the alphabetically-sorted table renders without
|
|
290
|
+
// narrowing it, the same "off-screen in a long list" pattern
|
|
291
|
+
// documented for Hub's other list views. assertSecretsOrCreate
|
|
292
|
+
// already searches before deciding a secret is missing; do the same
|
|
293
|
+
// here before concluding the create failed.
|
|
294
|
+
await (0, test_1.expect)(this.secretsSearchBox).toBeVisible({ timeout: 10000 });
|
|
295
|
+
await this.secretsSearchBox.fill(key);
|
|
296
|
+
await (0, test_1.expect)(secretRow).toBeVisible({ timeout: 60000 });
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
catch (error) {
|
|
300
|
+
if (attempt === maxAttempts) {
|
|
301
|
+
throw error;
|
|
302
|
+
}
|
|
303
|
+
// The secrets panel can land in a Carbon "Oops ... something went
|
|
304
|
+
// wrong." state after a background request fails post-create, which
|
|
305
|
+
// never recovers on its own and only clears on a reload. Reload
|
|
306
|
+
// unconditionally rather than gating on an "Oops" heading: PR#3627's
|
|
307
|
+
// CI hit this same timeout with no Oops heading ever rendered, and
|
|
308
|
+
// the panel still only recovered on a reload -- the same
|
|
309
|
+
// unconditional reload bulkImportSecrets() already uses on this
|
|
310
|
+
// identical panel. A single retry wasn't always enough either on
|
|
311
|
+
// this suite's shared, reused cluster, so retry more than once.
|
|
312
|
+
console.warn(`createNewSecret: "${key}" was created but the secrets list did not re-render (attempt ${attempt}/${maxAttempts}); reloading and retrying. ${error}`);
|
|
313
|
+
await this.page.reload({ waitUntil: 'domcontentloaded' });
|
|
314
|
+
// The reload lands back on the cluster's default Overview tab, not
|
|
315
|
+
// Connector Secrets -- a CI failure screenshot confirmed the page
|
|
316
|
+
// stuck there with the secrets panel never reached, so
|
|
317
|
+
// createNewSecretButton was never going to reappear on the next
|
|
318
|
+
// attempt regardless of whether the reload fixed the underlying
|
|
319
|
+
// render issue. Re-navigate to the tab before retrying.
|
|
320
|
+
await this.clickClusterBanner();
|
|
321
|
+
await this.clickCluster(cluster);
|
|
322
|
+
await this.clusterSecretTab.click({ timeout: 30000 });
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
async createSetOfSecrets(cluster, secrets) {
|
|
327
|
+
await this.bulkImportSecrets(secrets);
|
|
328
|
+
await this.assertSecretsOrCreate(cluster, secrets);
|
|
329
|
+
}
|
|
330
|
+
async assertSecretsOrCreate(cluster, secrets) {
|
|
331
|
+
for (const secret of secrets) {
|
|
332
|
+
try {
|
|
333
|
+
await (0, test_1.expect)(this.secretsSearchBox).toBeVisible();
|
|
334
|
+
await this.secretsSearchBox.click();
|
|
335
|
+
await this.secretsSearchBox.fill(secret.name);
|
|
336
|
+
const row = this.page.getByRole('row', {
|
|
337
|
+
name: new RegExp(`^${secret.name}\\b`, 'i'),
|
|
338
|
+
});
|
|
339
|
+
await (0, test_1.expect)(row).toBeVisible({ timeout: 5000 });
|
|
340
|
+
}
|
|
341
|
+
catch (error) {
|
|
342
|
+
console.error(`Creating secret for ${secret.name}`);
|
|
343
|
+
await this.createNewSecret(secret.name, secret.value, cluster);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
async clickImportButton() {
|
|
348
|
+
await (0, test_1.expect)(this.importButton).toBeVisible({ timeout: 30000 });
|
|
349
|
+
await this.importButton.click();
|
|
350
|
+
}
|
|
351
|
+
async bulkImportSecrets(secrets) {
|
|
352
|
+
const mapped = secrets
|
|
353
|
+
.map((secret) => `${secret.name}=${secret.value}`)
|
|
354
|
+
.join('\n');
|
|
355
|
+
await this.clickImportButton();
|
|
356
|
+
if (!(await this.dialog.isVisible())) {
|
|
357
|
+
await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.fromFileButton, {
|
|
358
|
+
postAction: async () => {
|
|
359
|
+
await this.clickImportButton();
|
|
360
|
+
},
|
|
361
|
+
});
|
|
362
|
+
await this.fromFileButton.click();
|
|
363
|
+
}
|
|
364
|
+
await (0, test_1.expect)(this.dialog).toBeVisible();
|
|
365
|
+
await this.bulkImportTextArea.click();
|
|
366
|
+
await this.bulkImportTextArea.fill(mapped);
|
|
367
|
+
await this.dialogImportButton.click();
|
|
368
|
+
// This suite intentionally reuses a fixed cluster across nightly runs
|
|
369
|
+
// (see ensureClusterViaApi in test-setup.spec.ts), so some or all of
|
|
370
|
+
// these secrets can already exist from a previous run. The Console then
|
|
371
|
+
// leaves the dialog open with an "Imported X secrets, Y failed" banner
|
|
372
|
+
// instead of closing it, which used to hang here for 60s and fail setup
|
|
373
|
+
// outright. Tolerate that banner and close the dialog ourselves --
|
|
374
|
+
// assertSecretsOrCreate() (the very next call in createSetOfSecrets)
|
|
375
|
+
// independently verifies every requested secret is present and creates
|
|
376
|
+
// any that are genuinely missing, so this doesn't mask a real failure,
|
|
377
|
+
// it just defers the correctness check to the step that already owns it.
|
|
378
|
+
try {
|
|
379
|
+
await (0, test_1.expect)(this.dialog).not.toBeVisible({ timeout: 60000 });
|
|
380
|
+
}
|
|
381
|
+
catch (error) {
|
|
382
|
+
if (await this.bulkImportErrorBanner.isVisible().catch(() => false)) {
|
|
383
|
+
await this.bulkImportCancelButton.click();
|
|
384
|
+
await (0, test_1.expect)(this.dialog).not.toBeVisible({ timeout: 10000 });
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
throw error;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
await (0, test_1.expect)(this.createNewSecretButton).toBeVisible({
|
|
391
|
+
timeout: 60000,
|
|
392
|
+
});
|
|
393
|
+
await this.page.reload();
|
|
394
|
+
// Hub keeps the selected cluster tab out of the URL, so the reload lands
|
|
395
|
+
// on Overview, where assertSecretsOrCreate finds no search box and tries
|
|
396
|
+
// to create every secret. Re-select the tab, as pages/8.8 does (45eae7b).
|
|
397
|
+
// The cluster page can still be hydrating after the reload and snap back
|
|
398
|
+
// to Overview after the click lands (CI trace: click succeeded, the
|
|
399
|
+
// screenshot still showed Overview), so re-click until the panel renders.
|
|
400
|
+
await (0, test_1.expect)(async () => {
|
|
401
|
+
await this.clusterSecretTab.first().click({ timeout: 15000 });
|
|
402
|
+
await (0, test_1.expect)(this.createNewSecretButton).toBeVisible({ timeout: 10000 });
|
|
403
|
+
}).toPass({ timeout: 90000 });
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
exports.ClusterSecretsPage = ClusterSecretsPage;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Page, Locator } from '@playwright/test';
|
|
2
|
+
declare class ConnectorMarketplacePage {
|
|
3
|
+
private page;
|
|
4
|
+
private browseAllConnectorMarketplacePage;
|
|
5
|
+
private connectorName?;
|
|
6
|
+
private legacyMarketplaceDialog;
|
|
7
|
+
readonly searchForConnectorTextbox: Locator;
|
|
8
|
+
readonly downloadToProjectButton: Locator;
|
|
9
|
+
readonly snackbar: Locator;
|
|
10
|
+
readonly closeButton: Locator;
|
|
11
|
+
readonly addToProjectButton: Locator;
|
|
12
|
+
readonly replaceResourceButton: Locator;
|
|
13
|
+
readonly saveAsCopyButton: Locator;
|
|
14
|
+
readonly cancelButton: Locator;
|
|
15
|
+
readonly dialogTitle: Locator;
|
|
16
|
+
constructor(page: Page);
|
|
17
|
+
clickSearchForConnectorTextbox(): Promise<void>;
|
|
18
|
+
fillSearchForConnectorTextbox(connectorName: string): Promise<void>;
|
|
19
|
+
clickDownloadToProjectButton(): Promise<void>;
|
|
20
|
+
clickSnackbar(): Promise<void>;
|
|
21
|
+
clickCloseButton(): Promise<void>;
|
|
22
|
+
clickReplaceResourceButton(): Promise<void>;
|
|
23
|
+
waitForConnectorSearchResults(): Promise<void>;
|
|
24
|
+
downloadConnectorToProject(): Promise<boolean>;
|
|
25
|
+
private closeMarketplaceDialog;
|
|
26
|
+
searchAndDownloadConnector(connectorName: string): Promise<boolean>;
|
|
27
|
+
private getLegacyDownloadButton;
|
|
28
|
+
}
|
|
29
|
+
export { ConnectorMarketplacePage };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConnectorMarketplacePage = void 0;
|
|
4
|
+
const BrowseAllConnectorMarketplacePage_1 = require("../BrowseAllConnectorMarketplacePage");
|
|
5
|
+
class ConnectorMarketplacePage {
|
|
6
|
+
page;
|
|
7
|
+
browseAllConnectorMarketplacePage;
|
|
8
|
+
connectorName;
|
|
9
|
+
legacyMarketplaceDialog;
|
|
10
|
+
searchForConnectorTextbox;
|
|
11
|
+
downloadToProjectButton;
|
|
12
|
+
snackbar;
|
|
13
|
+
closeButton;
|
|
14
|
+
addToProjectButton;
|
|
15
|
+
replaceResourceButton;
|
|
16
|
+
saveAsCopyButton;
|
|
17
|
+
cancelButton;
|
|
18
|
+
dialogTitle;
|
|
19
|
+
constructor(page) {
|
|
20
|
+
this.page = page;
|
|
21
|
+
this.browseAllConnectorMarketplacePage =
|
|
22
|
+
new BrowseAllConnectorMarketplacePage_1.BrowseAllConnectorMarketplacePage(page);
|
|
23
|
+
// Title of the marketplace dialog itself — present both while the listing
|
|
24
|
+
// renders and while it is stuck on its loading spinner, so it is the one
|
|
25
|
+
// reliable marker of "the dialog is still up".
|
|
26
|
+
this.dialogTitle = page.getByText('Browse Marketplace connectors');
|
|
27
|
+
this.legacyMarketplaceDialog = page
|
|
28
|
+
.getByRole('dialog', { name: 'Browse Marketplace connectors' })
|
|
29
|
+
.or(page.getByRole('dialog', { name: 'Discover Connectors Dialog' }))
|
|
30
|
+
.first();
|
|
31
|
+
this.searchForConnectorTextbox =
|
|
32
|
+
this.browseAllConnectorMarketplacePage.searchForConnectorTextbox
|
|
33
|
+
.or(page.getByPlaceholder('Search for a connector'))
|
|
34
|
+
.first();
|
|
35
|
+
this.downloadToProjectButton = page
|
|
36
|
+
.getByRole('button', { name: 'Download to project' })
|
|
37
|
+
.first();
|
|
38
|
+
this.snackbar = page.locator('[data-test="snackbar"]');
|
|
39
|
+
this.closeButton = page.getByRole('button', { name: 'Close' });
|
|
40
|
+
this.addToProjectButton = page.getByRole('button', {
|
|
41
|
+
name: 'Add to project',
|
|
42
|
+
});
|
|
43
|
+
this.replaceResourceButton = page.getByRole('button', {
|
|
44
|
+
name: 'Replace resource',
|
|
45
|
+
});
|
|
46
|
+
this.saveAsCopyButton = page.getByRole('button', { name: 'Save as copy' });
|
|
47
|
+
this.cancelButton = page.getByRole('button', { name: 'Cancel' });
|
|
48
|
+
}
|
|
49
|
+
async clickSearchForConnectorTextbox() {
|
|
50
|
+
await this.searchForConnectorTextbox.click({ timeout: 60000 });
|
|
51
|
+
}
|
|
52
|
+
async fillSearchForConnectorTextbox(connectorName) {
|
|
53
|
+
this.connectorName = connectorName;
|
|
54
|
+
await this.searchForConnectorTextbox.fill(connectorName, { timeout: 60000 });
|
|
55
|
+
}
|
|
56
|
+
async clickDownloadToProjectButton() {
|
|
57
|
+
await this.getLegacyDownloadButton().click({ timeout: 60000 });
|
|
58
|
+
}
|
|
59
|
+
async clickSnackbar() {
|
|
60
|
+
await this.snackbar.click({ timeout: 120000 });
|
|
61
|
+
}
|
|
62
|
+
async clickCloseButton() {
|
|
63
|
+
await this.closeButton.click({ timeout: 60000 });
|
|
64
|
+
}
|
|
65
|
+
async clickReplaceResourceButton() {
|
|
66
|
+
await this.replaceResourceButton.click({ timeout: 60000 });
|
|
67
|
+
}
|
|
68
|
+
async waitForConnectorSearchResults() {
|
|
69
|
+
if (await this.browseAllConnectorMarketplacePage.isOpen()) {
|
|
70
|
+
await this.browseAllConnectorMarketplacePage.waitForConnectorSearchResult(this.connectorName);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
await this.getLegacyDownloadButton().waitFor({
|
|
74
|
+
state: 'visible',
|
|
75
|
+
timeout: 60000,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
async downloadConnectorToProject() {
|
|
79
|
+
if (await this.browseAllConnectorMarketplacePage.isOpen()) {
|
|
80
|
+
await this.browseAllConnectorMarketplacePage.importConnectorToProject(this.connectorName);
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
await this.clickDownloadToProjectButton();
|
|
84
|
+
// After clicking "Download to project", Hub fetches the connector detail
|
|
85
|
+
// and opens an ImportModal whose primary button depends on project state:
|
|
86
|
+
// "Add to project" (new template), "Replace resource" (same template
|
|
87
|
+
// exists), or "Save as copy" (conflict). Wait once for whichever of the
|
|
88
|
+
// three Hub renders, then click that one — never race three clicks, which
|
|
89
|
+
// fires all of them at the same time and hides which button was missing.
|
|
90
|
+
const importButton = this.addToProjectButton
|
|
91
|
+
.or(this.replaceResourceButton)
|
|
92
|
+
.or(this.saveAsCopyButton);
|
|
93
|
+
const imported = await importButton
|
|
94
|
+
.waitFor({ state: 'visible', timeout: 20000 })
|
|
95
|
+
.then(() => true)
|
|
96
|
+
.catch(() => false);
|
|
97
|
+
if (imported) {
|
|
98
|
+
await importButton.click({ timeout: 20000 });
|
|
99
|
+
// The snackbar confirms Hub received the template. It auto-dismisses, so
|
|
100
|
+
// a miss is not treated as fatal here — the caller proves the template
|
|
101
|
+
// landed by finding the connector in the change-element popup.
|
|
102
|
+
await this.snackbar
|
|
103
|
+
.waitFor({ state: 'visible', timeout: 60000 })
|
|
104
|
+
.catch(() => false);
|
|
105
|
+
}
|
|
106
|
+
else if (await this.cancelButton.isVisible({ timeout: 3000 }).catch(() => false)) {
|
|
107
|
+
await this.cancelButton.click({ timeout: 10000 });
|
|
108
|
+
}
|
|
109
|
+
// Always close the marketplace dialog, download or not. When Hub's
|
|
110
|
+
// connector-detail request fails (observed as a 504 on
|
|
111
|
+
// /api/external/marketplace/connectors/<id>) the dialog stays up on its
|
|
112
|
+
// loading spinner forever and swallows every click on the canvas beneath
|
|
113
|
+
// it, so leaving it open turns one failed download into a cascade of
|
|
114
|
+
// 60 s timeouts in the caller.
|
|
115
|
+
await this.closeMarketplaceDialog();
|
|
116
|
+
return imported;
|
|
117
|
+
}
|
|
118
|
+
async closeMarketplaceDialog() {
|
|
119
|
+
// Only click "Close" while the marketplace is up: a bare "Close" button
|
|
120
|
+
// otherwise matches the properties panel's own close (x) and collapses it,
|
|
121
|
+
// hiding the connector's "Input" tab the caller needs next.
|
|
122
|
+
if (!(await this.dialogTitle.isVisible().catch(() => false))) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (await this.closeButton.isVisible({ timeout: 5000 }).catch(() => false)) {
|
|
126
|
+
await this.closeButton.click({ timeout: 10000 });
|
|
127
|
+
}
|
|
128
|
+
if (await this.dialogTitle
|
|
129
|
+
.waitFor({ state: 'hidden', timeout: 10000 })
|
|
130
|
+
.then(() => true)
|
|
131
|
+
.catch(() => false)) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
// The stuck-spinner state can leave the close control unresponsive;
|
|
135
|
+
// Escape dismisses the dialog just as reliably.
|
|
136
|
+
await this.page.keyboard.press('Escape');
|
|
137
|
+
await this.dialogTitle.waitFor({ state: 'hidden', timeout: 30000 });
|
|
138
|
+
}
|
|
139
|
+
async searchAndDownloadConnector(connectorName) {
|
|
140
|
+
await this.clickSearchForConnectorTextbox();
|
|
141
|
+
await this.fillSearchForConnectorTextbox(connectorName);
|
|
142
|
+
await this.waitForConnectorSearchResults();
|
|
143
|
+
return await this.downloadConnectorToProject();
|
|
144
|
+
}
|
|
145
|
+
getLegacyDownloadButton() {
|
|
146
|
+
if (!this.connectorName) {
|
|
147
|
+
return this.downloadToProjectButton;
|
|
148
|
+
}
|
|
149
|
+
return this.legacyMarketplaceDialog
|
|
150
|
+
.getByText(this.connectorName, { exact: true })
|
|
151
|
+
.first()
|
|
152
|
+
.locator('xpath=ancestor::*[.//button[normalize-space()="Download to project"]][1]')
|
|
153
|
+
.getByRole('button', { name: 'Download to project' });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.ConnectorMarketplacePage = ConnectorMarketplacePage;
|