@camunda/e2e-test-suite 0.0.1531 → 0.0.1532

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.
@@ -163,7 +163,7 @@ class FormJsPage {
163
163
  .locator('[data-test^="environment-row-"]')
164
164
  .first();
165
165
  const hasEnvironmentRow = await environmentRow
166
- .waitFor({ state: 'visible', timeout: 10000 })
166
+ .waitFor({ state: 'visible', timeout: 30000 })
167
167
  .then(() => true)
168
168
  .catch(() => false);
169
169
  if (hasEnvironmentRow) {
@@ -521,11 +521,31 @@ class ModelerCreatePage {
521
521
  // a form with the same name and the picker then lists two identical entries.
522
522
  // Scope to the first matching item so the link step stays deterministic on retry
523
523
  // instead of failing with a strict-mode violation.
524
- await this.page
525
- .locator('[data-test="link-target-list"]')
524
+ //
525
+ // The picker lists the folder from a single fetch taken when it opens; a
526
+ // form saved moments earlier can be missing from that snapshot, and the
527
+ // open picker never refetches on its own. Close and reopen it (which
528
+ // refetches the folder) instead of waiting out one stale listing.
529
+ const linkTargetList = this.page.locator('[data-test="link-target-list"]');
530
+ const formRow = linkTargetList
526
531
  .getByRole('button', { name: `Select ${name}` })
527
- .first()
528
- .click({ timeout: 90000 });
532
+ .first();
533
+ const maxAttempts = 3;
534
+ for (let attempt = 1; attempt < maxAttempts; attempt++) {
535
+ const listed = await formRow
536
+ .waitFor({ state: 'visible', timeout: 30000 })
537
+ .then(() => true)
538
+ .catch(() => false);
539
+ if (listed) {
540
+ break;
541
+ }
542
+ console.warn(`clickForm: "${name}" not listed in the link picker (attempt ` +
543
+ `${attempt}/${maxAttempts}), reopening the picker`);
544
+ await this.page.keyboard.press('Escape');
545
+ await (0, test_1.expect)(linkTargetList).toBeHidden({ timeout: 15000 });
546
+ await this.clickEmbedFormButton();
547
+ }
548
+ await formRow.click({ timeout: 30000 });
529
549
  }
530
550
  async clickUserTask(id) {
531
551
  const priorityUserTask = this.page.locator(`[data-element-id="${id}"]`);
@@ -991,9 +1011,18 @@ class ModelerCreatePage {
991
1011
  await this.webhookIsActiveButton.click({ timeout: 60000 });
992
1012
  }
993
1013
  async assertThreeElementsVisible() {
994
- await (0, test_1.expect)(this.firstElement).toBeVisible({ timeout: 30000 });
995
- await (0, test_1.expect)(this.secondElement).toBeVisible({ timeout: 30000 });
996
- await (0, test_1.expect)(this.thirdElement).toBeVisible({ timeout: 30000 });
1014
+ // bpmn-js adds state markers ("selected", "hover") to a shape's class
1015
+ // list, so the exact [class="djs-element djs-shape"] match behind
1016
+ // first/second/thirdElement skips whichever shape is selected or under
1017
+ // the pointer -- the just-appended end event, or whatever the canvas
1018
+ // click lands on -- and nth(2) then finds nothing. Match on the classes
1019
+ // instead, so every rendered shape counts regardless of its state.
1020
+ const shapes = this.page
1021
+ .locator('.djs-container')
1022
+ .locator('.djs-element.djs-shape');
1023
+ for (let index = 0; index < 3; index++) {
1024
+ await (0, test_1.expect)(shapes.nth(index)).toBeVisible({ timeout: 30000 });
1025
+ }
997
1026
  }
998
1027
  async clickDeployButtonWithRetry(retries = 3) {
999
1028
  for (let i = 0; i < retries; i++) {
@@ -1832,7 +1861,7 @@ class ModelerCreatePage {
1832
1861
  .locator('[data-test^="environment-row-"]')
1833
1862
  .first();
1834
1863
  const hasEnvironmentRow = await environmentRow
1835
- .waitFor({ state: 'visible', timeout: 10000 })
1864
+ .waitFor({ state: 'visible', timeout: 30000 })
1836
1865
  .then(() => true)
1837
1866
  .catch(() => false);
1838
1867
  if (hasEnvironmentRow) {
@@ -2075,6 +2104,29 @@ class ModelerCreatePage {
2075
2104
  // click that copies the link.
2076
2105
  const context = this.page.context();
2077
2106
  await context.grantPermissions(['clipboard-read', 'clipboard-write']);
2107
+ // On an expired session Hub's handleUnauthorized() sends the tab through
2108
+ // /login?returnUrl=<diagram> and back. The diagram comes back without the
2109
+ // Publication tab selected, so the Copy button never renders. Wait for
2110
+ // the round trip to land back off /login, then select the tab again.
2111
+ const maxAttempts = 3;
2112
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
2113
+ try {
2114
+ await this.clickPublicationTab();
2115
+ await (0, test_1.expect)(this.copyPublicLinkButton).toBeVisible({ timeout: 60000 });
2116
+ break;
2117
+ }
2118
+ catch (error) {
2119
+ if (attempt === maxAttempts) {
2120
+ throw error;
2121
+ }
2122
+ console.warn(`getPublicationLink: Copy button not shown (attempt ${attempt}/` +
2123
+ `${maxAttempts}) on ${this.page.url()}, retrying`);
2124
+ await this.page.waitForURL((url) => !url.pathname.endsWith('/login'), {
2125
+ timeout: 120000,
2126
+ });
2127
+ await (0, test_1.expect)(this.publicationTab).toBeVisible({ timeout: 120000 });
2128
+ }
2129
+ }
2078
2130
  await this.clickCopyPublicLinkButton();
2079
2131
  // Poll instead of one blind read after a fixed sleep -- the write is
2080
2132
  // async on the page's side and has no visible completion signal to wait
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1531",
3
+ "version": "0.0.1532",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",