@camunda/e2e-test-suite 0.0.1695 → 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.
Files changed (32) hide show
  1. package/dist/pages/8.11/ClusterDetailsPage.d.ts +8 -1
  2. package/dist/pages/8.11/ClusterDetailsPage.js +32 -5
  3. package/dist/pages/8.11/ClusterPage.d.ts +42 -2
  4. package/dist/pages/8.11/ClusterPage.js +228 -31
  5. package/dist/pages/SM-8.10/OCIdentityClusterVariablesPage.d.ts +5 -5
  6. package/dist/pages/SM-8.10/OCIdentityClusterVariablesPage.js +19 -11
  7. package/dist/pages/SM-8.10/TaskPanelPage.d.ts +1 -1
  8. package/dist/pages/SM-8.10/TaskPanelPage.js +6 -5
  9. package/dist/pages/SM-8.11/OCIdentityClusterVariablesPage.d.ts +5 -5
  10. package/dist/pages/SM-8.11/OCIdentityClusterVariablesPage.js +19 -11
  11. package/dist/pages/SM-8.11/TaskPanelPage.d.ts +1 -1
  12. package/dist/pages/SM-8.11/TaskPanelPage.js +6 -5
  13. package/dist/resources/cluster_variables/cluster_variable_tenant_json_readonly.bpmn +4 -4
  14. package/dist/resources/cluster_variables/cluster_variable_tenant_string_readonly.bpmn +4 -4
  15. package/dist/tests/8.11/console-cluster-duplication-api-clients.spec.d.ts +1 -0
  16. package/dist/tests/8.11/console-cluster-duplication-api-clients.spec.js +154 -0
  17. package/dist/tests/8.11/console-cluster-duplication.spec.d.ts +1 -0
  18. package/dist/tests/8.11/console-cluster-duplication.spec.js +460 -0
  19. package/dist/tests/SM-8.10/cluster-variables-tenant.spec.d.ts +1 -0
  20. package/dist/tests/SM-8.10/cluster-variables-tenant.spec.js +198 -0
  21. package/dist/tests/SM-8.10/optimize-api-tests.spec.d.ts +1 -0
  22. package/dist/tests/SM-8.10/optimize-api-tests.spec.js +468 -0
  23. package/dist/tests/SM-8.11/cluster-variables-tenant.spec.d.ts +1 -0
  24. package/dist/tests/SM-8.11/cluster-variables-tenant.spec.js +198 -0
  25. package/dist/tests/SM-8.11/optimize-api-tests.spec.d.ts +1 -0
  26. package/dist/tests/SM-8.11/optimize-api-tests.spec.js +468 -0
  27. package/dist/tests/SM-8.9/cluster-variables-tenant.spec.js +2 -2
  28. package/dist/utils/apiHelpers.d.ts +4 -0
  29. package/dist/utils/apiHelpers.js +29 -4
  30. package/package.json +1 -1
  31. package/resources/cluster_variables/cluster_variable_tenant_json_readonly.bpmn +4 -4
  32. package/resources/cluster_variables/cluster_variable_tenant_string_readonly.bpmn +4 -4
