@camunda/e2e-test-suite 0.0.1810 → 0.0.1812

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.
@@ -159,7 +159,30 @@ class OCIdentityRolesPage {
159
159
  await this.assignUserButton.click({ timeout: 60000 });
160
160
  await (0, test_1.expect)(this.assignUserModal).toBeVisible({ timeout: 30000 });
161
161
  await this.assignUserModalInputField.fill(email);
162
- await this.assignUserModalAssignButton.click({ timeout: 30000 });
162
+ // Same asynchronous authorizations-disable race as createRole: the PUT is
163
+ // rejected with a 403 until it lands, so resubmit only on that 403.
164
+ let submitError;
165
+ await (0, test_1.expect)(async () => {
166
+ if (submitError || !(await this.assignUserModal.isVisible())) {
167
+ return;
168
+ }
169
+ let response;
170
+ try {
171
+ [response] = await Promise.all([
172
+ this.page.waitForResponse((r) => r.request().method() === 'PUT' &&
173
+ new URL(r.url()).pathname.includes(`/v2/roles/${roleId}/users/`), { timeout: 30000 }),
174
+ this.assignUserModalAssignButton.click({ timeout: 30000 }),
175
+ ]);
176
+ }
177
+ catch (error) {
178
+ submitError = error;
179
+ return;
180
+ }
181
+ (0, test_1.expect)(response.status(), 'PUT /v2/roles/.../users status').not.toBe(403);
182
+ }).toPass({ timeout: 300000, intervals: [10000, 15000, 30000] });
183
+ if (submitError) {
184
+ throw submitError;
185
+ }
163
186
  await (0, test_1.expect)(this.assignUserModal).not.toBeVisible({ timeout: 30000 });
164
187
  }
