@camunda/e2e-test-suite 0.0.1357 → 0.0.1358

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.
@@ -323,9 +323,9 @@ class ClusterPage {
323
323
  // (the whole app shell does, once a second row carries the same name),
324
324
  // which turns this wait into a strict-mode violation.
325
325
  const clusterRow = this.clusterRow(clusterName);
326
- // Hub's clusters table renders the status as "Creating…" (U+2026) in a
327
- // single span, so an exact 'Creating' never matches there; accept the
328
- // bare label and both ellipsis forms.
326
+ // Hub renders the in-progress status as "Creating…" (with an ellipsis), so
327
+ // an exact 'Creating' match never finds it; anchor the regex instead so it
328
+ // still cannot match unrelated text in the row.
329
329
  const creatingRow = clusterRow.getByText(/^Creating(…|\.\.\.)?$/);
330
330
  const clusterRowVisible = creatingRow.or(clusterRow.getByText('Healthy', { exact: true }));
331
331
  try {
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const test_1 = require("@playwright/test");
4
+ const _8_10_1 = require("../../fixtures/8.10");
5
+ const _setup_1 = require("../../test-setup.js");
6
+ const UtilitiesPage_1 = require("../../pages/8.10/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
+ /**
14
+ * Epic: camunda/product-hub#3824 - Console cluster duplication.
15
+ *
16
+ * Preconditions:
17
+ * - feature flag `console.clusterDuplication` is enabled for the organization
18
+ * - environment: saas-preprod
19
+ * - the test user is an organization admin
20
+ *
21
+ * Isolation: every case creates its own source cluster with a randomised name and
22
+ * deletes every cluster it created in teardown - a leaked cluster consumes a
23
+ * reservation and would make the reservation case pass for the wrong reason.
24
+ */
25
+ _8_10_1.test.describe.configure({ mode: 'serial' });
26
+ _8_10_1.test.describe('Console cluster duplication', () => {
27
+ // Everything this spec creates is tracked here so teardown runs even on failure.
28
+ const createdClusterNames = [];
29
+ _8_10_1.test.beforeEach(async ({ page, loginPage, homePage }, testInfo) => {
30
+ await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, testUser, (testInfo.workerIndex + 1) * 1000);
31
+ await homePage.clickClusters();
32
+ });
33
+ _8_10_1.test.afterEach(async ({ page, homePage, clusterPage }, testInfo) => {
34
+ await (0, _setup_1.captureScreenshot)(page, testInfo);
35
+ // Postcondition: no cluster left behind, source or duplicate.
36
+ const namesToDelete = [...createdClusterNames].reverse();
37
+ createdClusterNames.length = 0;
38
+ const undeleted = [];
39
+ for (const clusterName of namesToDelete) {
40
+ try {
41
+ await homePage.clickClusters();
42
+ await clusterPage.deleteCluster(clusterName);
43
+ }
44
+ catch (error) {
45
+ // Collect rather than throw: one cluster that will not delete must
46
+ // not strand the ones after it.
47
+ undeleted.push(`${clusterName} (${String(error)})`);
48
+ }
49
+ }
50
+ // Soft, so the video capture below still runs, but still a failure: a
51
+ // silent leak accumulates across nightly runs and breaks a later run
52
+ // instead of this one.
53
+ test_1.expect.soft(undeleted, 'Teardown left clusters behind').toEqual([]);
54
+ // Last: captureFailureVideo closes the page to flush the video, so running
55
+ // it before the deletions above left every cluster behind on a failure.
56
+ await (0, _setup_1.captureFailureVideo)(page, testInfo);
57
+ });
58
+ (0, _8_10_1.test)('DUP-01: duplicating a cluster yields a healthy running duplicate', async ({ page, homePage, clusterPage, clusterDetailsPage, clusterSecretsPage, }) => {
59
+ // Two cluster creations plus health polling - this case is long by nature.
60
+ _8_10_1.test.setTimeout(60 * 60 * 1000);
61
+ const randomSuffix = await (0, _setup_1.generateRandomStringAsync)(6);
62
+ const sourceClusterName = `dup-source-${randomSuffix}`;
63
+ const duplicateClusterName = `dup-copy-${randomSuffix}`;
64
+ await _8_10_1.test.step('given a healthy source cluster with its carried-over settings populated', async () => {
65
+ await clusterPage.clickClusterTab();
66
+ createdClusterNames.push(sourceClusterName);
67
+ await clusterPage.createCluster(sourceClusterName);
68
+ await clusterPage.assertClusterHealthyStatusWithRetry(sourceClusterName);
69
+ // A connector secret, an API client and an alert, so the duplication has
70
+ // real settings to carry over instead of copying nothing.
71
+ await clusterSecretsPage.createNewSecret(`DUP_SECRET_${randomSuffix}`, `dup-secret-value-${randomSuffix}`, sourceClusterName);
72
+ await homePage.clickClusters();
73
+ await clusterPage.clickClusterLink(sourceClusterName);
74
+ await clusterDetailsPage.dismissOopsIfPresent();
75
+ await clusterDetailsPage.clickAPITab();
76
+ await clusterDetailsPage.createAPIClient(`dup-client-${randomSuffix}`);
77
+ // createAPIClient leaves the "Client credentials" modal open; it hides
78
+ // the cluster tabs until closed (same as console-user-flows).
79
+ await clusterDetailsPage.clickCloseModalButton();
80
+ await clusterDetailsPage.clickAlertsTab();
81
+ await clusterDetailsPage.createAlert(true);
82
+ });
83
+ await _8_10_1.test.step('when I select Duplicate on that cluster and submit the duplication form', async () => {
84
+ await homePage.clickClusters();
85
+ await clusterPage.clickClusterLink(sourceClusterName);
86
+ await clusterDetailsPage.dismissOopsIfPresent();
87
+ await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
88
+ // Cluster actions sit behind the "cluster operations" overflow menu next
89
+ // to the cluster name on the Hub cluster details page.
90
+ await page.getByRole('button', { name: 'cluster operations' }).click();
91
+ const duplicateAction = page
92
+ .getByRole('menuitem', { name: /duplicate/i })
93
+ .or(page.getByRole('button', { name: /duplicate/i }));
94
+ await (0, test_1.expect)(duplicateAction).toBeVisible({ timeout: 30000 });
95
+ await duplicateAction.click();
96
+ // The pre-fill itself is covered a layer down (DUP-03); here we only rename
97
+ // the duplicate so it is uniquely identifiable and deletable.
98
+ await clusterPage.clickClusterNameInput();
99
+ await clusterPage.fillClusterNameInput(duplicateClusterName);
100
+ createdClusterNames.push(duplicateClusterName);
101
+ // Duplicate opens a "Duplicate a cluster" page (not a dialog) that submits
102
+ // from its Summary panel with "Duplicate cluster", not "Create cluster".
103
+ const submitDuplicate = page.getByRole('button', {
104
+ name: 'Duplicate cluster',
105
+ exact: true,
106
+ });
107
+ await (0, test_1.expect)(submitDuplicate).toBeEnabled({ timeout: 30000 });
108
+ // Wait for the duplicate request to complete before navigating away:
109
+ // leaving the page right after the click aborted the in-flight
110
+ // POST .../clusters/<id>/duplicate, so the duplicate was never created.
111
+ const duplicateResponse = page.waitForResponse((response) => response.request().method() === 'POST' &&
112
+ /\/clusters\/[^/]+\/duplicate$/.test(new URL(response.url()).pathname), { timeout: 60000 });
113
+ await submitDuplicate.click();
114
+ const duplicate = await duplicateResponse;
115
+ (0, test_1.expect)(duplicate.ok()).toBe(true);
116
+ // On success Hub redirects to the new cluster's details page about a
117
+ // second after the response. Wait for that redirect, or it lands after
118
+ // the next step has opened the cluster list and pulls the page away.
119
+ const { clusterId } = await duplicate.json();
120
+ await page.waitForURL(new RegExp(`/cluster/${clusterId}`), {
121
+ timeout: 60000,
122
+ });
123
+ });
124
+ await _8_10_1.test.step('then the duplicate is created and reaches a healthy running state', async () => {
125
+ await homePage.clickClusters();
126
+ await (0, UtilitiesPage_1.waitForLoadingToFinish)(page);
127
+ // ClusterPage.clusterLink scopes to the cluster's own row. A bare
128
+ // page.getByRole('link', {name}) also matches Hub's sidebar environment
129
+ // entry for the same cluster, which fails strict mode.
130
+ await (0, test_1.expect)(clusterPage.clusterLink(duplicateClusterName)).toBeVisible({
131
+ timeout: 60000,
132
+ });
133
+ await clusterPage.assertClusterHealthyStatusWithRetry(duplicateClusterName);
134
+ await clusterPage.clickClusterLink(duplicateClusterName);
135
+ await clusterDetailsPage.dismissOopsIfPresent();
136
+ await clusterDetailsPage.assertComponentsHealth();
137
+ });
138
+ });
139
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1357",
3
+ "version": "0.0.1358",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",