@@ -29,13 +29,21 @@ class OCIdentityClusterVariablesPage {
29
29
  // ListV2 and still render Carbon, so the locators that differ between the
30
30
  // two DOMs accept either.
31
31
  this.variablesList = page.locator('table.cds--data-table, table[data-slot="table"]');
32
- this.variableRow = (variableName) => this.variablesList
33
- .locator('tbody')
34
- .getByRole('row')
35
- .filter({ hasText: variableName });
32
+ this.variableRow = (variableName, scope) => {
33
+ const rows = this.variablesList
34
+ .locator('tbody')
35
+ .getByRole('row')
36
+ .filter({ hasText: variableName });
37
+ if (!scope) {
38
+ return rows;
39
+ }
40
+ return rows.filter({
41
+ has: page.getByRole('cell', { name: `Tenant: ${scope}`, exact: true }),
42
+ });
43
+ };
36
44
  // Carbon's OverflowMenu labels its trigger "Options"; the design-system
37
45
  // DataTable labels it "Row actions".
38
- this.editVariableButton = (variableName) => this.variableRow(variableName).getByRole('button', {
46
+ this.editVariableButton = (variableName, scope) => this.variableRow(variableName, scope).getByRole('button', {
39
47
  name: /^(Options|Row actions)$/,
40
48
  });
41
49
  this.editVariableModal = page.getByRole('dialog', {
@@ -69,8 +77,8 @@ class OCIdentityClusterVariablesPage {
69
77
  exact: true,
70
78
  });
71
79
  }
72
- async editVariable(variableName, newValue) {
73
- await this.editVariableButton(variableName).click();
80
+ async editVariable(variableName, newValue, scope) {
81
+ await this.editVariableButton(variableName, scope).click();
74
82
  await (0, test_1.expect)(this.editMenuItem).toBeVisible();
75
83
  await this.editMenuItem.click();
76
84
  // Firefox renders Monaco's input as a zero-height textarea, which
@@ -111,11 +119,11 @@ class OCIdentityClusterVariablesPage {
111
119
  await (0, test_1.expect)(this.successMessage).toBeVisible();
112
120
  await (0, test_1.expect)(this.editVariableModal).toBeHidden();
113
121
  }
114
- async assertVariableExists(variableName) {
115
- await (0, test_1.expect)(this.variableRow(variableName)).toBeVisible();
122
+ async assertVariableExists(variableName, scope) {
123
+ await (0, test_1.expect)(this.variableRow(variableName, scope)).toBeVisible();
116
124
  }
117
- async assertVariableValue(variableName, expectedValue) {
118
- const row = this.variableRow(variableName);
125
+ async assertVariableValue(variableName, expectedValue, scope) {
126
+ const row = this.variableRow(variableName, scope);
119
127
  await (0, test_1.expect)(row).toContainText(expectedValue);
120
128
  }
121
129
  }
@@ -15,7 +15,7 @@ declare class TaskPanelPage {
15
15
  readonly licenseKeyTagProduction: Locator;
16
16
  constructor(page: Page);
17
17
  taskLink(processName: string): Locator;
18
- openTask(name: string, assignButton?: boolean): Promise<void>;
18
+ openTask(name: string, assignButton?: boolean, fallbackName?: string): Promise<void>;
19
19
  filterBy(option: 'All open' | 'Unassigned' | 'Assigned to me' | 'Completed'): Promise<void>;
20
20
  private openFilterControls;
21
21
  private static appliedFilterUrl;
@@ -89,17 +89,18 @@ class TaskPanelPage {
89
89
  .first()
90
90
  .getByRole('link');
91
91
  }
92
- async openTask(name, assignButton = true) {
92
+ async openTask(name, assignButton = true, fallbackName) {
93
93
  const maxAttempts = 10;
94
+ const taskByName = this.availableTasks.getByText(name, { exact: true });
95
+ const taskLocator = fallbackName
96
+ ? taskByName.or(this.availableTasks.getByText(fallbackName, { exact: true }))
97
+ : taskByName;
94
98
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
95
99
  try {
96
100
  // Removed waitForLoadState('networkidle') — Tasklist polls
97
101
  // continuously, so networkidle never fires; the click below
98
102
  // already has a 4s timeout that auto-waits for the locator.
99
- await this.availableTasks
100
- .getByText(name, { exact: true })
101
- .nth(0)
102
- .click({ timeout: constants_1._1_SECOND_IN_MS * 4 });
103
+ await taskLocator.nth(0).click({ timeout: constants_1._1_SECOND_IN_MS * 4 });
103
104
  if (assignButton) {
104
105
  await (0, test_1.expect)(this.assignToMeButton).toBeVisible({
105
106
  timeout: constants_1._1_SECOND_IN_MS * 10,
@@ -20,12 +20,12 @@
20
20
  </bpmn:extensionElements>
21
21
  <bpmn:outgoing>Flow_1k9dndp</bpmn:outgoing>
22
22
  </bpmn:startEvent>
23
- <bpmn:sequenceFlow id="Flow_1k9dndp" sourceRef="StartEvent_1" targetRef="Activity_1whhatc" />
23
+ <bpmn:sequenceFlow id="Flow_1k9dndp" sourceRef="StartEvent_1" targetRef="Activity_TenantJsonPreview" />
24
24
  <bpmn:endEvent id="Event_1mc2ikr">
25
25
  <bpmn:incoming>Flow_0wixfng</bpmn:incoming>
26
26
  </bpmn:endEvent>
27
- <bpmn:sequenceFlow id="Flow_0wixfng" sourceRef="Activity_1whhatc" targetRef="Event_1mc2ikr" />
28
- <bpmn:userTask id="Activity_1whhatc" name="Preview JSON tenant cluster variables">
27
+ <bpmn:sequenceFlow id="Flow_0wixfng" sourceRef="Activity_TenantJsonPreview" targetRef="Event_1mc2ikr" />
28
+ <bpmn:userTask id="Activity_TenantJsonPreview" name="Preview JSON tenant cluster variables">
29
29
  <bpmn:extensionElements>
30
30
  <zeebe:userTask />
31
31
  <zeebe:formDefinition formId="Form_ClusterVarJSON" />
@@ -42,7 +42,7 @@
42
42
  <bpmndi:BPMNShape id="Event_1mc2ikr_di" bpmnElement="Event_1mc2ikr">
43
43
  <dc:Bounds x="582" y="272" width="36" height="36" />
44
44
  </bpmndi:BPMNShape>
45
- <bpmndi:BPMNShape id="Activity_0lwojkk_di" bpmnElement="Activity_1whhatc">
45
+ <bpmndi:BPMNShape id="Activity_0lwojkk_di" bpmnElement="Activity_TenantJsonPreview">
46
46
  <dc:Bounds x="430" y="250" width="100" height="80" />
47
47
  <bpmndi:BPMNLabel />
48
48
  </bpmndi:BPMNShape>
@@ -18,12 +18,12 @@
18
18
  </bpmn:extensionElements>
19
19
  <bpmn:outgoing>Flow_1k9dndp</bpmn:outgoing>
20
20
  </bpmn:startEvent>
21
- <bpmn:sequenceFlow id="Flow_1k9dndp" sourceRef="StartEvent_1" targetRef="Activity_1whhatc" />
21
+ <bpmn:sequenceFlow id="Flow_1k9dndp" sourceRef="StartEvent_1" targetRef="Activity_TenantStringPreview" />
22
22
  <bpmn:endEvent id="Event_1mc2ikr">
23
23
  <bpmn:incoming>Flow_0wixfng</bpmn:incoming>
24
24
  </bpmn:endEvent>
25
- <bpmn:sequenceFlow id="Flow_0wixfng" sourceRef="Activity_1whhatc" targetRef="Event_1mc2ikr" />
26
- <bpmn:userTask id="Activity_1whhatc" name="Preview String tenant cluster variable">
25
+ <bpmn:sequenceFlow id="Flow_0wixfng" sourceRef="Activity_TenantStringPreview" targetRef="Event_1mc2ikr" />
26
+ <bpmn:userTask id="Activity_TenantStringPreview" name="Preview String tenant cluster variable">
27
27
  <bpmn:extensionElements>
28
28
  <zeebe:userTask />
29
29
  <zeebe:formDefinition formId="Form_ClusterVarString" />
@@ -40,7 +40,7 @@
40
40
  <bpmndi:BPMNShape id="Event_1mc2ikr_di" bpmnElement="Event_1mc2ikr">
41
41
  <dc:Bounds x="582" y="272" width="36" height="36" />
42
42
  </bpmndi:BPMNShape>
43
- <bpmndi:BPMNShape id="Activity_0lwojkk_di" bpmnElement="Activity_1whhatc">
43
+ <bpmndi:BPMNShape id="Activity_0lwojkk_di" bpmnElement="Activity_TenantStringPreview">
44
44
  <dc:Bounds x="430" y="250" width="100" height="80" />
45
45
  <bpmndi:BPMNLabel />
46
46
  </bpmndi:BPMNShape>
@@ -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
+ });