@camunda/e2e-test-suite 0.0.1709 → 0.0.1710

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.
@@ -227,10 +227,20 @@ class ClusterPage {
227
227
  ]);
228
228
  }
229
229
  async clickCreateNewClusterButton() {
230
+ // The old 80s budget was spent by the first attempt plus its recovery, so
231
+ // the click was never actually retried ("after 1 attempts"). And the
232
+ // recovery itself could not help on the two dead ends seen on SaaS: a bare
233
+ // `local_rate_limited` (429) document from the ingress, which only a reload
234
+ // clears, and Console dropping its session to the identity provider, which
235
+ // needs a re-login as the same tracked user before the banner exists.
230
236
  await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.createNewClusterButton, {
231
237
  visibilityTimeout: 20000,
232
- totalTimeout: 80000,
238
+ totalTimeout: 300000,
239
+ maxRetries: 4,
233
240
  postAction: async () => {
241
+ if (!(await (0, sessionRecovery_1.restoreSessionIfLoggedOut)(this.page))) {
242
+ await (0, sessionRecovery_1.reloadOrRestartLoginHandoff)(this.page);
243
+ }
234
244
  await this.clickClusterBanner();
235
245
  },
236
246
  });
@@ -351,8 +351,14 @@ class IdpCreatePage {
351
351
  timeout: 90000,
352
352
  });
353
353
  await this.unstructured_extractDocumentButton.click({ timeout: 60000 });
354
+ // Hub runs the extraction as a process instance with a 600s incident timer
355
+ // (camunda-hub performExtraction -> runInstanceWithResult(..., 600)) and
356
+ // clears "Extracting..." only on its completion event, so 120s gave up
357
+ // while the product was still inside its own budget. Wait out that window
358
+ // (+ variable-fetch retries); the result checks below still fail if the
359
+ // extraction errors or times out.
354
360
  await (0, test_1.expect)(this.page.getByText('Extracting..')).not.toBeVisible({
355
- timeout: 120000,
361
+ timeout: 660000,
356
362
  });
