@camunda/e2e-test-suite 0.0.1708 → 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.
@@ -73,6 +73,14 @@ declare class ClusterPage {
73
73
  * for the cluster') after 3 attempts": one recoverable slow render, then
74
74
  * two attempts that could not succeed. Retrying in place costs the same
75
75
  * time and can actually find the input.
76
+ *
77
+ * Retrying in place cannot help either when the form's own data request
78
+ * failed: release run 44501084573 (DUP-04) showed the form route render
79
+ * only its "Duplicate a cluster" heading because GET .../clusters/parameters
80
+ * was rejected by Console's rate limiter (a 429 without CORS headers, so
81
+ * net::ERR_FAILED), and Hub never refetches it. Both forms are their own
82
+ * routes (/clusters/create and /clusters/create?duplicateOf=<id>), so a
83
+ * reload keeps the user on the same form and does refetch its data.
76
84
  */
77
85
  clickClusterNameInput(): Promise<void>;
78
86
  cloudProviderOption(region: string): Locator;
@@ -381,9 +381,26 @@ class ClusterPage {
381
381
  * for the cluster') after 3 attempts": one recoverable slow render, then
382
382
  * two attempts that could not succeed. Retrying in place costs the same
383
383
  * time and can actually find the input.
384
+ *
385
+ * Retrying in place cannot help either when the form's own data request
386
+ * failed: release run 44501084573 (DUP-04) showed the form route render
387
+ * only its "Duplicate a cluster" heading because GET .../clusters/parameters
388
+ * was rejected by Console's rate limiter (a 429 without CORS headers, so
389
+ * net::ERR_FAILED), and Hub never refetches it. Both forms are their own
390
+ * routes (/clusters/create and /clusters/create?duplicateOf=<id>), so a
391
+ * reload keeps the user on the same form and does refetch its data.
384
392
  */
385
393
  async clickClusterNameInput() {
386
- await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.clusterNameInput);
394
+ await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.clusterNameInput, {
395
+ maxRetries: 4,
396
+ visibilityTimeout: 20000,
397
+ totalTimeout: 150000,
398
+ postAction: async () => {
399
+ if (/\/clusters\/create$/.test(new URL(this.page.url()).pathname)) {
400
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
401
+ }
402
+ },
403
+ });
387
404
  }
388
405
  // The Console's "Select cloud provider" radiogroup now names its options
389
406
  // by the provider's full name with the short code in parentheses ("Google
@@ -480,12 +497,29 @@ class ClusterPage {
480
497
  // didn't propagate yet (parallel setup workers, list-fetch race).
481
498
  // Reload once and give the list a longer window before giving up.
482
499
  console.warn(`clickClustersBreadcrumb: '${clusterName}' not visible after banner nav; reloading and extending wait to 90s.`);
483
- await this.page.reload({ waitUntil: 'domcontentloaded' }).catch(() => { });
484
- await (0, test_1.expect)(clusterRowVisible).toBeVisible({ timeout: 90000 });
500
+ // One reload is not enough when the list request itself is rejected:
501
+ // release run 44501084573 (DUP-05) showed the list's empty state ("Processes
502
+ // run on clusters") because Console's rate limiter answered GET
503
+ // .../clusters with a 429 lacking CORS headers, and Hub does not
504
+ // refetch on its own. Reload between shorter waits so a later
505
+ // request can land (a failed reload is retried by toPass too).
506
+ await (0, test_1.expect)(async () => {
507
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
508
+ await (0, test_1.expect)(clusterRowVisible).toBeVisible({ timeout: 30000 });
509
+ }).toPass({ intervals: [5000], timeout: 120000 });
485
510
  }
486
511
  }
