@camunda/e2e-test-suite 0.0.1689 → 0.0.1691

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.
@@ -58,6 +58,7 @@ declare class ConsoleOrganizationPage {
58
58
  clickSettingsTab(): Promise<void>;
59
59
  clickOptInButton(): Promise<void>;
60
60
  enableAlphaFeature(name: string): Promise<void>;
61
+ acceptTerms(checkbox: Locator): Promise<void>;
61
62
  closeTermsDialog(): Promise<void>;
62
63
  scrollToOptInCheckbox(): Promise<void>;
63
64
  checkOptInCheckbox(): Promise<void>;
@@ -319,7 +319,7 @@ class ConsoleOrganizationPage {
319
319
  await alphaFeatureOptInButton.click({ timeout: 90000 });
320
320
  await (0, test_1.expect)(this.dialog.first()).toBeVisible({ timeout: 60000 });
321
321
  await this.scrollToOptInCheckbox();
322
- await this.optInAICheckbox.check({ timeout: 90000 });
322
+ await this.acceptTerms(this.optInAICheckbox);
323
323
  await this.closeTermsDialog();
324
324
  }
325
325
  }
@@ -340,14 +340,33 @@ class ConsoleOrganizationPage {
340
340
  await toggle.click();
341
341
  await (0, test_1.expect)(toggle).toBeChecked({ timeout: 60000 });
342
342
  }
343
+ // Ticking the terms checkbox records the acceptance with PactSafe
344
+ // (POST pactsafe.io/send). Closing the dialog or reloading the page before
345
+ // that request completes aborts it, so the opt-in is silently lost and the
346
+ // Opt-in button never goes away. Wait for the acceptance to be recorded.
347
+ async acceptTerms(checkbox) {
348
+ await Promise.all([
349
+ this.page.waitForResponse((response) => response.url().includes('pactsafe.io/send') &&
350
+ response.request().method() === 'POST' &&
351
+ response.ok(), { timeout: 60000 }),
352
+ checkbox.check({ timeout: 90000 }),
353
+ ]);
354
+ }
343
355
  async closeTermsDialog() {
344
- const closeButton = this.dialog
345
- .first()
346
- .getByRole('button', { name: 'Close' });
347
- if (await closeButton.isVisible({ timeout: 10000 }).catch(() => false)) {
348
- await closeButton.click();
356
+ const dialog = this.dialog.first();
357
+ // Console closes the terms dialog itself once the acceptance is recorded;
358
+ // only fall back to the Close button if it stays open.
359
+ const closedByItself = await dialog
360
+ .waitFor({ state: 'hidden', timeout: 30000 })
361
+ .then(() => true)
362
+ .catch(() => false);
363
+ if (!closedByItself) {
364
+ const closeButton = dialog.getByRole('button', { name: 'Close' });
365
+ if (await closeButton.isVisible()) {
366
+ await closeButton.click();
367
+ }
349
368
  }
350
- await (0, test_1.expect)(this.dialog.first()).toBeHidden({ timeout: 60000 });
369
+ await (0, test_1.expect)(dialog).toBeHidden({ timeout: 60000 });
351
370
  }
352
371
  async scrollToOptInCheckbox() {
353
372
  const dialog = this.dialog.first();
@@ -409,14 +428,34 @@ class ConsoleOrganizationPage {
409
428
  if (!(await this.optInButton.isVisible({ timeout: 30000 }).catch(() => false))) {
410
429
  return;
411
430
  }
412
- await this.clickOptInButton();
413
- await (0, test_1.expect)(this.dialog.first()).toBeVisible({ timeout: 60000 });
431
+ // The Opt-in click can land before the button's handler is ready, in
432
+ // which case no terms dialog opens; retry the click until it does.
433
+ await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.dialog.first(), {
434
+ visibilityTimeout: 30000,
435
+ totalTimeout: 180000,
436
+ maxRetries: 3,
437
+ preAction: async () => {
438
+ if (!(await this.dialog.first().isVisible())) {
439
+ await this.clickOptInButton();
440
+ }
441
+ },
442
+ postAction: async () => {
443
+ await this.page.reload();
444
+ await this.clickSettingsTab();
445
+ },
446
+ });
414
447
  await this.scrollToOptInCheckbox();
415
- await this.optInCheckbox.check({ timeout: 90000 });
448
+ await this.acceptTerms(this.optInCheckbox);
416
449
  await this.closeTermsDialog();
417
- await this.page.reload();
418
- await this.clickSettingsTab();
419
- await (0, test_1.expect)(this.optInButton).not.toBeVisible({ timeout: 60000 });
450
+ // Reload, settings-table readiness and button absence are retried
451
+ // together, so a Settings page that failed to load can never count as
452
+ // "Opt-in button gone".
453
+ await (0, test_1.expect)(async () => {
454
+ await this.page.reload();
455
+ await this.clickSettingsTab();
456
+ await (0, test_1.expect)(this.rows.first()).toBeVisible({ timeout: 60000 });
457
+ await (0, test_1.expect)(this.optInButton).toBeHidden({ timeout: 60000 });
458
+ }).toPass({ timeout: 180000 });
420
459
  }
421
460
  async clickGroupsTab() {
422
461
  await this.groupsTab.click({ timeout: 60000 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1689",
3
+ "version": "0.0.1691",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",