@camunda/e2e-test-suite 0.0.1634 → 0.0.1636

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>;
@@ -305,7 +305,7 @@ class ConsoleOrganizationPage {
305
305
  await alphaFeatureOptInButton.click({ timeout: 90000 });
306
306
  await (0, test_1.expect)(this.dialog.first()).toBeVisible({ timeout: 60000 });
307
307
  await this.scrollToOptInCheckbox();
308
- await this.optInAICheckbox.check({ timeout: 90000 });
308
+ await this.acceptTerms(this.optInAICheckbox);
309
309
  await this.closeTermsDialog();
310
310
  }
311
311
  }
@@ -326,14 +326,33 @@ class ConsoleOrganizationPage {
326
326
  await toggle.click();
327
327
  await (0, test_1.expect)(toggle).toBeChecked({ timeout: 60000 });
328
328
  }
329
+ // Ticking the terms checkbox records the acceptance with PactSafe
330
+ // (POST pactsafe.io/send). Closing the dialog or reloading the page before
331
+ // that request completes aborts it, so the opt-in is silently lost and the
332
+ // Opt-in button never goes away. Wait for the acceptance to be recorded.
333
+ async acceptTerms(checkbox) {
334
+ await Promise.all([
335
+ this.page.waitForResponse((response) => response.url().includes('pactsafe.io/send') &&
336
+ response.request().method() === 'POST' &&
337
+ response.ok(), { timeout: 60000 }),
338
+ checkbox.check({ timeout: 90000 }),
339
+ ]);
340
+ }
329
341
  async closeTermsDialog() {
330
- const closeButton = this.dialog
331
- .first()
332
- .getByRole('button', { name: 'Close' });
333
- if (await closeButton.isVisible({ timeout: 10000 }).catch(() => false)) {
334
- await closeButton.click();
342
+ const dialog = this.dialog.first();
343
+ // Console closes the terms dialog itself once the acceptance is recorded;
344
+ // only fall back to the Close button if it stays open.
345
+ const closedByItself = await dialog
346
+ .waitFor({ state: 'hidden', timeout: 30000 })
347
+ .then(() => true)
348
+ .catch(() => false);
349
+ if (!closedByItself) {
350
+ const closeButton = dialog.getByRole('button', { name: 'Close' });
351
+ if (await closeButton.isVisible()) {
352
+ await closeButton.click();
353
+ }
335
354
  }
336
- await (0, test_1.expect)(this.dialog.first()).toBeHidden({ timeout: 60000 });
355
+ await (0, test_1.expect)(dialog).toBeHidden({ timeout: 60000 });
337
356
  }
338
357
  async scrollToOptInCheckbox() {
339
358
  const dialog = this.dialog.first();
@@ -395,14 +414,34 @@ class ConsoleOrganizationPage {
395
414
  if (!(await this.optInButton.isVisible({ timeout: 30000 }).catch(() => false))) {
396
415
  return;
397
416
  }
398
- await this.clickOptInButton();
399
- await (0, test_1.expect)(this.dialog.first()).toBeVisible({ timeout: 60000 });
417
+ // The Opt-in click can land before the button's handler is ready, in
418
+ // which case no terms dialog opens; retry the click until it does.
419
+ await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.dialog.first(), {
420
+ visibilityTimeout: 30000,
421
+ totalTimeout: 180000,
422
+ maxRetries: 3,
423
+ preAction: async () => {
424
+ if (!(await this.dialog.first().isVisible())) {
425
+ await this.clickOptInButton();
426
+ }
427
+ },
428
+ postAction: async () => {
429
+ await this.page.reload();
430
+ await this.clickSettingsTab();
431
+ },
432
+ });
400
433
  await this.scrollToOptInCheckbox();
401
- await this.optInCheckbox.check({ timeout: 90000 });
434
+ await this.acceptTerms(this.optInCheckbox);
402
435
  await this.closeTermsDialog();
403
- await this.page.reload();
404
- await this.clickSettingsTab();
405
- await (0, test_1.expect)(this.optInButton).not.toBeVisible({ timeout: 60000 });
436
+ // Reload, settings-table readiness and button absence are retried
437
+ // together, so a Settings page that failed to load can never count as
438
+ // "Opt-in button gone".
439
+ await (0, test_1.expect)(async () => {
440
+ await this.page.reload();
441
+ await this.clickSettingsTab();
442
+ await (0, test_1.expect)(this.rows.first()).toBeVisible({ timeout: 60000 });
443
+ await (0, test_1.expect)(this.optInButton).toBeHidden({ timeout: 60000 });
444
+ }).toPass({ timeout: 180000 });
406
445
  }
407
446
  async clickGroupsTab() {
408
447
  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.1634",
3
+ "version": "0.0.1636",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",