487
512
  async clickClusterLink(name) {
513
+ // When Console's rate limiter rejects GET .../clusters (a 429 without
514
+ // CORS headers, so Hub sees net::ERR_FAILED), the list renders its empty
515
+ // state until a later navigation refetches. Release run 44501084573 (GCP
516
+ // secrets flow) spent all of the default 3 x 10s window inside one such
517
+ // burst. Give the list longer and back off between re-navigations.
488
518
  await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.clusterLink(name), {
519
+ maxRetries: 5,
520
+ visibilityTimeout: 20000,
521
+ retryDelayMs: 5000,
522
+ totalTimeout: 180000,
489
523
  postAction: async () => {
490
524
  await this.clickClusterBanner();
491
525
  },
@@ -519,6 +553,13 @@ class ClusterPage {
519
553
  if (activated) {
520
554
  return;
521
555
  }
556
+ // A failed cluster request leaves the page on "Oops ... something went
557
+ // wrong." (release run 44501084573), which re-clicking a tab never
558
+ // clears. Reload so the next attempt starts from a fresh fetch.
559
+ const oopsHeading = this.page.getByRole('heading', { name: /Oops/i });
560
+ if (attempt < maxAttempts && (await oopsHeading.isVisible())) {
561
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
562
+ }
522
563
  }
523
564
  // Still on Overview after re-clicking: fail loudly rather than proceeding
524
565
  // to a secrets panel that never mounted -- this keeps a genuinely broken
@@ -252,17 +252,58 @@ class ClusterSecretsPage {
252
252
  await this.createButton.click({ timeout: 30000 });
253
253
  }
254
254
  async createNewSecret(key, value, cluster) {
255
- await this.clickCreateNewSecretButton(cluster);
256
- await this.clickKeyInput();
257
- await this.fillKeyInput(key);
258
- await (0, sleep_1.sleep)(1000);
259
- await this.clickValueInput();
260
- await this.fillValueInput(value);
261
- await (0, sleep_1.sleep)(1000);
262
- await this.clickCreateButton();
263
- await (0, test_1.expect)(this.page.getByText('Creating...')).not.toBeVisible({
264
- timeout: 60000,
265
- });
255
+ // The verification loop below only re-reads the list, so a create POST
256
+ // that never reached the backend can never pass it. Release run
257
+ // 44501084573 (DUP-05) had exactly that: Console's rate limiter rejected
258
+ // POST .../connectorSecrets (a 429 without CORS headers, so
259
+ // net::ERR_FAILED) and the panel stayed on its empty state for every
260
+ // attempt. Re-submit when the POST got no response or a 429/5xx; a 409
261
+ // (already exists) counts as created, as the comment below describes.
262
+ const maxSubmits = 3;
263
+ for (let submit = 1; submit <= maxSubmits; submit++) {
264
+ await this.clickCreateNewSecretButton(cluster);
265
+ await this.clickKeyInput();
266
+ await this.fillKeyInput(key);
267
+ await (0, sleep_1.sleep)(1000);
268
+ await this.clickValueInput();
269
+ await this.fillValueInput(value);
270
+ await (0, sleep_1.sleep)(1000);
271
+ const createRequest = this.page.waitForRequest((request) => request.method() === 'POST' &&
272
+ /\/connectorSecrets$/.test(new URL(request.url()).pathname), { timeout: 30000 });
273
+ // Mark the rejection handled now: it can time out while the click and
274
+ // the 60s "Creating..." wait below are still running. The await in the
275
+ // try block further down still receives the rejection.
276
+ createRequest.catch(() => undefined);
277
+ await this.clickCreateButton();
278
+ await (0, test_1.expect)(this.page.getByText('Creating...')).not.toBeVisible({
279
+ timeout: 60000,
280
+ });
281
+ let rejected = false;
282
+ try {
283
+ const response = await (await createRequest).response();
284
+ rejected =
285
+ response === null ||
286
+ response.status() === 429 ||
287
+ response.status() >= 500;
288
+ }
289
+ catch (error) {
290
+ // POST not observed (e.g. a different create route): keep the
291
+ // previous behaviour and let the list check below decide.
292
+ console.warn(`createNewSecret: create POST not observed. ${error}`);
293
+ }
294
+ if (!rejected) {
295
+ break;
296
+ }
297
+ if (submit === maxSubmits) {
298
+ throw new Error(`createNewSecret: POST for "${key}" was rejected on all ${maxSubmits} submits (rate limited or server error).`);
299
+ }
300
+ console.warn(`createNewSecret: POST for "${key}" was rejected (submit ${submit}/${maxSubmits}); reloading and re-submitting.`);
301
+ // Stay on the current cluster: the reload lands on its Overview tab,
302
+ // so open the secrets tab directly instead of going through the
303
+ // clusters list, whose GET can be rate limited the same way.
304
+ await this.page.reload({ waitUntil: 'domcontentloaded' });
305
+ await this.clusterSecretTab.click({ timeout: 30000 });
306
+ }
266
307
  const secretRow = this.page.getByRole('row', {
267
308
  name: new RegExp(`^${key}\\b`, 'i'),
268
309
  });
@@ -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({
@@ -35,6 +35,12 @@ _8_10_1.test.describe('Hub to connectors runtime CORS @tasklistV2', () => {
35
35
  // A CORS-blocked request fires `requestfailed` and no `response`, so
36
36
  // listen for both to report the block instead of a bare wait timeout.
37
37
  let outcome;
38
+ let inboundRequested = false;
39
+ page.on('request', (req) => {
40
+ if (INBOUND_INSTANCES.test(req.url())) {
41
+ inboundRequested = true;
42
+ }
43
+ });
38
44
  page.on('response', (res) => {
39
45
  if (INBOUND_INSTANCES.test(res.url())) {
40
46
  outcome = { url: res.url(), status: res.status() };
@@ -48,13 +54,28 @@ _8_10_1.test.describe('Hub to connectors runtime CORS @tasklistV2', () => {
48
54
  };
49
55
  }
50
56
  });
51
- await page.goto(`${hubOrigin}/org/${orgId}/cluster/${clusterUuid}/connectors/management`);
52
- await test_1.expect
53
- .poll(() => outcome, {
54
- message: 'inbound-instances request must complete or fail',
55
- timeout: 60000,
56
- })
57
- .toBeDefined();
57
+ // Hub only issues inbound-instances once it has the cluster's
58
+ // connectors URL from Console. When Console's rate limiter rejects that
59
+ // lookup (a 429 without CORS headers), the page renders "Connectors URL
60
+ // not available" and never retries (release run 44501084573), so
61
+ // re-open the page instead of waiting on a request that cannot come.
62
+ // Any inbound-instances outcome, success or failure, ends the loop and
63
+ // is asserted below unchanged.
64
+ const managementUrl = `${hubOrigin}/org/${orgId}/cluster/${clusterUuid}/connectors/management`;
65
+ await (0, test_1.expect)(async () => {
66
+ // Only re-open while Hub has not issued the request at all: an
67
+ // in-flight one would be aborted by the navigation and reported as a
68
+ // false failure.
69
+ if (!inboundRequested) {
70
+ await page.goto(managementUrl);
71
+ }
72
+ await test_1.expect
73
+ .poll(() => outcome, {
74
+ message: 'inbound-instances request must complete or fail',
75
+ timeout: 60000,
76
+ })
77
+ .toBeDefined();
78
+ }).toPass({ intervals: [10000], timeout: 220000 });
58
79
  inboundInstancesUrl = outcome.url;
59
80
  (0, test_1.expect)(outcome.failure, `GET ${inboundInstancesUrl} failed (likely blocked by CORS)`).toBeUndefined();
60
81
  (0, test_1.expect)(outcome.status, `GET ${inboundInstancesUrl} must succeed`).toBeLessThan(300);
@@ -78,6 +99,13 @@ _8_10_1.test.describe('Hub to connectors runtime CORS @tasklistV2', () => {
78
99
  (0, test_1.expect)(listTokens(headers['access-control-allow-headers'])).toContain('authorization');
79
100
  });
80
101
  // Checked last: the console error can arrive after the network event.
81
- (0, test_1.expect)(corsConsoleErrors).toEqual([]);
102
+ // Scoped to the connectors runtime origin this test is about. Console's
103
+ // own endpoints (e.g. console.cloud.../external/events) also report as
104
+ // "blocked by CORS" whenever its rate limiter answers with a 429 that
105
+ // lacks CORS headers (release run 44501084573), which says nothing about
106
+ // whether the runtime allows the Hub origin.
107
+ const runtimeOrigin = new URL(inboundInstancesUrl).origin;
108
+ (0, test_1.expect)(corsConsoleErrors.filter((text) => text.includes(` at '${runtimeOrigin}`) ||
109
+ text.includes(`(redirected from '${runtimeOrigin}`))).toEqual([]);
82
110
  });
83
111
  });
@@ -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.1708",
3
+ "version": "0.0.1710",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",