357
363
  await (0, test_1.expect)(this.unstructured_saveAsTestCaseButton).toBeVisible({
358
364
  timeout: 120000,
@@ -13,6 +13,8 @@ const mailSlurpClient_1 = require("../../utils/mailSlurpClient");
13
13
  const hubTableRow_1 = require("../../utils/hubTableRow");
14
14
  const consoleApiHelpers_1 = require("../../utils/consoleApiHelpers");
15
15
  const hubOrganization_1 = require("../../utils/hubOrganization");
16
+ const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
17
+ const sessionRecovery_1 = require("../../utils/sessionRecovery");
16
18
  // Tracks which worker-derived `timeout` values have already paid the
17
19
  // stagger sleep below, so a worker only pays it once per process lifetime
18
20
  // rather than on every call -- see the comment at the call site.
@@ -420,10 +422,30 @@ async function runMultipleProcesses(clusterName, page, modelerHomePage, modelerC
420
422
  }
421
423
  }
422
424
  exports.runMultipleProcesses = runMultipleProcesses;
425
+ // Landing in Console after an app switch can hit two dead ends that no
426
+ // amount of waiting recovers: the ingress answering the document request with
427
+ // a bare `local_rate_limited` (429) body, which never re-renders on its own,
428
+ // and Console dropping its session and bouncing the tab to the identity
429
+ // provider. Reload for the former and re-authenticate as the same tracked
430
+ // user for the latter, then wait again. The Clusters link must still appear,
431
+ // so a Console that is really broken still fails here.
432
+ async function waitForConsoleClustersLink(homePage) {
433
+ const page = homePage.clusterTab.page();
434
+ await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(page, homePage.clusterTab, {
435
+ visibilityTimeout: 60000,
436
+ totalTimeout: 300000,
437
+ maxRetries: 4,
438
+ postAction: async () => {
439
+ if (!(await (0, sessionRecovery_1.restoreSessionIfLoggedOut)(page))) {
440
+ await (0, sessionRecovery_1.reloadOrRestartLoginHandoff)(page);
441
+ }
442
+ },
443
+ });
444
+ }
423
445
  async function disableRBA(clusterName, homePage, clusterPage, clusterDetailsPage, appsPage) {
424
446
  await appsPage.clickCamundaApps();
425
447
  await appsPage.clickConsoleLink();
426
- await (0, test_1.expect)(homePage.clusterTab).toBeVisible({ timeout: 120000 });
448
+ await waitForConsoleClustersLink(homePage);
427
449
  await homePage.clickClusters();
428
450
  await clusterPage.clickClusterLink(clusterName);
429
451
  await (0, test_1.expect)(clusterDetailsPage.settingsTab).toBeVisible({
@@ -448,7 +470,7 @@ exports.disableRBA = disableRBA;
448
470
  async function enableAuthorizations(clusterName, homePage, clusterPage, clusterDetailsPage, appsPage) {
449
471
  await appsPage.clickCamundaApps();
450
472
  await appsPage.clickConsoleLink();
451
- await (0, test_1.expect)(homePage.clusterTab).toBeVisible({ timeout: 120000 });
473
+ await waitForConsoleClustersLink(homePage);
452
474
  await homePage.clickClusters();
453
475
  await clusterPage.clickClusterLink(clusterName);
454
476
  await (0, test_1.expect)(clusterDetailsPage.settingsTab).toBeVisible({
@@ -77,3 +77,11 @@ export declare function isAtModelerLoginRoute(page: Page): boolean;
77
77
  * guard their navigations with it.
78
78
  */
79
79
  export declare function recoverStuckModelerLogin(page: Page, attempts?: number, settleTimeout?: number, graceTimeout?: number): Promise<boolean>;
80
+ /**
81
+ * Reloads the application to clear a dead-end document (e.g. a bare
82
+ * `local_rate_limited` 429), except when the tab is parked on the login
83
+ * hand-off (`/login`, `/login-callback?code=...`): reloading there would
84
+ * replay an authorization code that was already consumed and leave the app on
85
+ * an authentication error. Start a fresh hand-off from the app root instead.
86
+ */
87
+ export declare function reloadOrRestartLoginHandoff(page: Page): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.recoverStuckModelerLogin = exports.isAtModelerLoginRoute = exports.restoreSessionIfLoggedOut = exports.isAtIdentityProvider = exports.trackSignedInUser = void 0;
3
+ exports.reloadOrRestartLoginHandoff = exports.recoverStuckModelerLogin = exports.isAtModelerLoginRoute = exports.restoreSessionIfLoggedOut = exports.isAtIdentityProvider = exports.trackSignedInUser = void 0;
4
4
  // Only the username is kept -- no password, no cookie, no token. Keyed by the
5
5
  // Playwright Page because the object that logs in (LoginPage) and the objects
6
6
  // that later have to recover a dropped session (ModelerHomePage) are separate
@@ -283,3 +283,21 @@ async function recoverStuckModelerLogin(page, attempts = 4, settleTimeout = 2500
283
283
  return true;
284
284
  }
285
285
  exports.recoverStuckModelerLogin = recoverStuckModelerLogin;
286
+ const LOGIN_HANDOFF_ROUTE = /^\/login(-callback)?\/?$/;
287
+ /**
288
+ * Reloads the application to clear a dead-end document (e.g. a bare
289
+ * `local_rate_limited` 429), except when the tab is parked on the login
290
+ * hand-off (`/login`, `/login-callback?code=...`): reloading there would
291
+ * replay an authorization code that was already consumed and leave the app on
292
+ * an authentication error. Start a fresh hand-off from the app root instead.
293
+ */
294
+ async function reloadOrRestartLoginHandoff(page) {
295
+ const current = new URL(page.url());
296
+ if (LOGIN_HANDOFF_ROUTE.test(current.pathname) ||
297
+ current.searchParams.has('code')) {
298
+ await page.goto(current.origin, { waitUntil: 'domcontentloaded' });
299
+ return;
300
+ }
301
+ await page.reload({ waitUntil: 'domcontentloaded' });
302
+ }
303
+ exports.reloadOrRestartLoginHandoff = reloadOrRestartLoginHandoff;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1709",
3
+ "version": "0.0.1710",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",