@camunda/e2e-test-suite 0.0.1723 → 0.0.1725

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.
@@ -510,7 +510,11 @@ class AppsPage {
510
510
  await this.clickHubClusterApp(clusterName, 'Operate');
511
511
  return;
512
512
  }
513
- const maxRetries = 3;
513
+ // The app switcher's cluster list is fetched from Console, whose ingress
514
+ // rate-limits (net::ERR_FAILED) in multi-minute bursts while the whole
515
+ // suite is running; 3 attempts (~2 min) never outlasted one. 6 attempts
516
+ // with the reload + 20s pause below give it ~5 minutes.
517
+ const maxRetries = 6;
514
518
  for (let retries = 0; retries < maxRetries; retries++) {
515
519
  try {
516
520
  if (retries === 0) {
@@ -319,7 +319,10 @@ class ClusterDetailsPage {
319
319
  async assertAPIClientScopes(name) {
320
320
  const row = this.clientsList.filter({ hasText: name });
321
321
  const scopes = /(?=.*Orchestration)(?=.*Optimize)(?=.*Secrets)/;
322
- const maxAttempts = 3;
322
+ // 5 rather than 3: during a Console ingress rate-limit burst
323
+ // (net::ERR_FAILED) the API tab renders without its clients table until
324
+ // the cluster queries succeed again, and 3 reloads did not outlast one.
325
+ const maxAttempts = 5;
323
326
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
324
327
  try {
325
328
  await (0, test_1.expect)(this.clientsFilterInput).toBeVisible({ timeout: 60000 });
@@ -434,12 +437,15 @@ class ClusterDetailsPage {
434
437
  // `aria-selected="false"` with Overview still selected, so the Authorizations
435
438
  // section never mounts and a single-shot wait on the heading can never
436
439
  // succeed no matter how long it waits. Reload and re-select Settings between
437
- // attempts so the click lands on a settled tab bar.
440
+ // attempts so the click lands on a settled tab bar. The Settings panel also
441
+ // renders empty while Console's ingress is rate-limiting (net::ERR_FAILED on
442
+ // the cluster queries); those bursts can last several minutes while the
443
+ // whole suite runs, and 4 attempts in 240s did not outlast one.
438
444
  async waitForAuthorizationsSection() {
439
445
  await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.authorizationsHeading, {
440
446
  visibilityTimeout: 60000,
441
- totalTimeout: 240000,
442
- maxRetries: 4,
447
+ totalTimeout: 420000,
448
+ maxRetries: 6,
443
449
  postAction: async () => {
444
450
  await this.page.reload({ waitUntil: 'domcontentloaded' });
445
451
  await this.settingsTab.waitFor({ state: 'visible', timeout: 60000 });
@@ -575,15 +581,56 @@ class ClusterDetailsPage {
575
581
  }
576
582
  }
577
583
  async searchAndClickClientCredentialsLink(name) {
578
- await (0, test_1.expect)(this.clientsList.first()).toBeVisible({ timeout: 60000 });
579
- await (0, test_1.expect)(this.clientsFilterInput).toBeVisible({ timeout: 60000 });
580
- await this.clientsFilterInput.fill(name);
581
- const clientLink = this.clientCredentialsLink(name);
582
- await (0, test_1.expect)(clientLink).toBeVisible({ timeout: 30000 });
583
- await clientLink.click();
584
584
  const clientCredentialsDetailsPage = new ClientCredentialsDetailsPage_1.ClientCredentialsDetailsPage(this.page);
585
- await clientCredentialsDetailsPage.isOpen(name);
586
- return clientCredentialsDetailsPage;
585
+ // During a Console ingress rate-limit burst (net::ERR_FAILED) the client
586
+ // details view can open without ever loading its credentials, and nothing
587
+ // refetches them on its own. Reload the API tab and reopen the client
588
+ // rather than failing on the first 60s wait.
589
+ const maxAttempts = 4;
590
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
591
+ try {
592
+ await (0, test_1.expect)(this.clientsList.first()).toBeVisible({ timeout: 60000 });
593
+ await (0, test_1.expect)(this.clientsFilterInput).toBeVisible({ timeout: 60000 });
594
+ await this.clientsFilterInput.fill(name);
595
+ const clientLink = this.clientCredentialsLink(name);
596
+ await (0, test_1.expect)(clientLink).toBeVisible({ timeout: 30000 });
597
+ await clientLink.click();
598
+ await clientCredentialsDetailsPage.isOpen(name);
599
+ // isOpen() accepts the client-name heading alone, which renders
600
+ // before (and without) the credentials; require the Operate URL so a
601
+ // view whose credentials never loaded is retried, not returned.
602
+ await clientCredentialsDetailsPage.getOperateUrl();
603
+ return clientCredentialsDetailsPage;
604
+ }
605
+ catch (error) {
606
+ if (attempt === maxAttempts) {
607
+ throw error;
608
+ }
609
+ console.warn(`searchAndClickClientCredentialsLink: "${name}" details did not load (attempt ${attempt}/${maxAttempts}); reloading the API tab and retrying. ${error}`);
610
+ // Recovery can fail during the same Console outage that triggered
611
+ // it; log and let the next attempt (or the final throw) handle it.
612
+ try {
613
+ await this.page.keyboard.press('Escape').catch(() => { });
614
+ // The client details view is its own history entry (see
615
+ // ClientCredentialsDetailsPage.goBack()); step back to the cluster
616
+ // page first if the tab bar is not showing.
617
+ const onClusterPage = await this.apiTab
618
+ .waitFor({ state: 'visible', timeout: 5000 })
619
+ .then(() => true)
620
+ .catch(() => false);
621
+ if (!onClusterPage) {
622
+ await this.page.goBack({ waitUntil: 'domcontentloaded' });
623
+ }
624
+ await this.dismissOopsIfPresent();
625
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
626
+ await this.clickAPITab();
627
+ }
628
+ catch (recoveryError) {
629
+ console.warn(`searchAndClickClientCredentialsLink: recovery after attempt ${attempt}/${maxAttempts} failed; retrying. ${recoveryError}`);
630
+ }
631
+ }
632
+ }
633
+ throw new Error(`searchAndClickClientCredentialsLink: "${name}" details never opened`);
587
634
  }
588
635
  async deleteAPIClientsIfExist(name) {
589
636
  if (name) {
@@ -849,9 +896,12 @@ class ClusterDetailsPage {
849
896
  // can last a few minutes: GETs recover via the app's own refetch, but
850
897
  // the create POST is not retried and surfaces as "fetch error", and the
851
898
  // reload between attempts lands the panel with "Create new client"
852
- // disabled until the cluster queries succeed. Five attempts, each one
853
- // waiting for the panel to recover first, ride out such a burst.
854
- const maxRetries = 5;
899
+ // disabled until the cluster queries succeed. The bursts are the Console
900
+ // ingress rate-limiting (`local_rate_limited`) while the whole suite runs,
901
+ // and one lasted ~10 minutes (2026-11-23 nightly), outliving five
902
+ // attempts (~6 min). Seven attempts, each one waiting for the panel to
903
+ // recover first, give it ~8.5 minutes inside the 12-minute test timeout.
904
+ const maxRetries = 7;
855
905
  for (let attempt = 0; attempt < maxRetries; attempt++) {
856
906
  // Use a suffixed name on retries so duplicate-name validation never
857
907
  // leaves the Create button permanently disabled. A prior attempt may
@@ -396,15 +396,27 @@ class ClusterPage {
396
396
  async clickClusterLink(name) {
397
397
  await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.clusterLink(name), {
398
398
  // A reload per retry needs more headroom than the 60s default, otherwise
399
- // the loop runs out of budget before the last attempt.
400
- totalTimeout: 180000,
399
+ // the loop runs out of budget before the last attempt. Console's ingress
400
+ // rate-limits (`local_rate_limited`, seen by the browser as
401
+ // net::ERR_FAILED) in bursts lasting several minutes when the whole
402
+ // suite starts at once; 3 attempts in 180s never outlasted one. Spread
403
+ // more attempts over a longer window, spaced out so the reloads don't
404
+ // keep feeding the limiter. Each attempt costs ~45s (10s visibility
405
+ // wait + reload + 30s spacing), so allow enough attempts to fill the
406
+ // window; totalTimeout is the real bound.
407
+ totalTimeout: 420000,
408
+ maxRetries: 10,
409
+ retryDelayMs: 30000,
401
410
  postAction: async () => {
402
411
  // When Console's cluster fetch comes back empty it renders the
403
412
  // "Processes run on clusters" empty state and keeps it: clicking the
404
413
  // Clusters banner is an in-app route change to the page that is
405
414
  // already mounted, so nothing refetches and the row never appears.
406
- // Reload first to force the list to be fetched again.
407
- await this.page.reload({ waitUntil: 'domcontentloaded' });
415
+ // Reload first to force the list to be fetched again (or log back in
416
+ // as the same user if Console dropped the session).
417
+ if (!(await (0, sessionRecovery_1.restoreSessionIfLoggedOut)(this.page))) {
418
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
419
+ }
408
420
  await this.clickClusterBanner();
409
421
  },
410
422
  });
@@ -56,8 +56,20 @@ _8_11_1.test.describe('Agentic Control Plane Dashboard API Tests @agentic-dashbo
56
56
  (0, _8_11_1.test)('Dashboard API uses current terminology and not legacy wording', async ({ page, appsPage, optimizeHomePage, }) => {
57
57
  const responses = await (0, agenticDashboardHelpers_1.captureDashboardResponses)(page, async () => {
58
58
  await (0, agenticDashboardHelpers_1.openAgenticControlPlane)(page, appsPage, optimizeHomePage, clusterName);
59
- });
60
- const dashboardResponses = responses.filter(agenticDashboardHelpers_1.isLikelyDashboardApiResponse);
59
+ }, { includeNonJsonReportEvaluations: true });
60
+ // The report names (where the terminology lives) are only in successful
61
+ // report evaluations. During an Optimize backend 5xx burst (nightly
62
+ // 45107178172: every agentic report evaluation returned 500 for ~2 min)
63
+ // the captured bodies are error payloads and the terminology check fails
64
+ // for the wrong reason. Wait for a healthy load first, and assert it, so a
65
+ // persistent 5xx still fails here with an explicit message.
66
+ const reportResponses = await (0, agenticDashboardHelpers_1.reloadUntilDashboardReportsHealthy)(page, responses, 6, 10000);
67
+ (0, test_1.expect)(reportResponses.filter((r) => r.status !== 200).map((r) => r.url), 'dashboard report evaluations returned non-200').toEqual([]);
68
+ (0, test_1.expect)(reportResponses.length).toBeGreaterThan(0);
69
+ const dashboardResponses = [
70
+ ...responses.filter(agenticDashboardHelpers_1.isAgenticDashboardDefinitionResponse),
71
+ ...reportResponses,
72
+ ];
61
73
  (0, test_1.expect)(dashboardResponses.length).toBeGreaterThan(0);
62
74
  const joined = dashboardResponses
63
75
  .map((r) => r.bodyText)
@@ -41,11 +41,12 @@ export declare function captureDashboardResponses(page: Page, action: () => Prom
41
41
  }): Promise<CapturedResponse[]>;
42
42
  /**
43
43
  * Waits until the agentic dashboard's initial report evaluations all return
44
- * 200, reloading the page (up to `maxReloads` times) while the Optimize
45
- * backend is still answering some of them with 5xx. Returns the report
46
- * evaluate responses of the last load so the caller can assert on them.
44
+ * 200, reloading the page (up to `maxReloads` times, polling with a
45
+ * `backoffMs * n` interval after the n-th reload) while the Optimize backend
46
+ * is still answering some of them with 5xx. Returns the report evaluate
47
+ * responses of the last load so the caller can assert on them.
47
48
  */
48
- export declare function reloadUntilDashboardReportsHealthy(page: Page, initialResponses: CapturedResponse[], maxReloads?: number): Promise<CapturedResponse[]>;
49
+ export declare function reloadUntilDashboardReportsHealthy(page: Page, initialResponses: CapturedResponse[], maxReloads?: number, backoffMs?: number): Promise<CapturedResponse[]>;
49
50
  export declare function parseJsonResponseBodies(responses: CapturedResponse[]): unknown[];
50
51
  export declare function findReportByName(bodies: unknown[], name: string): unknown;
51
52
  export declare function getReportNumericResult(body: unknown): number | undefined;
@@ -145,19 +145,33 @@ async function captureDashboardResponses(page, action, options = {}) {
145
145
  exports.captureDashboardResponses = captureDashboardResponses;
146
146
  /**
147
147
  * Waits until the agentic dashboard's initial report evaluations all return
148
- * 200, reloading the page (up to `maxReloads` times) while the Optimize
149
- * backend is still answering some of them with 5xx. Returns the report
150
- * evaluate responses of the last load so the caller can assert on them.
148
+ * 200, reloading the page (up to `maxReloads` times, polling with a
149
+ * `backoffMs * n` interval after the n-th reload) while the Optimize backend
150
+ * is still answering some of them with 5xx. Returns the report evaluate
151
+ * responses of the last load so the caller can assert on them.
151
152
  */
152
- async function reloadUntilDashboardReportsHealthy(page, initialResponses, maxReloads = 3) {
153
+ async function reloadUntilDashboardReportsHealthy(page, initialResponses, maxReloads = 3, backoffMs = 0) {
153
154
  const isHealthy = (reports) => reports.length > 0 && reports.every((r) => r.status === 200);
154
155
  let reports = initialResponses.filter(isReportEvaluateResponse);
155
- for (let attempt = 0; attempt < maxReloads && !isHealthy(reports); attempt++) {
156
+ if (maxReloads <= 0 || isHealthy(reports))
157
+ return reports;
158
+ // Bounded by count, not by toPass's timeout: the block passes once the
159
+ // reports are healthy OR the reload budget is spent, so on exhaustion the
160
+ // last load is returned and the caller's own assertion names the failure.
161
+ // Optional linear backoff between reloads: a 5xx burst can outlast a few
162
+ // quick reloads.
163
+ const intervals = backoffMs > 0
164
+ ? Array.from({ length: maxReloads }, (_, i) => backoffMs * (i + 1))
165
+ : [0];
166
+ let reloads = 0;
167
+ await (0, test_1.expect)(async () => {
168
+ reloads++;
156
169
  const responses = await captureDashboardResponses(page, async () => {
157
170
  await page.reload({ waitUntil: 'domcontentloaded' });
158
171
  }, { includeNonJsonReportEvaluations: true });
159
172
  reports = responses.filter(isReportEvaluateResponse);
160
- }
173
+ (0, test_1.expect)(isHealthy(reports) || reloads >= maxReloads, 'dashboard report evaluations not yet healthy').toBe(true);
174
+ }).toPass({ intervals, timeout: 0 });
161
175
  return reports;
162
176
  }
163
177
  exports.reloadUntilDashboardReportsHealthy = reloadUntilDashboardReportsHealthy;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1723",
3
+ "version": "0.0.1725",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",