@camunda/e2e-test-suite 0.0.1320 → 0.0.1322

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.
@@ -313,7 +313,15 @@ class ModelerHomePage {
313
313
  // resource is one level down, so re-enter the container first.
314
314
  async clickProcessDiagram(name) {
315
315
  await this.ensureInResourceContainer();
316
- const process = this.rows.filter({ hasText: name }).getByTitle(name).first();
316
+ // A Design System table row opens through a link laid over the row, which
317
+ // sits on top of the title text and takes its clicks -- so click the link.
318
+ // The link comes before the title in DOM order, so `first()` picks it
319
+ // whenever it exists; the title stays as the fallback for the classic table.
320
+ const row = this.rows.filter({ hasText: name });
321
+ const process = row
322
+ .getByRole('link', { name })
323
+ .or(row.getByTitle(name))
324
+ .first();
317
325
  await (0, test_1.expect)(process).toBeVisible({ timeout: 90000 });
318
326
  await process.click();
319
327
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProcessApplicationPage = void 0;
4
4
  const test_1 = require("@playwright/test");
5
5
  const submitModalWithRetry_1 = require("../../utils/assertionHelpers/submitModalWithRetry");
6
+ const sessionRecovery_1 = require("../../utils/sessionRecovery");
6
7
  // Which process application holds the current test's resources, and which
7
8
  // cluster its development stage currently points at. Keyed by the Playwright
8
9
  // Page because the object that creates the container (ModelerHomePage) and the
@@ -135,6 +136,11 @@ class ProcessApplicationPage {
135
136
  const perAttempt = Math.ceil(timeout / attempts);
136
137
  const remaining = () => Math.max(deadline - Date.now(), 1000);
137
138
  for (let attempt = 1; attempt < attempts; attempt++) {
139
+ // Hub can drop its session on a navigation and bounce through
140
+ // /login-callback to the identity provider, where neither reloading nor
141
+ // waiting renders the content -- re-authenticate first.
142
+ await (0, sessionRecovery_1.recoverStuckModelerLogin)(this.page);
143
+ await (0, sessionRecovery_1.restoreSessionIfLoggedOut)(this.page);
138
144
  const ready = await target
139
145
  .waitFor({ state: 'visible', timeout: Math.min(perAttempt, remaining()) })
140
146
  .then(() => true)
@@ -143,8 +149,15 @@ class ProcessApplicationPage {
143
149
  return;
144
150
  }
145
151
  console.warn(`Process application content did not render (attempt ${attempt}/${attempts}); reloading.`);
146
- await this.page.reload({ waitUntil: 'load', timeout: remaining() });
152
+ // 'domcontentloaded': a reload that bounces through /login-callback
153
+ // never reaches "load", and recovery above needs the page back.
154
+ await this.page.reload({
155
+ waitUntil: 'domcontentloaded',
156
+ timeout: remaining(),
157
+ });
147
158
  }
159
+ await (0, sessionRecovery_1.recoverStuckModelerLogin)(this.page);
160
+ await (0, sessionRecovery_1.restoreSessionIfLoggedOut)(this.page);
148
161
  await (0, test_1.expect)(target).toBeVisible({ timeout: remaining() });
149
162
  }
150
163
  async clickCreateProcessApplicationButton() {
@@ -8,6 +8,7 @@ const randomName_1 = require("../../utils/randomName");
8
8
  const ProcessApplicationPage_1 = require("./ProcessApplicationPage");
9
9
  const sessionRecovery_1 = require("../../utils/sessionRecovery");
10
10
  const modelerCluster_1 = require("../../utils/modelerCluster");
11
+ const hubTableRow_1 = require("../../utils/hubTableRow");
11
12
  class ModelerHomePage {
12
13
  defaultFolderName = 'Cross Component Test Project';
13
14
  // The default cluster test-setup.spec.ts's "Create Default Cluster" test
@@ -369,9 +370,9 @@ class ModelerHomePage {
369
370
  // resource is one level down, so re-enter the container first.
370
371
  async clickProcessDiagram(name) {
371
372
  await this.ensureInResourceContainer();
372
- const process = this.rows.filter({ hasText: name }).getByTitle(name).first();
373
+ const process = (0, hubTableRow_1.hubTableRowName)(this.page, name);
373
374
  await (0, test_1.expect)(process).toBeVisible({ timeout: 90000 });
374
- await process.click();
375
+ await (0, hubTableRow_1.openHubTableRow)(this.page, name);
375
376
  }
376
377
  // Opens the create menu inside this test's process application. The menu at
377
378
  // workspace root no longer offers BPMN, Form or Upload -- those resources
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProcessApplicationPage = void 0;
4
4
  const test_1 = require("@playwright/test");
5
5
  const submitModalWithRetry_1 = require("../../utils/assertionHelpers/submitModalWithRetry");
6
+ const hubTableRow_1 = require("../../utils/hubTableRow");
6
7
  // Which process application holds the current test's resources, and which
7
8
  // cluster its development stage currently points at. Keyed by the Playwright
8
9
  // Page because the object that creates the container (ModelerHomePage) and the
@@ -449,13 +450,9 @@ class ProcessApplicationPage {
449
450
  await reopen.click({ timeout: 30000 });
450
451
  }
451
452
  async openByName(name) {
452
- const processApplication = this.page
453
- .getByRole('row')
454
- .filter({ hasText: name })
455
- .getByTitle(name)
456
- .first();
453
+ const processApplication = (0, hubTableRow_1.hubTableRowName)(this.page, name);
457
454
  await (0, test_1.expect)(processApplication).toBeVisible({ timeout: 90000 });
458
- await processApplication.click({ timeout: 60000 });
455
+ await (0, hubTableRow_1.openHubTableRow)(this.page, name, { timeout: 60000 });
459
456
  await this.waitForProcessApplication();
460
457
  }
461
458
  }
@@ -9,6 +9,7 @@ const sleep_1 = require("../../utils/sleep");
9
9
  const randomSleep_1 = require("../../utils/randomSleep");
10
10
  const fileUpload_1 = require("../../utils/fileUpload");
11
11
  const mailSlurpClient_1 = require("../../utils/mailSlurpClient");
12
+ const hubTableRow_1 = require("../../utils/hubTableRow");
12
13
  const consoleApiHelpers_1 = require("../../utils/consoleApiHelpers");
13
14
  // Tracks which worker-derived `timeout` values have already paid the
14
15
  // stagger sleep below, so a worker only pays it once per process lifetime
@@ -185,17 +186,13 @@ async function modelDiagramFromFile(page, modelerHomePage, modelerCreatePage, pr
185
186
  console.warn(`${fileName}.bpmn did not appear after upload ` +
186
187
  `(attempt ${attempt}/${maxUploadAttempts}); re-reading the list.`);
187
188
  await modelerHomePage.returnToResourceContainer();
188
- const uploaded = page
189
- .getByRole('row')
190
- .filter({ hasText: fileName })
191
- .getByTitle(fileName)
192
- .first();
189
+ const uploaded = (0, hubTableRow_1.hubTableRowName)(page, fileName);
193
190
  const landed = await uploaded
194
191
  .waitFor({ state: 'visible', timeout: 15000 })
195
192
  .then(() => true)
196
193
  .catch(() => false);
197
194
  if (landed) {
198
- await uploaded.click();
195
+ await (0, hubTableRow_1.openHubTableRow)(page, fileName);
199
196
  break;
200
197
  }
201
198
  }
@@ -0,0 +1,5 @@
1
+ import { Locator, Page } from '@playwright/test';
2
+ export declare function hubTableRowName(page: Page, name: string): Locator;
3
+ export declare function openHubTableRow(page: Page, name: string, options?: {
4
+ timeout?: number;
5
+ }): Promise<void>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.openHubTableRow = exports.hubTableRowName = void 0;
4
+ // Since camunda/camunda-hub#29692 the design-system entity tables (process
5
+ // application resources, projects, IDP applications, ...) stretch a real link
6
+ // -- `data-slot="data-table-row-primary-action"` -- over the whole row. It
7
+ // sits on top of the name cell and intercepts every click on the `title`
8
+ // element, so a title click times out. Open the row through that link, and
9
+ // click the name itself only when the table renders no row link (e.g. while
10
+ // a row is being renamed inline).
11
+ function hubTableRowName(page, name) {
12
+ return page.getByRole('row').filter({ hasText: name }).getByTitle(name).first();
13
+ }
14
+ exports.hubTableRowName = hubTableRowName;
15
+ async function openHubTableRow(page, name, options = {}) {
16
+ const row = page
17
+ .getByRole('row')
18
+ .filter({ hasText: name })
19
+ .filter({ has: page.getByTitle(name) })
20
+ .first();
21
+ const rowLink = row.locator('[data-slot="data-table-row-primary-action"]');
22
+ if ((await rowLink.count()) > 0) {
23
+ await rowLink.first().click(options);
24
+ return;
25
+ }
26
+ await row.getByTitle(name).first().click(options);
27
+ }
28
+ exports.openHubTableRow = openHubTableRow;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1320",
3
+ "version": "0.0.1322",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",