165
188
  async createRole(role) {
@@ -253,7 +276,7 @@ class OCIdentityRolesPage {
253
276
  await locator.click();
254
277
  await (0, test_1.expect)(this.deleteRoleModal).toBeVisible();
255
278
  await this.deleteRoleModalDeleteButton.click();
256
- await (0, test_1.expect)(this.deleteRoleModal).not.toBeVisible();
279
+ await (0, test_1.expect)(this.deleteRoleModal).not.toBeVisible({ timeout: 30000 });
257
280
  await (0, expectLocatorWithPagination_1.expectLocatorWithPagination)(this.page, locator, {
258
281
  shouldBeVisible: false,
259
282
  });
@@ -67,8 +67,10 @@ declare class ConsoleOrganizationPage {
67
67
  clickSettingsTab(): Promise<void>;
68
68
  clickOptInButton(): Promise<void>;
69
69
  enableAlphaFeature(name: string): Promise<void>;
70
+ acceptTerms(checkbox: Locator): Promise<void>;
70
71
  closeTermsDialog(): Promise<void>;
71
- scrollToOptInCheckbox(): Promise<void>;
72
+ scrollToOptInCheckbox(checkbox: Locator): Promise<void>;
73
+ private scrollTermsDialogToBottom;
72
74
  checkOptInCheckbox(): Promise<void>;
73
75
  clickMainUser(email: string): Promise<void>;
74
76
  clickAuthorizations(): Promise<void>;
@@ -391,8 +391,8 @@ class ConsoleOrganizationPage {
391
391
  if (await alphaFeatureOptInButton.isEnabled()) {
392
392
  await alphaFeatureOptInButton.click({ timeout: 90000 });
393
393
  await (0, test_1.expect)(this.dialog.first()).toBeVisible({ timeout: 60000 });
394
- await this.scrollToOptInCheckbox();
395
- await this.optInAICheckbox.check({ timeout: 90000 });
394
+ await this.scrollToOptInCheckbox(this.optInAICheckbox);
395
+ await this.acceptTerms(this.optInAICheckbox);
396
396
  await this.closeTermsDialog();
397
397
  }
398
398
  }
@@ -413,18 +413,50 @@ class ConsoleOrganizationPage {
413
413
  await toggle.click();
414
414
  await (0, test_1.expect)(toggle).toBeChecked({ timeout: 60000 });
415
415
  }
416
+ // Closing the dialog before PactSafe's POST /send completes aborts it and
417
+ // the opt-in is silently lost, so wait for the acceptance to be recorded.
418
+ async acceptTerms(checkbox) {
419
+ await Promise.all([
420
+ this.page.waitForResponse((response) => response.url().includes('pactsafe.io/send') &&
421
+ response.request().method() === 'POST' &&
422
+ response.ok(), { timeout: 60000 }),
423
+ checkbox.check({ timeout: 90000 }),
424
+ ]);
425
+ }
416
426
  async closeTermsDialog() {
417
- const closeButton = this.dialog
427
+ // Console closes the dialog itself once the acceptance is recorded.
428
+ const autoClosed = await this.dialog
418
429
  .first()
419
- .getByRole('button', { name: 'Close' });
420
- if (await closeButton.isVisible({ timeout: 10000 }).catch(() => false)) {
421
- await closeButton.click();
430
+ .waitFor({ state: 'hidden', timeout: 30000 })
431
+ .then(() => true)
432
+ .catch(() => false);
433
+ if (!autoClosed) {
434
+ const closeButton = this.dialog
435
+ .first()
436
+ .getByRole('button', { name: 'Close' });
437
+ if (await closeButton.isVisible({ timeout: 10000 }).catch(() => false)) {
438
+ await closeButton.click();
439
+ }
422
440
  }
423
441
  await (0, test_1.expect)(this.dialog.first()).toBeHidden({ timeout: 60000 });
424
442
  }
425
- async scrollToOptInCheckbox() {
443
+ async scrollToOptInCheckbox(checkbox) {
426
444
  const dialog = this.dialog.first();
427
445
  await (0, test_1.expect)(dialog).toBeVisible({ timeout: 30000 });
446
+ // The PactSafe contract loads after the dialog opens and only renders the
447
+ // checkbox once scrolled to the bottom, so scroll until the checkbox shows.
448
+ for (let attempt = 0; attempt < 12; attempt++) {
449
+ await this.scrollTermsDialogToBottom(dialog);
450
+ const checkboxVisible = await checkbox
451
+ .waitFor({ state: 'visible', timeout: 5000 })
452
+ .then(() => true)
453
+ .catch(() => false);
454
+ if (checkboxVisible) {
455
+ return;
456
+ }
457
+ }
458
+ }
459
+ async scrollTermsDialogToBottom(dialog) {
428
460
  const contractScroll = this.page.locator('.ps-contract-scroll').first();
429
461
  if (await contractScroll.isVisible({ timeout: 5000 }).catch(() => false)) {
430
462
  await contractScroll.evaluate((el) => {
@@ -547,8 +579,8 @@ class ConsoleOrganizationPage {
547
579
  }
548
580
  await this.clickOptInButton();
549
581
  await (0, test_1.expect)(this.dialog.first()).toBeVisible({ timeout: 60000 });
550
- await this.scrollToOptInCheckbox();
551
- await this.optInCheckbox.check({ timeout: 90000 });
582
+ await this.scrollToOptInCheckbox(this.optInCheckbox);
583
+ await this.acceptTerms(this.optInCheckbox);
552
584
  await this.closeTermsDialog();
553
585
  await this.page.reload();
554
586
  await this.clickSettingsTab();
@@ -821,27 +821,36 @@ class ClusterDetailsPage {
821
821
  async createAPIClient(name) {
822
822
  const maxAttempts = 3;
823
823
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
824
- await this.clickCreateClientButton();
825
- await (0, test_1.expect)(this.createClientCredentialsDialog).toBeVisible({
826
- timeout: 30000,
827
- });
828
- await this.fillAPIClientName(name);
829
- await this.checkOrchestrationClusterCheckbox();
830
- await this.checkOptimizeCheckbox();
831
- await this.checkSecretsCheckbox();
832
- await this.clickCreateButton();
833
- // The credentials dialog only renders once POST .../clients resolves, and
834
- // that call can take well over 20s on a freshly created cluster. When the
835
- // Console API rejects the call instead, the credentials dialog never
836
- // arrives and the create dialog stays open on its error banner, so close
837
- // it and retry the create from a clean state rather than leaving the page
838
- // wedged behind a modal nobody dismissed.
839
- const created = await this.clientCredentialsDialog
840
- .waitFor({ state: 'visible', timeout: 60000 })
841
- .then(() => true)
842
- .catch(() => false);
843
- if (created) {
844
- break;
824
+ try {
825
+ await this.clickCreateClientButton();
826
+ await (0, test_1.expect)(this.createClientCredentialsDialog).toBeVisible({
827
+ timeout: 30000,
828
+ });
829
+ await this.fillAPIClientName(name);
830
+ await this.checkOrchestrationClusterCheckbox();
831
+ await this.checkOptimizeCheckbox();
832
+ await this.checkSecretsCheckbox();
833
+ await this.clickCreateButton();
834
+ // The credentials dialog only renders once POST .../clients resolves, and
835
+ // that call can take well over 20s on a freshly created cluster. When the
836
+ // Console API rejects the call instead, the credentials dialog never
837
+ // arrives and the create dialog stays open on its error banner, so close
838
+ // it and retry the create from a clean state rather than leaving the page
839
+ // wedged behind a modal nobody dismissed.
840
+ const created = await this.clientCredentialsDialog
841
+ .waitFor({ state: 'visible', timeout: 60000 })
842
+ .then(() => true)
843
+ .catch(() => false);
844
+ if (created) {
845
+ break;
846
+ }
847
+ }
848
+ catch (error) {
849
+ // Console's error boundary can replace the create form mid-create, so
850
+ // the Client Name field never renders; retry from a clean panel.
851
+ if (attempt === maxAttempts) {
852
+ throw error;
853
+ }
845
854
  }
846
855
  await this.dismissCreateClientDialogIfPresent();
847
856
  if (attempt === maxAttempts) {
@@ -876,7 +876,19 @@ class ModelerHomePage {
876
876
  // The empty state's own button avoids the Radix dropdown, whose option can
877
877
  // stay "not stable" for the whole click timeout.
878
878
  if (await switchButton.isVisible().catch(() => false)) {
879
- await switchButton.click({ timeout: 10000 });
879
+ // The empty state flashes while the workspace list is still loading; if
880
+ // the list then resolves with workspaces under the current scope, the
881
+ // button unmounts on its own -- the same end state as clicking it -- so a
882
+ // click that fails only because it vanished is already success, while one
883
+ // that fails with the button still present is a real error.
884
+ try {
885
+ await switchButton.click({ timeout: 10000 });
886
+ }
887
+ catch (error) {
888
+ if (await switchButton.isVisible().catch(() => false)) {
889
+ throw error;
890
+ }
891
+ }
880
892
  await (0, test_1.expect)(switchButton).toBeHidden({ timeout: 10000 });
881
893
  return;
882
894
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1810",
3
+ "version": "0.0.1812",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",