@camunda/e2e-test-suite 0.0.1694 → 0.0.1696
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/dist/fixtures/SM-8.10.d.ts +1 -0
- package/dist/fixtures/SM-8.10.js +36 -0
- package/dist/fixtures/SM-8.11.d.ts +1 -0
- package/dist/fixtures/SM-8.11.js +36 -0
- package/dist/fixtures/SM-8.8.d.ts +1 -0
- package/dist/fixtures/SM-8.8.js +36 -0
- package/dist/fixtures/SM-8.9.d.ts +1 -0
- package/dist/fixtures/SM-8.9.js +36 -0
- package/dist/pages/8.11/ClusterDetailsPage.d.ts +8 -1
- package/dist/pages/8.11/ClusterDetailsPage.js +32 -5
- package/dist/pages/8.11/ClusterPage.d.ts +42 -2
- package/dist/pages/8.11/ClusterPage.js +228 -31
- package/dist/pages/SM-8.10/KeycloakUtils.js +1 -0
- package/dist/pages/SM-8.10/ManagementIdentityPage.d.ts +1 -0
- package/dist/pages/SM-8.10/ManagementIdentityPage.js +9 -0
- package/dist/pages/SM-8.10/OCIdentityClusterVariablesPage.d.ts +5 -5
- package/dist/pages/SM-8.10/OCIdentityClusterVariablesPage.js +22 -12
- package/dist/pages/SM-8.10/OperateHomePage.js +4 -2
- package/dist/pages/SM-8.10/TaskPanelPage.d.ts +1 -1
- package/dist/pages/SM-8.10/TaskPanelPage.js +6 -5
- package/dist/pages/SM-8.11/KeycloakUtils.js +1 -0
- package/dist/pages/SM-8.11/ManagementIdentityPage.d.ts +1 -0
- package/dist/pages/SM-8.11/ManagementIdentityPage.js +9 -0
- package/dist/pages/SM-8.11/OCIdentityClusterVariablesPage.d.ts +5 -5
- package/dist/pages/SM-8.11/OCIdentityClusterVariablesPage.js +22 -12
- package/dist/pages/SM-8.11/OperateHomePage.js +4 -2
- package/dist/pages/SM-8.11/TaskPanelPage.d.ts +1 -1
- package/dist/pages/SM-8.11/TaskPanelPage.js +6 -5
- package/dist/pages/SM-8.9/OCIdentityClusterVariablesPage.js +3 -1
- package/dist/resources/cluster_variables/cluster_variable_tenant_json_readonly.bpmn +4 -4
- package/dist/resources/cluster_variables/cluster_variable_tenant_string_readonly.bpmn +4 -4
- package/dist/tests/8.10/optimize-api-tests.spec.js +78 -41
- package/dist/tests/8.10/optimize-collections-api.spec.js +4 -2
- package/dist/tests/8.10/optimize-sharing-alerts-export-api.spec.js +10 -5
- package/dist/tests/8.10/optimize-sharing-alerts-export-ui.spec.js +6 -3
- package/dist/tests/8.11/console-cluster-duplication-api-clients.spec.d.ts +1 -0
- package/dist/tests/8.11/console-cluster-duplication-api-clients.spec.js +154 -0
- package/dist/tests/8.11/console-cluster-duplication.spec.d.ts +1 -0
- package/dist/tests/8.11/console-cluster-duplication.spec.js +460 -0
- package/dist/tests/SM-8.10/cluster-variables-tenant.spec.d.ts +1 -0
- package/dist/tests/SM-8.10/cluster-variables-tenant.spec.js +198 -0
- package/dist/tests/SM-8.10/optimize-api-tests.spec.d.ts +1 -0
- package/dist/tests/SM-8.10/optimize-api-tests.spec.js +468 -0
- package/dist/tests/SM-8.11/cluster-variables-tenant.spec.d.ts +1 -0
- package/dist/tests/SM-8.11/cluster-variables-tenant.spec.js +198 -0
- package/dist/tests/SM-8.11/optimize-api-tests.spec.d.ts +1 -0
- package/dist/tests/SM-8.11/optimize-api-tests.spec.js +468 -0
- package/dist/tests/SM-8.9/cluster-variables-tenant.spec.js +2 -2
- package/dist/utils/apiHelpers.d.ts +4 -0
- package/dist/utils/apiHelpers.js +29 -4
- package/package.json +1 -1
- package/playwright.config.ts +104 -0
- package/resources/cluster_variables/cluster_variable_tenant_json_readonly.bpmn +4 -4
- package/resources/cluster_variables/cluster_variable_tenant_string_readonly.bpmn +4 -4
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const test_1 = require("@playwright/test");
|
|
4
|
+
const _8_11_1 = require("../../fixtures/8.11");
|
|
5
|
+
const _setup_1 = require("../../test-setup.js");
|
|
6
|
+
const UtilitiesPage_1 = require("../../pages/8.11/UtilitiesPage");
|
|
7
|
+
const users_1 = require("../../utils/users");
|
|
8
|
+
const testUser = (0, users_1.getTestUser)('mainUser');
|
|
9
|
+
/**
|
|
10
|
+
* Epic: camunda/product-hub#3824 - Console cluster duplication.
|
|
11
|
+
*
|
|
12
|
+
* Preconditions:
|
|
13
|
+
* - feature flag `console.clusterDuplication` is enabled for the organization
|
|
14
|
+
* - environment: saas-preprod
|
|
15
|
+
* - the test user is an organization admin
|
|
16
|
+
*
|
|
17
|
+
* API client carry-over. Split from the main duplication spec because these
|
|
18
|
+
* cases need an API client on the source cluster, which costs a second create
|
|
19
|
+
* and a second health wait on top of the two clusters every case here already
|
|
20
|
+
* builds.
|
|
21
|
+
*
|
|
22
|
+
* Surface. The plan called DUP-06 an API case on the grounds that a client's
|
|
23
|
+
* id and secret are rendered nowhere a UI test can read them. That is true of
|
|
24
|
+
* the id and the secret - DUP-07's subject - but not of what DUP-06 asserts.
|
|
25
|
+
* The clients table renders a client's name and its scopes, and this suite
|
|
26
|
+
* already reads both: assertAPIClientScopes() filters clientsList by name and
|
|
27
|
+
* matches the row's scopes. So DUP-06 is asserted through the UI, against the
|
|
28
|
+
* cluster duplication really created.
|
|
29
|
+
*
|
|
30
|
+
* Isolation: every case creates its own source cluster with a randomised name
|
|
31
|
+
* and deletes every cluster it created in teardown - a leaked cluster consumes
|
|
32
|
+
* a reservation and would make the reservation cases pass for the wrong reason.
|
|
33
|
+
*/
|
|
34
|
+
_8_11_1.test.describe.configure({ mode: 'parallel' });
|
|
35
|
+
_8_11_1.test.describe('Console cluster duplication - API client carry-over', () => {
|
|
36
|
+
// Everything this spec creates is tracked here so teardown runs even on failure.
|
|
37
|
+
const createdClusterNames = [];
|
|
38
|
+
_8_11_1.test.beforeEach(async ({ page, loginPage, homePage }, testInfo) => {
|
|
39
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, (testInfo.workerIndex + 1) * 1000);
|
|
40
|
+
await homePage.clickClusters();
|
|
41
|
+
});
|
|
42
|
+
_8_11_1.test.afterEach(async ({ page, loginPage, homePage, clusterPage }, testInfo) => {
|
|
43
|
+
await (0, _setup_1.captureScreenshot)(page, testInfo);
|
|
44
|
+
// Postcondition: no cluster left behind, source or duplicate.
|
|
45
|
+
const namesToDelete = [...createdClusterNames].reverse();
|
|
46
|
+
createdClusterNames.length = 0;
|
|
47
|
+
// A body that failed because the Hub session dropped ends on the identity
|
|
48
|
+
// provider's login form, where clickClusters() finds no navigation and
|
|
49
|
+
// every cluster below would leak.
|
|
50
|
+
if (namesToDelete.length > 0 &&
|
|
51
|
+
/^(weblogin|login|auth)\./.test(new URL(page.url()).host)) {
|
|
52
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, 0, 3);
|
|
53
|
+
}
|
|
54
|
+
const undeleted = [];
|
|
55
|
+
for (const clusterName of namesToDelete) {
|
|
56
|
+
try {
|
|
57
|
+
await homePage.clickClusters();
|
|
58
|
+
await clusterPage.deleteCluster(clusterName);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
// Collect rather than throw: one cluster that will not delete must
|
|
62
|
+
// not stop the others being deleted.
|
|
63
|
+
undeleted.push(`${clusterName} (${String(error)})`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
test_1.expect.soft(undeleted, 'Teardown left clusters behind').toEqual([]);
|
|
67
|
+
// Last: captureFailureVideo closes the page to flush the video, so every
|
|
68
|
+
// deletion above would run against a closed page and leak its cluster.
|
|
69
|
+
await (0, _setup_1.captureFailureVideo)(page, testInfo);
|
|
70
|
+
});
|
|
71
|
+
// DUP-06. The claim is about the duplicate the product created, so the
|
|
72
|
+
// client is read off that cluster's own API tab - never off the duplication
|
|
73
|
+
// form, which only carries the test's own input.
|
|
74
|
+
(0, _8_11_1.test)('DUP-06: each API client carries over with its name and permissions', async ({ page, homePage, clusterPage, clusterDetailsPage, }) => {
|
|
75
|
+
// Two cluster creations plus health polling - this case is long by nature.
|
|
76
|
+
_8_11_1.test.setTimeout(60 * 60 * 1000);
|
|
77
|
+
const randomSuffix = await (0, _setup_1.generateRandomStringAsync)(6);
|
|
78
|
+
const sourceClusterName = `dup06-src-${randomSuffix}`;
|
|
79
|
+
const duplicateClusterName = `dup06-copy-${randomSuffix}`;
|
|
80
|
+
const apiClientName = `dup06-client-${randomSuffix}`;
|
|
81
|
+
let createdClientName = apiClientName;
|
|
82
|
+
await _8_11_1.test.step('given a healthy source cluster carrying a named API client', async () => {
|
|
83
|
+
await clusterPage.clickClusterTab();
|
|
84
|
+
createdClusterNames.push(sourceClusterName);
|
|
85
|
+
await clusterPage.createCluster(sourceClusterName);
|
|
86
|
+
await clusterPage.assertClusterHealthyStatusWithRetry(sourceClusterName, undefined, undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
|
|
87
|
+
await homePage.clickClusters();
|
|
88
|
+
await clusterPage.clickClusterLink(sourceClusterName);
|
|
89
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
90
|
+
await clusterDetailsPage.clickAPITab();
|
|
91
|
+
// The name the client is really created with: createAPIClient() suffixes
|
|
92
|
+
// it when an attempt failed, and asserting the requested name instead
|
|
93
|
+
// would miss the client on every retried create.
|
|
94
|
+
createdClientName =
|
|
95
|
+
await clusterDetailsPage.createAPIClient(apiClientName);
|
|
96
|
+
// The source really holds the client before anything is duplicated.
|
|
97
|
+
// Without this, a missing client on the duplicate below would be
|
|
98
|
+
// indistinguishable from one that was never created at all.
|
|
99
|
+
//
|
|
100
|
+
// clickCloseModalButton() rather than assertAPIClientScopes() directly:
|
|
101
|
+
// the credentials modal is still open here, and createAPIClient() says
|
|
102
|
+
// why the list behind it cannot answer the scope check -- it can still
|
|
103
|
+
// be rendering its pre-create state, and the modal blocks the pointer
|
|
104
|
+
// events a reload would need. Closing it runs the same check.
|
|
105
|
+
await clusterDetailsPage.clickCloseModalButton();
|
|
106
|
+
});
|
|
107
|
+
await _8_11_1.test.step('when I duplicate that cluster, changing only its name', async () => {
|
|
108
|
+
await homePage.clickClusters();
|
|
109
|
+
await clusterPage.clickClusterLink(sourceClusterName);
|
|
110
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
111
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
112
|
+
await clusterPage.openDuplicateClusterForm(sourceClusterName, async () => {
|
|
113
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
114
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
115
|
+
});
|
|
116
|
+
await clusterPage.clickClusterNameInput();
|
|
117
|
+
await clusterPage.fillClusterNameInput(duplicateClusterName);
|
|
118
|
+
createdClusterNames.push(duplicateClusterName);
|
|
119
|
+
const submitDuplicate = page.getByRole('button', {
|
|
120
|
+
name: 'Duplicate cluster',
|
|
121
|
+
exact: true,
|
|
122
|
+
});
|
|
123
|
+
await (0, test_1.expect)(submitDuplicate).toBeEnabled({ timeout: 30000 });
|
|
124
|
+
// Same as DUP-01/DUP-02/DUP-04: hold the page until the duplicate POST
|
|
125
|
+
// has answered, otherwise navigating away aborts the in-flight request.
|
|
126
|
+
const duplicateResponse = page.waitForResponse((response) => response.request().method() === 'POST' &&
|
|
127
|
+
/\/clusters\/[^/]+\/duplicate$/.test(new URL(response.url()).pathname), { timeout: 60000 });
|
|
128
|
+
await submitDuplicate.click();
|
|
129
|
+
const duplicate = await duplicateResponse;
|
|
130
|
+
(0, test_1.expect)(duplicate.ok()).toBe(true);
|
|
131
|
+
const { clusterId } = await duplicate.json();
|
|
132
|
+
await page.waitForURL(new RegExp(`/cluster/${clusterId}`), {
|
|
133
|
+
timeout: 60000,
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
await _8_11_1.test.step('then the duplicate comes up healthy', async () => {
|
|
137
|
+
await homePage.clickClusters();
|
|
138
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
139
|
+
// Completion rule: a client read off a cluster that never started would
|
|
140
|
+
// say nothing about carry-over, so health is asserted before it.
|
|
141
|
+
await clusterPage.assertClusterHealthyStatusWithRetry(duplicateClusterName, undefined, undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
|
|
142
|
+
});
|
|
143
|
+
await _8_11_1.test.step('and the API client of the source is on the duplicate, with its name and permissions', async () => {
|
|
144
|
+
await homePage.clickClusters();
|
|
145
|
+
await clusterPage.clickClusterLink(duplicateClusterName);
|
|
146
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
147
|
+
await clusterDetailsPage.clickAPITab();
|
|
148
|
+
// Scoped to the duplicate's own API tab, and to the name the source's
|
|
149
|
+
// client was really created with. assertAPIClientScopes filters the
|
|
150
|
+
// clients table down to that name and matches the row's scopes.
|
|
151
|
+
await clusterDetailsPage.assertAPIClientScopes(createdClientName);
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const test_1 = require("@playwright/test");
|
|
4
|
+
const _8_11_1 = require("../../fixtures/8.11");
|
|
5
|
+
const _setup_1 = require("../../test-setup.js");
|
|
6
|
+
const UtilitiesPage_1 = require("../../pages/8.11/UtilitiesPage");
|
|
7
|
+
const users_1 = require("../../utils/users");
|
|
8
|
+
// The organisation owner: the only user every SaaS org is provisioned with,
|
|
9
|
+
// and an org admin as the preconditions below require. loginWithTestUser()
|
|
10
|
+
// reads C8_USERNAME_TEST, which is not a member of the run's org (and is not
|
|
11
|
+
// exported at all in the nightly test job, so fill() received undefined).
|
|
12
|
+
const testUser = (0, users_1.getTestUser)('mainUser');
|
|
13
|
+
// The two GCP sub-regions a non-prod org can create in. DUP-02 pins the source
|
|
14
|
+
// to one and overrides to the other: left to its default selectSubRegion()
|
|
15
|
+
// picks at random, and a source that lands on the override's region makes
|
|
16
|
+
// "the override won" indistinguishable from "the source value carried over".
|
|
17
|
+
// The strings are the rendered tile labels, not display names -- see the
|
|
18
|
+
// belgiumRegion/finlandRegion locators in pages/8.11/ClusterPage.ts.
|
|
19
|
+
const SOURCE_SUB_REGION = 'Belgium';
|
|
20
|
+
const OVERRIDE_SUB_REGION = 'Finland';
|
|
21
|
+
const SOURCE_REGION_LABEL = 'Chaos, Belgium, Europe (europe-west1)';
|
|
22
|
+
const OVERRIDE_REGION_LABEL = 'Finland, Europe (europe-north1)';
|
|
23
|
+
/**
|
|
24
|
+
* Epic: camunda/product-hub#3824 - Console cluster duplication.
|
|
25
|
+
*
|
|
26
|
+
* Preconditions:
|
|
27
|
+
* - feature flag `console.clusterDuplication` is enabled for the organization
|
|
28
|
+
* - environment: saas-preprod
|
|
29
|
+
* - the test user is an organization admin
|
|
30
|
+
*
|
|
31
|
+
* Isolation: every case creates its own source cluster with a randomised name and
|
|
32
|
+
* deletes every cluster it created in teardown - a leaked cluster consumes a
|
|
33
|
+
* reservation and would make the reservation case pass for the wrong reason.
|
|
34
|
+
*
|
|
35
|
+
* Parallel: no case reads state another writes (randomised names, per-test
|
|
36
|
+
* teardown), and each spends 10-14 minutes on cluster health polls, so serial
|
|
37
|
+
* mode stacked them into the longest chain of the full-suite pass.
|
|
38
|
+
*/
|
|
39
|
+
_8_11_1.test.describe.configure({ mode: 'parallel' });
|
|
40
|
+
_8_11_1.test.describe('Console cluster duplication', () => {
|
|
41
|
+
// Everything this spec creates is tracked here so teardown runs even on failure.
|
|
42
|
+
const createdClusterNames = [];
|
|
43
|
+
_8_11_1.test.beforeEach(async ({ page, loginPage, homePage }, testInfo) => {
|
|
44
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, (testInfo.workerIndex + 1) * 1000);
|
|
45
|
+
await homePage.clickClusters();
|
|
46
|
+
});
|
|
47
|
+
_8_11_1.test.afterEach(async ({ page, loginPage, homePage, clusterPage }, testInfo) => {
|
|
48
|
+
await (0, _setup_1.captureScreenshot)(page, testInfo);
|
|
49
|
+
// Postcondition: no cluster left behind, source or duplicate.
|
|
50
|
+
const namesToDelete = [...createdClusterNames].reverse();
|
|
51
|
+
createdClusterNames.length = 0;
|
|
52
|
+
// A body that failed because the Hub session dropped ends on the identity
|
|
53
|
+
// provider's login form, where clickClusters() finds no navigation and
|
|
54
|
+
// every cluster below would leak.
|
|
55
|
+
if (namesToDelete.length > 0 &&
|
|
56
|
+
/^(weblogin|login|auth)\./.test(new URL(page.url()).host)) {
|
|
57
|
+
await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, 0, 3);
|
|
58
|
+
}
|
|
59
|
+
const undeleted = [];
|
|
60
|
+
for (const clusterName of namesToDelete) {
|
|
61
|
+
try {
|
|
62
|
+
await homePage.clickClusters();
|
|
63
|
+
await clusterPage.deleteCluster(clusterName);
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
// Collect rather than throw: one cluster that will not delete must
|
|
67
|
+
// not strand the ones after it.
|
|
68
|
+
undeleted.push(`${clusterName} (${String(error)})`);
|
|
69
|
+
// A delete that failed half-way can leave the row-actions menu or
|
|
70
|
+
// the confirm dialog open, which blocks pointer events on the rest of
|
|
71
|
+
// the page and failed every delete after it.
|
|
72
|
+
await page.keyboard.press('Escape');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// Soft, so the video capture below still runs, but still a failure: a
|
|
76
|
+
// silent leak accumulates across nightly runs and breaks a later run
|
|
77
|
+
// instead of this one.
|
|
78
|
+
test_1.expect.soft(undeleted, 'Teardown left clusters behind').toEqual([]);
|
|
79
|
+
// Last: captureFailureVideo closes the page to flush the video, so running
|
|
80
|
+
// it before the deletions above left every cluster behind on a failure.
|
|
81
|
+
await (0, _setup_1.captureFailureVideo)(page, testInfo);
|
|
82
|
+
});
|
|
83
|
+
(0, _8_11_1.test)('DUP-01: duplicating a cluster yields a healthy running duplicate', async ({ page, homePage, clusterPage, clusterDetailsPage, clusterSecretsPage, }) => {
|
|
84
|
+
// Two cluster creations plus health polling - this case is long by nature.
|
|
85
|
+
_8_11_1.test.setTimeout(60 * 60 * 1000);
|
|
86
|
+
const randomSuffix = await (0, _setup_1.generateRandomStringAsync)(6);
|
|
87
|
+
const sourceClusterName = `dup-source-${randomSuffix}`;
|
|
88
|
+
const duplicateClusterName = `dup-copy-${randomSuffix}`;
|
|
89
|
+
await _8_11_1.test.step('given a healthy source cluster with its carried-over settings populated', async () => {
|
|
90
|
+
await clusterPage.clickClusterTab();
|
|
91
|
+
createdClusterNames.push(sourceClusterName);
|
|
92
|
+
await clusterPage.createCluster(sourceClusterName);
|
|
93
|
+
// Every health poll in this spec gets session recovery: the Hub session
|
|
94
|
+
// can drop to the identity provider's login form during these
|
|
95
|
+
// multi-minute polls, and reloading only re-renders that form (a run's
|
|
96
|
+
// retry spent its whole 500s budget on it).
|
|
97
|
+
await clusterPage.assertClusterHealthyStatusWithRetry(sourceClusterName, undefined, undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
|
|
98
|
+
// A connector secret, an API client and an alert, so the duplication has
|
|
99
|
+
// real settings to carry over instead of copying nothing.
|
|
100
|
+
await clusterSecretsPage.createNewSecret(`DUP_SECRET_${randomSuffix}`, `dup-secret-value-${randomSuffix}`, sourceClusterName);
|
|
101
|
+
await homePage.clickClusters();
|
|
102
|
+
await clusterPage.clickClusterLink(sourceClusterName);
|
|
103
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
104
|
+
await clusterDetailsPage.clickAPITab();
|
|
105
|
+
await clusterDetailsPage.createAPIClient(`dup-client-${randomSuffix}`);
|
|
106
|
+
// createAPIClient leaves the "Client credentials" modal open; it hides
|
|
107
|
+
// the cluster tabs until closed (same as console-user-flows).
|
|
108
|
+
await clusterDetailsPage.clickCloseModalButton();
|
|
109
|
+
await clusterDetailsPage.clickAlertsTab();
|
|
110
|
+
await clusterDetailsPage.createAlert(true);
|
|
111
|
+
});
|
|
112
|
+
await _8_11_1.test.step('when I select Duplicate on that cluster and submit the duplication form', async () => {
|
|
113
|
+
await homePage.clickClusters();
|
|
114
|
+
await clusterPage.clickClusterLink(sourceClusterName);
|
|
115
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
116
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
117
|
+
// Cluster actions sit behind the "cluster operations" overflow menu next
|
|
118
|
+
// to the cluster name on the Hub cluster details page.
|
|
119
|
+
await clusterPage.openDuplicateClusterForm(sourceClusterName, async () => {
|
|
120
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
121
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
122
|
+
});
|
|
123
|
+
// The pre-fill itself is covered a layer down (DUP-03); here we only rename
|
|
124
|
+
// the duplicate so it is uniquely identifiable and deletable.
|
|
125
|
+
await clusterPage.clickClusterNameInput();
|
|
126
|
+
await clusterPage.fillClusterNameInput(duplicateClusterName);
|
|
127
|
+
createdClusterNames.push(duplicateClusterName);
|
|
128
|
+
// Duplicate opens a "Duplicate a cluster" page (not a dialog) that submits
|
|
129
|
+
// from its Summary panel with "Duplicate cluster", not "Create cluster".
|
|
130
|
+
const submitDuplicate = page.getByRole('button', {
|
|
131
|
+
name: 'Duplicate cluster',
|
|
132
|
+
exact: true,
|
|
133
|
+
});
|
|
134
|
+
await (0, test_1.expect)(submitDuplicate).toBeEnabled({ timeout: 30000 });
|
|
135
|
+
// Wait for the duplicate request to complete before navigating away:
|
|
136
|
+
// leaving the page right after the click aborted the in-flight
|
|
137
|
+
// POST .../clusters/<id>/duplicate, so the duplicate was never created.
|
|
138
|
+
const duplicateResponse = page.waitForResponse((response) => response.request().method() === 'POST' &&
|
|
139
|
+
/\/clusters\/[^/]+\/duplicate$/.test(new URL(response.url()).pathname), { timeout: 60000 });
|
|
140
|
+
await submitDuplicate.click();
|
|
141
|
+
const duplicate = await duplicateResponse;
|
|
142
|
+
(0, test_1.expect)(duplicate.ok()).toBe(true);
|
|
143
|
+
// On success Hub redirects to the new cluster's details page about a
|
|
144
|
+
// second after the response. Wait for that redirect, or it lands after
|
|
145
|
+
// the next step has opened the cluster list and pulls the page away.
|
|
146
|
+
const { clusterId } = await duplicate.json();
|
|
147
|
+
await page.waitForURL(new RegExp(`/cluster/${clusterId}`), {
|
|
148
|
+
timeout: 60000,
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
await _8_11_1.test.step('then the duplicate is created and reaches a healthy running state', async () => {
|
|
152
|
+
await homePage.clickClusters();
|
|
153
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
154
|
+
// ClusterPage.clusterLink scopes to the cluster's own row. A bare
|
|
155
|
+
// page.getByRole('link', {name}) also matches Hub's sidebar environment
|
|
156
|
+
// entry for the same cluster, which fails strict mode.
|
|
157
|
+
await (0, test_1.expect)(clusterPage.clusterLink(duplicateClusterName)).toBeVisible({
|
|
158
|
+
timeout: 60000,
|
|
159
|
+
});
|
|
160
|
+
await clusterPage.assertClusterHealthyStatusWithRetry(duplicateClusterName, undefined, undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
|
|
161
|
+
await clusterPage.clickClusterLink(duplicateClusterName);
|
|
162
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
163
|
+
await clusterDetailsPage.assertComponentsHealth(undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
// Scoped to name and region. The epic's case also lists plan type, channel
|
|
167
|
+
// and generation, but neither is overridable through today's page object:
|
|
168
|
+
// ClusterPage models exactly one cluster type (defaultClusterType =
|
|
169
|
+
// 'G3-Dev'), and createCluster() already drives the source through the same
|
|
170
|
+
// clickClusterOption() the duplicate would use, so both land on the same
|
|
171
|
+
// generation and an "override" assertion would pass without overriding
|
|
172
|
+
// anything. Asserting a value the test never set is what the first draft of
|
|
173
|
+
// this case did. Covering them needs page-object work first.
|
|
174
|
+
(0, _8_11_1.test)('DUP-02: a name and region overridden on the duplication form win over the carried-over ones', async ({ page, homePage, clusterPage, clusterDetailsPage, clusterSecretsPage, }) => {
|
|
175
|
+
// Two cluster creations plus health polling - this case is long by nature.
|
|
176
|
+
_8_11_1.test.setTimeout(60 * 60 * 1000);
|
|
177
|
+
const randomSuffix = await (0, _setup_1.generateRandomStringAsync)(6);
|
|
178
|
+
const sourceClusterName = `dup-src-ovr-${randomSuffix}`;
|
|
179
|
+
const duplicateClusterName = `dup-ovr-${randomSuffix}`;
|
|
180
|
+
await _8_11_1.test.step('given a healthy source cluster in a known region with its settings populated', async () => {
|
|
181
|
+
await clusterPage.clickClusterTab();
|
|
182
|
+
createdClusterNames.push(sourceClusterName);
|
|
183
|
+
// Pin the source region explicitly: the override below must differ from
|
|
184
|
+
// it, otherwise "the override won" is indistinguishable from "carried
|
|
185
|
+
// over". The second argument is the cloud provider, the fourth the
|
|
186
|
+
// sub-region -- passing a region label as the provider matches no tab.
|
|
187
|
+
await clusterPage.createCluster(sourceClusterName, 'GCP', undefined, SOURCE_SUB_REGION);
|
|
188
|
+
await clusterPage.assertClusterHealthyStatusWithRetry(sourceClusterName, undefined, undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
|
|
189
|
+
// A populated source - against an empty one this case would pass by
|
|
190
|
+
// copying nothing at all.
|
|
191
|
+
await clusterSecretsPage.createNewSecret(`DUP_SECRET_${randomSuffix}`, `dup-secret-value-${randomSuffix}`, sourceClusterName);
|
|
192
|
+
});
|
|
193
|
+
await _8_11_1.test.step('when I override the name and the region before submitting', async () => {
|
|
194
|
+
await homePage.clickClusters();
|
|
195
|
+
await clusterPage.clickClusterLink(sourceClusterName);
|
|
196
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
197
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
198
|
+
await clusterPage.openDuplicateClusterForm(sourceClusterName, async () => {
|
|
199
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
200
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
201
|
+
});
|
|
202
|
+
// Every editable field of the duplication form, changed away from the
|
|
203
|
+
// value the form carried over from the source cluster.
|
|
204
|
+
await clusterPage.clickClusterNameInput();
|
|
205
|
+
await clusterPage.fillClusterNameInput(duplicateClusterName);
|
|
206
|
+
// clickGCPRegion only acts when REGION_SELECTION is set, so the tile
|
|
207
|
+
// click below is what actually moves the region either way.
|
|
208
|
+
await clusterPage.clickGCPRegion();
|
|
209
|
+
await clusterPage.selectSubRegion('GCP', OVERRIDE_SUB_REGION);
|
|
210
|
+
createdClusterNames.push(duplicateClusterName);
|
|
211
|
+
const submitDuplicate = page.getByRole('button', {
|
|
212
|
+
name: 'Duplicate cluster',
|
|
213
|
+
exact: true,
|
|
214
|
+
});
|
|
215
|
+
await (0, test_1.expect)(submitDuplicate).toBeEnabled({ timeout: 30000 });
|
|
216
|
+
// Same as DUP-01: hold the page until the duplicate POST has answered,
|
|
217
|
+
// otherwise navigating away aborts the in-flight request.
|
|
218
|
+
const duplicateResponse = page.waitForResponse((response) => response.request().method() === 'POST' &&
|
|
219
|
+
/\/clusters\/[^/]+\/duplicate$/.test(new URL(response.url()).pathname), { timeout: 60000 });
|
|
220
|
+
await submitDuplicate.click();
|
|
221
|
+
const duplicate = await duplicateResponse;
|
|
222
|
+
(0, test_1.expect)(duplicate.ok()).toBe(true);
|
|
223
|
+
const { clusterId } = await duplicate.json();
|
|
224
|
+
await page.waitForURL(new RegExp(`/cluster/${clusterId}`), {
|
|
225
|
+
timeout: 60000,
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
await _8_11_1.test.step('then the created duplicate carries the overridden values, not the source ones, and is healthy', async () => {
|
|
229
|
+
await homePage.clickClusters();
|
|
230
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
231
|
+
// The overridden name is what the cluster was actually created with.
|
|
232
|
+
await (0, test_1.expect)(clusterPage.clusterLink(duplicateClusterName)).toBeVisible({
|
|
233
|
+
timeout: 60000,
|
|
234
|
+
});
|
|
235
|
+
await (0, test_1.expect)(clusterPage.clusterLink(sourceClusterName)).toBeVisible();
|
|
236
|
+
// The result, not the form state: the row of the cluster that was really
|
|
237
|
+
// created carries the overridden region. Scoped to that row rather than
|
|
238
|
+
// read off a page-wide getByText -- the source cluster is still listed
|
|
239
|
+
// on this same page and carries the region the override had to beat.
|
|
240
|
+
await (0, test_1.expect)(clusterPage.clusterRegion(duplicateClusterName, OVERRIDE_REGION_LABEL)).toBeVisible({ timeout: 60000 });
|
|
241
|
+
// ...and not the one it would have inherited from the source. Asserted
|
|
242
|
+
// after the positive check above, so an empty row cannot pass it.
|
|
243
|
+
await (0, test_1.expect)(clusterPage.clusterRegion(duplicateClusterName, SOURCE_REGION_LABEL)).toHaveCount(0);
|
|
244
|
+
// The source kept its own region, which is what makes the two labels
|
|
245
|
+
// above a real comparison rather than two reads of the same cluster.
|
|
246
|
+
await (0, test_1.expect)(clusterPage.clusterRegion(sourceClusterName, SOURCE_REGION_LABEL)).toBeVisible();
|
|
247
|
+
// Completion rule: a duplicate that is created but never healthy is the
|
|
248
|
+
// failure this epic exists to prevent.
|
|
249
|
+
await clusterPage.assertClusterHealthyStatusWithRetry(duplicateClusterName, undefined, undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
|
|
250
|
+
await clusterPage.clickClusterLink(duplicateClusterName);
|
|
251
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
252
|
+
await clusterDetailsPage.assertComponentsHealth(undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
|
|
253
|
+
});
|
|
254
|
+
});
|
|
255
|
+
// DUP-04 - the case the epic exists for: configuration drift. Everything is
|
|
256
|
+
// asserted on the cluster that was really created, never on the duplication
|
|
257
|
+
// form's pre-fill (DUP-03 owns that layer).
|
|
258
|
+
//
|
|
259
|
+
// Scope. The epic lists plan type, region, channel and generation, labels,
|
|
260
|
+
// IP allowlist rules, encryption settings, connector secrets, alert
|
|
261
|
+
// subscriptions, BYOM credentials, the BYOIDP secret and the backup
|
|
262
|
+
// schedule. This case asserts the two the suite's page objects can both
|
|
263
|
+
// populate on the source and read back off the duplicate: region and
|
|
264
|
+
// connector secrets. The rest have no page object that can set them on the
|
|
265
|
+
// source, and a source cluster where a setting was never populated makes
|
|
266
|
+
// the matching assertion on the duplicate pass by copying nothing - exactly
|
|
267
|
+
// the false green the preconditions warn about. Covering them needs
|
|
268
|
+
// page-object work first, not an invented selector here.
|
|
269
|
+
//
|
|
270
|
+
// Alert subscriptions belong to that second group despite createAlert()
|
|
271
|
+
// existing. It takes no recipient and no name: it selects the Email
|
|
272
|
+
// delivery method and submits. So an alert on the duplicate cannot be told
|
|
273
|
+
// apart from any other alert, and asserting one would pass whether or not
|
|
274
|
+
// duplication copied anything. assertAlertText() reads the detail row, not
|
|
275
|
+
// the recipient - every other caller in this suite passes an alert name
|
|
276
|
+
// such as 'Amount triggered1'. Asserting carry-over needs createAlert() to
|
|
277
|
+
// accept something that distinguishes the subscription.
|
|
278
|
+
(0, _8_11_1.test)('DUP-04: the carried-over settings are present on the created duplicate', async ({ page, homePage, clusterPage, clusterDetailsPage, clusterSecretsPage, }) => {
|
|
279
|
+
// Two cluster creations plus health polling - this case is long by nature.
|
|
280
|
+
_8_11_1.test.setTimeout(60 * 60 * 1000);
|
|
281
|
+
const randomSuffix = await (0, _setup_1.generateRandomStringAsync)(6);
|
|
282
|
+
const sourceClusterName = `dup-src-cfg-${randomSuffix}`;
|
|
283
|
+
const duplicateClusterName = `dup-cfg-${randomSuffix}`;
|
|
284
|
+
const secretKey = `DUP_SECRET_${randomSuffix}`;
|
|
285
|
+
const secretValue = `dup-secret-value-${randomSuffix}`;
|
|
286
|
+
await _8_11_1.test.step('given a healthy source cluster in a known region, with a connector secret', async () => {
|
|
287
|
+
await clusterPage.clickClusterTab();
|
|
288
|
+
createdClusterNames.push(sourceClusterName);
|
|
289
|
+
// The region is pinned rather than left to selectSubRegion()'s random
|
|
290
|
+
// pick: a known source region is the only way the duplicate's region can
|
|
291
|
+
// be asserted as "the source's one" instead of "some region".
|
|
292
|
+
await clusterPage.createCluster(sourceClusterName, 'GCP', undefined, SOURCE_SUB_REGION);
|
|
293
|
+
await clusterPage.assertClusterHealthyStatusWithRetry(sourceClusterName, undefined, undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
|
|
294
|
+
await clusterSecretsPage.createNewSecret(secretKey, secretValue, sourceClusterName);
|
|
295
|
+
// The source really holds each setting before anything is duplicated.
|
|
296
|
+
// Without this, a missing setting on the duplicate below would be
|
|
297
|
+
// indistinguishable from a setting that was never created at all.
|
|
298
|
+
await homePage.clickClusters();
|
|
299
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
300
|
+
await (0, test_1.expect)(clusterPage.clusterRegion(sourceClusterName, SOURCE_REGION_LABEL)).toBeVisible({ timeout: 60000 });
|
|
301
|
+
});
|
|
302
|
+
await _8_11_1.test.step('when I duplicate that cluster, changing only its name', async () => {
|
|
303
|
+
await homePage.clickClusters();
|
|
304
|
+
await clusterPage.clickClusterLink(sourceClusterName);
|
|
305
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
306
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
307
|
+
await clusterPage.openDuplicateClusterForm(sourceClusterName, async () => {
|
|
308
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
309
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
310
|
+
});
|
|
311
|
+
// Only the name changes: every other field keeps whatever the form
|
|
312
|
+
// carried over, which is what this case is here to verify landed.
|
|
313
|
+
await clusterPage.clickClusterNameInput();
|
|
314
|
+
await clusterPage.fillClusterNameInput(duplicateClusterName);
|
|
315
|
+
createdClusterNames.push(duplicateClusterName);
|
|
316
|
+
const submitDuplicate = page.getByRole('button', {
|
|
317
|
+
name: 'Duplicate cluster',
|
|
318
|
+
exact: true,
|
|
319
|
+
});
|
|
320
|
+
await (0, test_1.expect)(submitDuplicate).toBeEnabled({ timeout: 30000 });
|
|
321
|
+
// Same as DUP-01/DUP-02: hold the page until the duplicate POST has
|
|
322
|
+
// answered, otherwise navigating away aborts the in-flight request.
|
|
323
|
+
const duplicateResponse = page.waitForResponse((response) => response.request().method() === 'POST' &&
|
|
324
|
+
/\/clusters\/[^/]+\/duplicate$/.test(new URL(response.url()).pathname), { timeout: 60000 });
|
|
325
|
+
await submitDuplicate.click();
|
|
326
|
+
const duplicate = await duplicateResponse;
|
|
327
|
+
(0, test_1.expect)(duplicate.ok()).toBe(true);
|
|
328
|
+
const { clusterId } = await duplicate.json();
|
|
329
|
+
await page.waitForURL(new RegExp(`/cluster/${clusterId}`), {
|
|
330
|
+
timeout: 60000,
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
await _8_11_1.test.step('then the duplicate comes up healthy', async () => {
|
|
334
|
+
await homePage.clickClusters();
|
|
335
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
336
|
+
await (0, test_1.expect)(clusterPage.clusterLink(duplicateClusterName)).toBeVisible({
|
|
337
|
+
timeout: 60000,
|
|
338
|
+
});
|
|
339
|
+
// Completion rule: the settings below are only meaningful on a cluster
|
|
340
|
+
// that actually runs, so health is asserted before them.
|
|
341
|
+
await clusterPage.assertClusterHealthyStatusWithRetry(duplicateClusterName, undefined, undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
|
|
342
|
+
await clusterPage.clickClusterLink(duplicateClusterName);
|
|
343
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
344
|
+
await clusterDetailsPage.assertComponentsHealth(undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
|
|
345
|
+
});
|
|
346
|
+
await _8_11_1.test.step('and the duplicate carries the region of the source cluster', async () => {
|
|
347
|
+
await homePage.clickClusters();
|
|
348
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
349
|
+
// Scoped to the duplicate's own row: the source is still listed on this
|
|
350
|
+
// page with the same label, so a page-wide text read would pass on the
|
|
351
|
+
// source alone.
|
|
352
|
+
await (0, test_1.expect)(clusterPage.clusterRegion(duplicateClusterName, SOURCE_REGION_LABEL)).toBeVisible({ timeout: 60000 });
|
|
353
|
+
// And it did not silently land in the other region the org can create
|
|
354
|
+
// in - drift in either direction is the failure this case guards.
|
|
355
|
+
await (0, test_1.expect)(clusterPage.clusterRegion(duplicateClusterName, OVERRIDE_REGION_LABEL)).toHaveCount(0);
|
|
356
|
+
});
|
|
357
|
+
await _8_11_1.test.step('and the connector secret of the source is present on the duplicate', async () => {
|
|
358
|
+
await homePage.clickClusters();
|
|
359
|
+
await clusterPage.clickClusterLink(duplicateClusterName);
|
|
360
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
361
|
+
await clusterPage.clickConnectorSecretsTab(duplicateClusterName);
|
|
362
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
363
|
+
// Scoped to the duplicate's own secrets view. Only the key is asserted:
|
|
364
|
+
// Hub never renders a secret's value back, by design.
|
|
365
|
+
const duplicateSecrets = page.getByRole('main');
|
|
366
|
+
const carriedOverSecret = duplicateSecrets
|
|
367
|
+
.getByRole('cell', { name: secretKey, exact: true })
|
|
368
|
+
.or(duplicateSecrets.getByText(secretKey, { exact: true }));
|
|
369
|
+
await (0, test_1.expect)(carriedOverSecret.first()).toBeVisible({ timeout: 60000 });
|
|
370
|
+
});
|
|
371
|
+
});
|
|
372
|
+
// DUP-05. The epic's claim for this slice is a claim about the form: the
|
|
373
|
+
// admin learns *before submitting* that the process data of the source does
|
|
374
|
+
// not come across and the duplicate starts empty. So the assertion is the
|
|
375
|
+
// pre-submit disclosure on the duplication form, plus - per the suite's
|
|
376
|
+
// completion rule - that the duplicate this form really creates comes up
|
|
377
|
+
// healthy. Reading the duplicate's process data back out of Operate is not
|
|
378
|
+
// asserted here: it would need a seeded deployment on the source, and the
|
|
379
|
+
// only resource for that (a Modeler project) has no teardown in this suite,
|
|
380
|
+
// which the isolation rules forbid leaking.
|
|
381
|
+
(0, _8_11_1.test)('DUP-05: the duplication form states the cluster data does not carry over, and the duplicate it creates is healthy', async ({ page, homePage, clusterPage, clusterDetailsPage, clusterSecretsPage, }) => {
|
|
382
|
+
// Two cluster creations plus health polling - this case is long by nature.
|
|
383
|
+
_8_11_1.test.setTimeout(60 * 60 * 1000);
|
|
384
|
+
const randomSuffix = await (0, _setup_1.generateRandomStringAsync)(6);
|
|
385
|
+
const sourceClusterName = `dup-src-data-${randomSuffix}`;
|
|
386
|
+
const duplicateClusterName = `dup-data-${randomSuffix}`;
|
|
387
|
+
await _8_11_1.test.step('given a healthy source cluster with settings populated', async () => {
|
|
388
|
+
await clusterPage.clickClusterTab();
|
|
389
|
+
createdClusterNames.push(sourceClusterName);
|
|
390
|
+
await clusterPage.createCluster(sourceClusterName);
|
|
391
|
+
await clusterPage.assertClusterHealthyStatusWithRetry(sourceClusterName, undefined, undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
|
|
392
|
+
// A populated source: against an empty one the duplication form has
|
|
393
|
+
// nothing to say anything about, and the case would pass vacuously.
|
|
394
|
+
await clusterSecretsPage.createNewSecret(`DUP_SECRET_${randomSuffix}`, `dup-secret-value-${randomSuffix}`, sourceClusterName);
|
|
395
|
+
});
|
|
396
|
+
await _8_11_1.test.step('when I select Duplicate on that cluster', async () => {
|
|
397
|
+
await homePage.clickClusters();
|
|
398
|
+
await clusterPage.clickClusterLink(sourceClusterName);
|
|
399
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
400
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
401
|
+
await clusterPage.openDuplicateClusterForm(sourceClusterName, async () => {
|
|
402
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
403
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
404
|
+
});
|
|
405
|
+
});
|
|
406
|
+
await _8_11_1.test.step('then the form tells me, before I submit, that the data of the cluster does not carry over', async () => {
|
|
407
|
+
// Scoped to the duplication form itself rather than the whole document,
|
|
408
|
+
// so an unrelated banner elsewhere on the Hub page cannot satisfy this.
|
|
409
|
+
const duplicationForm = page.getByRole('main');
|
|
410
|
+
// The wording is product copy and has already been reworded once, so the
|
|
411
|
+
// locator matches the claim ("data ... is not copied / does not carry
|
|
412
|
+
// over" / "starts empty") rather than one exact sentence.
|
|
413
|
+
const dataNotCarriedOverNotice = duplicationForm
|
|
414
|
+
.getByText(/data[^.]*(is not|are not|will not be|does not|won't be)[^.]*(copied|carried over|transferred|duplicated)/i)
|
|
415
|
+
.or(duplicationForm.getByText(/(duplicate|new cluster)[^.]*(starts|will start|will be)[^.]*empty/i));
|
|
416
|
+
await (0, test_1.expect)(dataNotCarriedOverNotice.first()).toBeVisible({
|
|
417
|
+
timeout: 30000,
|
|
418
|
+
});
|
|
419
|
+
// "Before I submit": the form is still unsubmitted at this point, which
|
|
420
|
+
// is what the submit button still being on the page shows.
|
|
421
|
+
const submitDuplicate = page.getByRole('button', {
|
|
422
|
+
name: 'Duplicate cluster',
|
|
423
|
+
exact: true,
|
|
424
|
+
});
|
|
425
|
+
await (0, test_1.expect)(submitDuplicate).toBeVisible({ timeout: 30000 });
|
|
426
|
+
});
|
|
427
|
+
await _8_11_1.test.step('and submitting that form creates a duplicate that reaches a healthy running state', async () => {
|
|
428
|
+
await clusterPage.clickClusterNameInput();
|
|
429
|
+
await clusterPage.fillClusterNameInput(duplicateClusterName);
|
|
430
|
+
createdClusterNames.push(duplicateClusterName);
|
|
431
|
+
const submitDuplicate = page.getByRole('button', {
|
|
432
|
+
name: 'Duplicate cluster',
|
|
433
|
+
exact: true,
|
|
434
|
+
});
|
|
435
|
+
await (0, test_1.expect)(submitDuplicate).toBeEnabled({ timeout: 30000 });
|
|
436
|
+
// Same as DUP-01/DUP-02: hold the page until the duplicate POST has
|
|
437
|
+
// answered, otherwise navigating away aborts the in-flight request.
|
|
438
|
+
const duplicateResponse = page.waitForResponse((response) => response.request().method() === 'POST' &&
|
|
439
|
+
/\/clusters\/[^/]+\/duplicate$/.test(new URL(response.url()).pathname), { timeout: 60000 });
|
|
440
|
+
await submitDuplicate.click();
|
|
441
|
+
const duplicate = await duplicateResponse;
|
|
442
|
+
(0, test_1.expect)(duplicate.ok()).toBe(true);
|
|
443
|
+
const { clusterId } = await duplicate.json();
|
|
444
|
+
await page.waitForURL(new RegExp(`/cluster/${clusterId}`), {
|
|
445
|
+
timeout: 60000,
|
|
446
|
+
});
|
|
447
|
+
await homePage.clickClusters();
|
|
448
|
+
await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
|
|
449
|
+
await (0, test_1.expect)(clusterPage.clusterLink(duplicateClusterName)).toBeVisible({
|
|
450
|
+
timeout: 60000,
|
|
451
|
+
});
|
|
452
|
+
// Completion rule: a duplicate created but never healthy is the failure
|
|
453
|
+
// this epic exists to prevent, so the case does not stop at submit.
|
|
454
|
+
await clusterPage.assertClusterHealthyStatusWithRetry(duplicateClusterName, undefined, undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
|
|
455
|
+
await clusterPage.clickClusterLink(duplicateClusterName);
|
|
456
|
+
await clusterDetailsPage.dismissOopsIfPresent();
|
|
457
|
+
await clusterDetailsPage.assertComponentsHealth(undefined, (0, UtilitiesPage_1.consoleSessionRecovery)(page, page.url()));
|
|
458
|
+
});
|
|
459
|
+
});
|
|
460
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|