@camunda/e2e-test-suite 0.0.1506 → 0.0.1508

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.
@@ -57,6 +57,7 @@ declare class ConsoleOrganizationPage {
57
57
  clickSettingsTab(): Promise<void>;
58
58
  clickOptInButton(): Promise<void>;
59
59
  enableAlphaFeature(name: string): Promise<void>;
60
+ closeTermsDialog(): Promise<void>;
60
61
  scrollToOptInCheckbox(): Promise<void>;
61
62
  checkOptInCheckbox(): Promise<void>;
62
63
  clickMainUser(): Promise<void>;
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConsoleOrganizationPage = void 0;
4
4
  const test_1 = require("@playwright/test");
5
- const sleep_1 = require("../../utils/sleep");
6
5
  const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
7
6
  class ConsoleOrganizationPage {
8
7
  page;
@@ -100,7 +99,10 @@ class ConsoleOrganizationPage {
100
99
  this.startProcessIPermissionCheckbox = page.getByRole('checkbox', {
101
100
  name: 'Start process instance',
102
101
  });
103
- this.optInAICheckbox = page.getByLabel('I understand and agree to Terms for AI Usage');
102
+ // The Terms for AI Usage clickwrap labels its single acceptance checkbox
103
+ // with the whole contract paragraph, so match it by role inside the
104
+ // dialog rather than by a label string that moves with the contract text.
105
+ this.optInAICheckbox = this.dialog.first().getByRole('checkbox').first();
104
106
  this.rows = this.page.getByRole('row');
105
107
  this.groupsTab = page.getByRole('tab', { name: 'Groups' });
106
108
  this.createGroupButton = page.getByRole('button', {
@@ -305,39 +307,54 @@ class ConsoleOrganizationPage {
305
307
  if (await alphaFeatureOptInButton.isVisible({ timeout: 10000 })) {
306
308
  if (await alphaFeatureOptInButton.isEnabled()) {
307
309
  await alphaFeatureOptInButton.click({ timeout: 90000 });
308
- await this.optInAICheckbox.scrollIntoViewIfNeeded();
310
+ // The Terms for AI Usage dialog is a PactSafe clickwrap with
311
+ // force-scroll on: it renders "Please scroll to the bottom to accept"
312
+ // and mounts the acceptance checkbox only once the contract body has
313
+ // been scrolled to its end.
314
+ await (0, test_1.expect)(this.dialog.first()).toBeVisible({ timeout: 60000 });
315
+ await this.scrollToOptInCheckbox();
309
316
  await this.optInAICheckbox.check({ timeout: 90000 });
310
- await (0, sleep_1.sleep)(3000);
317
+ await this.closeTermsDialog();
311
318
  }
312
319
  }
313
320
  //Enable Alpha Feature
314
- const toggleTextLocator = alphaFeature.locator('[class= "cds--toggle__text"]');
315
- await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, toggleTextLocator, {
316
- visibilityTimeout: 15000,
317
- totalTimeout: 90000,
318
- maxRetries: 3,
321
+ const toggle = alphaFeature.getByRole('switch').first();
322
+ // The Status toggle replaces "Opt in to enable" only once the clickwrap
323
+ // acceptance has been persisted and the settings page has re-read the
324
+ // org's early-access features, so this waits on a third party's callback
325
+ // reaching the accounts API, not on local rendering. 45s across 3 tries
326
+ // caught it on one run and missed it on the next; give the round trip a
327
+ // realistic budget instead.
328
+ await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, toggle, {
329
+ visibilityTimeout: 30000,
330
+ totalTimeout: 180000,
331
+ maxRetries: 5,
319
332
  postAction: async () => {
320
333
  await this.page.reload();
321
334
  await this.clickSettingsTab();
322
335
  },
323
336
  });
324
- const toggleText = await toggleTextLocator.textContent();
325
- console.info(`Previous feature(${name}) setting is ${toggleText}.`);
326
- if (toggleText == 'Enabled') {
337
+ if (await toggle.isChecked()) {
327
338
  console.log(`Feature ${name} is already enabled.`);
328
339
  return;
329
340
  }
330
- if (toggleText == 'Disabled') {
331
- await alphaFeature
332
- .locator('[class= "cds--toggle__switch"]')
333
- .first()
334
- .click();
335
- await (0, sleep_1.sleep)(10000);
341
+ await toggle.click();
342
+ await (0, test_1.expect)(toggle).toBeChecked({ timeout: 60000 });
343
+ }
344
+ async closeTermsDialog() {
345
+ const closeButton = this.dialog
346
+ .first()
347
+ .getByRole('button', { name: 'Close' });
348
+ if (await closeButton.isVisible({ timeout: 10000 }).catch(() => false)) {
349
+ await closeButton.click();
336
350
  }
337
- await (0, test_1.expect)(alphaFeature.locator('[class= "cds--toggle__text"]')).toHaveText('Enabled');
351
+ await (0, test_1.expect)(this.dialog.first()).toBeHidden({ timeout: 60000 });
338
352
  }
339
353
  async scrollToOptInCheckbox() {
340
- await this.page.locator('.ps-contract-scroll').evaluate((el) => {
354
+ await this.page
355
+ .locator('.ps-contract-scroll')
356
+ .first()
357
+ .evaluate((el) => {
341
358
  el.scrollTop = el.scrollHeight;
342
359
  });
343
360
  }
@@ -307,8 +307,17 @@ class ModelerCreatePage {
307
307
  this.processIdInput = page.getByLabel('ID', { exact: true });
308
308
  this.payloadNameInput = page.getByLabel('Full Name');
309
309
  this.payloadDateInput = page.getByLabel('Date of Birth');
310
- this.payloadCheckboxInput = this.form.getByLabel('Agree');
311
- this.payloadNumberInput = this.form.getByLabel('Count');
310
+ // Scoped to the deploy/run dialog and matched by role, not through the
311
+ // exact-class form container: the start form renders inside the dialog
312
+ // and `[class="fjs-container"]` only matches when that element carries
313
+ // no other class, so an extra class on the form root silently empties
314
+ // every locator built on it.
315
+ this.payloadCheckboxInput = this.dialog
316
+ .first()
317
+ .getByRole('checkbox', { name: 'Agree' });
318
+ this.payloadNumberInput = this.dialog
319
+ .first()
320
+ .getByRole('textbox', { name: 'Count' });
312
321
  this.formPropertySection = page.locator('[data-group-id="group-form"]');
313
322
  this.formLinkingTypeDropdown = page.getByLabel('Type');
314
323
  this.formLinkTypeOptions = page.locator('#bio-properties-panel-formType');
@@ -18,8 +18,7 @@ _8_8_1.test.describe('Cluster Setup Tests', () => {
18
18
  await (0, _setup_1.captureScreenshot)(page, testInfo);
19
19
  await (0, _setup_1.captureFailureVideo)(page, testInfo);
20
20
  });
21
- // Skipped due to bug #29346: https://github.com/camunda/camunda-hub/issues/29346
22
- _8_8_1.test.skip('Enable Alpha Features', async ({ page, loginPage, consoleOrganizationsPage, homePage, }, testInfo) => {
21
+ (0, _8_8_1.test)('Enable Alpha Features', async ({ page, loginPage, consoleOrganizationsPage, homePage, }, testInfo) => {
23
22
  _8_8_1.test.skip(process.env.IS_PROD === 'true', 'Skipping test because not required on PROD test org');
24
23
  _8_8_1.test.skip(process.env.IS_AG === 'true', 'Skipping test because not required when IS_AG is true');
25
24
  await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, users_1.testUsers.mainUser, (testInfo.workerIndex + 1) * 1000);
@@ -31,9 +31,8 @@ _8_8_1.test.describe('Web Modeler User Flow Tests', () => {
31
31
  await (0, mailSlurpClient_1.deleteInbox)(inboxes[testInfo.title]);
32
32
  }
33
33
  });
34
- // Skipped due to bug #29346: https://github.com/camunda/camunda-hub/issues/29346
35
34
  // Also tracked in https://github.com/camunda/product-hub/issues/3655
36
- _8_8_1.test.skip('Form.js Integration with User Task and AI Generated Form @ai-external', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, formJsPage, }) => {
35
+ (0, _8_8_1.test)('Form.js Integration with User Task and AI Generated Form @ai-external', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, formJsPage, }) => {
37
36
  _8_8_1.test.slow();
38
37
  const randomString = await (0, _setup_1.generateRandomStringAsync)(3);
39
38
  const processName = 'User_Task_Process_With_AI_Form' + randomString;
@@ -90,9 +89,8 @@ _8_8_1.test.describe('Web Modeler User Flow Tests', () => {
90
89
  await operateTabTaskDetailsPage.clickCompleteTaskButton();
91
90
  });
92
91
  });
93
- // Skipped due to bug #29346: https://github.com/camunda/camunda-hub/issues/29346
94
92
  // Also tracked in https://github.com/camunda/product-hub/issues/3655
95
- _8_8_1.test.skip('Form.js Integration with AI generated Start form @ai-external', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, formJsPage, }) => {
93
+ (0, _8_8_1.test)('Form.js Integration with AI generated Start form @ai-external', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, formJsPage, }) => {
96
94
  _8_8_1.test.slow();
97
95
  const randomString = await (0, _setup_1.generateRandomStringAsync)(3);
98
96
  const processName = 'AI-generated-Start-form' + randomString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1506",
3
+ "version": "0.0.1508",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",