@camunda/e2e-test-suite 0.0.1354 → 0.0.1356

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.
@@ -151,52 +151,90 @@ class ClusterPage {
151
151
  timeout: 120000,
152
152
  });
153
153
  await (0, test_1.expect)(this.createNewClusterButton).toBeVisible({ timeout: 60000 });
154
- const clusterInstance = this.cluster(name).first();
155
- if ((await clusterInstance.count()) <= 0) {
154
+ // Hub's clusters data table renders skeleton rows (no links) while it
155
+ // fetches, and the "Create new cluster" button is visible before the data
156
+ // arrives. Counting matching rows at that point always returned 0, so the
157
+ // pre-clean was skipped and every run left one more same-named cluster
158
+ // behind until the org ran out of G3-Dev reservations (the type tile then
159
+ // renders disabled). Wait for the first loaded row before counting.
160
+ await this.clustersList
161
+ .getByRole('link')
162
+ .first()
163
+ .waitFor({ timeout: 30000 })
164
+ .catch(() => false);
165
+ // Rows whose deletion is already in progress keep the name until the
166
+ // backend removes them; exclude them so the loop does not revisit them.
167
+ const deletableRows = () => this.clustersList
168
+ .filter({
169
+ has: this.page.getByRole('link', { name, exact: true }),
170
+ })
171
+ .filter({ hasNotText: /Deleting/ });
172
+ if ((await deletableRows().count()) <= 0) {
156
173
  console.log(`No clusters found with name ${name}, skipping deletion.`);
157
174
  return;
158
175
  }
159
- await clusterInstance.waitFor({ timeout: 10000 });
160
- let deleteButtons = this.cluster(name).getByRole('button', {
161
- name: 'Delete',
162
- });
163
- while ((await deleteButtons.count()) > 0) {
164
- const deleteButton = deleteButtons.nth(0);
165
- // Wait for the Delete button to become visible — a cluster in a transient
166
- // state (e.g. just created by a concurrent setup worker) may have the row
167
- // present in the DOM but the button not yet rendered. Without this wait
168
- // the while-loop would spin forever since count() stays > 0.
176
+ // Legacy Console rendered a per-row "Delete" button; Hub's design-system
177
+ // data table instead puts it in the row's "Row actions" kebab menu.
178
+ const deleteMenuItem = this.page.getByRole('menuitem', { name: /^Delete/ });
179
+ const confirmInput = this.confirmDeleteInput.or(this.dialog.getByRole('textbox'));
180
+ const maxDeletions = 50;
181
+ for (let i = 0; i < maxDeletions; i++) {
182
+ if ((await deletableRows().count()) <= 0)
183
+ break;
184
+ const row = deletableRows().first();
185
+ const rowAction = row
186
+ .getByRole('button', { name: 'Delete' })
187
+ .or(row.getByRole('button', { name: 'Row actions', exact: true }));
169
188
  try {
170
- await (0, test_1.expect)(deleteButton).toBeVisible({ timeout: 10000 });
189
+ await (0, test_1.expect)(rowAction).toBeVisible({ timeout: 10000 });
171
190
  }
172
191
  catch {
173
- await this.page.reload({ waitUntil: 'domcontentloaded' }).catch(() => { });
174
- deleteButtons = this.cluster(name).getByRole('button', {
175
- name: 'Delete',
192
+ // A cluster in a transient state (e.g. just created by a concurrent
193
+ // setup worker) may have its row present before the action renders.
194
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
195
+ await this.clustersList.getByRole('link').first().waitFor({
196
+ timeout: 30000,
176
197
  });
177
198
  continue;
178
199
  }
179
- try {
180
- await deleteButton.click({ force: true, timeout: 60000 });
181
- }
182
- catch (error) {
183
- await this.clickClusterBanner();
184
- await (0, test_1.expect)(deleteButton).toBeVisible({ timeout: 60000 });
185
- await deleteButton.click({ force: true, timeout: 60000 });
200
+ // Rows share the cluster name, so remember this row's unique link (it
201
+ // carries the cluster id) to recognise when this cluster is gone.
202
+ const clusterHref = await row
203
+ .getByRole('link', { name, exact: true })
204
+ .getAttribute('href');
205
+ await rowAction.click({ timeout: 60000 });
206
+ if (await deleteMenuItem.isVisible({ timeout: 5000 }).catch(() => false)) {
207
+ await deleteMenuItem.click({ timeout: 30000 });
186
208
  }
187
209
  await (0, test_1.expect)(this.dialog).toBeVisible({ timeout: 60000 });
188
- await (0, test_1.expect)(this.confirmDeleteInput).toBeVisible({ timeout: 60000 });
189
- await this.confirmDeleteInput.click({ force: true, timeout: 60000 });
190
- await this.confirmDeleteInput.fill('DELETE', { timeout: 60000 });
191
- const dangerDeleteButtons = await this.dangerDeleteButton.all();
192
- const lastDangerDeleteButton = dangerDeleteButtons[dangerDeleteButtons.length - 1];
193
- await lastDangerDeleteButton.click();
194
- await (0, test_1.expect)(this.cluster(name).getByText('Deleting...', { exact: true })).not.toBeVisible({ timeout: 60000 });
210
+ await (0, test_1.expect)(confirmInput.first()).toBeVisible({ timeout: 60000 });
211
+ await confirmInput.first().fill('DELETE', { timeout: 60000 });
212
+ await this.dangerDeleteButton.last().click({ timeout: 60000 });
213
+ // When a concurrent worker already deleted this same cluster, the modal
214
+ // stays open with "We're having trouble deleting the cluster". Close it;
215
+ // the row check below still fails if the cluster was not removed.
216
+ const deleteError = this.dialog.getByText("We're having trouble deleting the cluster");
217
+ // The alert only renders once the delete request fails, so wait for the
218
+ // modal to either close or show it rather than probing once.
219
+ await (0, test_1.expect)(async () => {
220
+ const closed = !(await this.dialog.isVisible());
221
+ (0, test_1.expect)(closed || (await deleteError.isVisible())).toBe(true);
222
+ }).toPass({ timeout: 60000 });
223
+ if (await deleteError.isVisible()) {
224
+ await this.dialog.getByRole('button', { name: 'Cancel' }).click();
225
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
226
+ await this.clustersList.getByRole('link').first().waitFor({
227
+ timeout: 120000,
228
+ });
229
+ }
195
230
  await (0, test_1.expect)(this.dialog).not.toBeVisible({ timeout: 60000 });
196
- // Refresh the list of delete buttons
197
- deleteButtons = this.cluster(name).getByRole('button', { name: 'Delete' });
231
+ // Wait until the deleted row is gone or flagged as deleting. The table
232
+ // is paginated, so the row count alone does not drop: the next page's
233
+ // rows slide in to fill the gap.
234
+ await (0, test_1.expect)(this.clustersList
235
+ .filter({ has: this.page.locator(`a[href="${clusterHref}"]`) })
236
+ .filter({ hasNotText: /Deleting/ })).toHaveCount(0, { timeout: 60000 });
198
237
  }
199
- await this.page.waitForTimeout(500);
200
238
  }
201
239
  async clickClusterTab() {
202
240
  await Promise.race([
@@ -290,6 +328,8 @@ class ClusterPage {
290
328
  async clickClusterType() {
291
329
  if (process.env.IS_PROD !== 'true') {
292
330
  await (0, test_1.expect)(this.g3DevClusterType).toBeVisible({ timeout: 60000 });
331
+ // The tile is disabled while the org has no free reservation for it.
332
+ await (0, test_1.expect)(this.g3DevClusterType).toBeEnabled({ timeout: 60000 });
293
333
  await this.g3DevClusterType.click();
294
334
  }
295
335
  }
@@ -4,7 +4,6 @@ const _setup_1 = require("../../test-setup.js");
4
4
  const SM_8_10_1 = require("../../fixtures/SM-8.10");
5
5
  const test_1 = require("@playwright/test");
6
6
  const sleep_1 = require("../../utils/sleep");
7
- const env_1 = require("../../utils/env");
8
7
  const UtilitiesPage_1 = require("../../pages/SM-8.10/UtilitiesPage");
9
8
  if (process.env.IS_MIGRATION === 'true') {
10
9
  SM_8_10_1.test.describe.configure({ mode: 'parallel' });
@@ -60,12 +59,13 @@ if (process.env.IS_MIGRATION === 'true') {
60
59
  });
61
60
  // The Optimize assertion is the only part of the migration flow the bug
62
61
  // breaks: Operate and Tasklist keep the pre-upgrade instance, while the
63
- // report the 8.9 smoke test saved is gone after the upgrade. The loss is
64
- // scoped to the OpenSearch and the Elasticsearch + multi-tenancy upgrade
65
- // paths; standard Elasticsearch keeps the report, so it still asserts it.
62
+ // report the 8.9 smoke test saved is gone after the upgrade. Only the
63
+ // Elasticsearch + multi-tenancy upgrade path still loses it; OpenSearch
64
+ // keeps it since camunda/camunda-platform-helm#7461 migrates the Keycloak
65
+ // realm, so the user keeps the id that owns the report.
66
66
  // Skipped due to bug #56406: https://github.com/camunda/camunda/issues/56406
67
67
  (0, SM_8_10_1.test)('Assert Most Common Flow User Flow Report Migration In Optimize', async ({ page, navigationPage, optimizeHomePage, optimizeCollectionsPage, optimizeReportPage, }) => {
68
- if (env_1.isOpenSearch || process.env.IS_MT === 'true') {
68
+ if (process.env.IS_MT === 'true') {
69
69
  SM_8_10_1.test.skip(true, 'Skipped due to bug #56406: https://github.com/camunda/camunda/issues/56406');
70
70
  }
71
71
  SM_8_10_1.test.slow();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1354",
3
+ "version": "0.0.1356",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",