@camunda/e2e-test-suite 0.0.1598 → 0.0.1599

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
+ closeTermsDialog(): Promise<void>;
61
62
  scrollToOptInCheckbox(): Promise<void>;
62
63
  checkOptInCheckbox(): Promise<void>;
63
64
  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;
@@ -86,7 +85,7 @@ class ConsoleOrganizationPage {
86
85
  this.startProcessIPermissionCheckbox = page.getByRole('checkbox', {
87
86
  name: 'Start process instance',
88
87
  });
89
- this.optInAICheckbox = page.getByLabel('I understand and agree to Terms for AI Usage');
88
+ this.optInAICheckbox = this.dialog.first().getByRole('checkbox');
90
89
  this.rows = this.page.getByRole('row');
91
90
  this.groupsTab = page.getByRole('tab', { name: 'Groups' });
92
91
  this.createGroupButton = page.getByRole('button', {
@@ -283,70 +282,85 @@ class ConsoleOrganizationPage {
283
282
  await this.optInButton.click({ timeout: 60000 });
284
283
  }
285
284
  async enableAlphaFeature(name) {
286
- const maxRetries = 3;
287
- for (let retries = 0; retries < maxRetries; retries++) {
288
- try {
289
- await this.clickSettingsTab();
290
- await this.optInToAlphaFeatures();
291
- await (0, sleep_1.sleep)(30000);
285
+ await this.clickSettingsTab();
286
+ await this.optInToAlphaFeatures();
287
+ await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.rows.first(), {
288
+ visibilityTimeout: 60000,
289
+ totalTimeout: 300000,
290
+ maxRetries: 5,
291
+ postAction: async () => {
292
292
  await this.page.reload();
293
293
  await this.clickSettingsTab();
294
- await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.rows.first(), {
295
- visibilityTimeout: 15000,
296
- totalTimeout: 90000,
297
- postAction: async () => {
298
- await this.page.reload();
299
- },
300
- });
301
- const alphaFeature = this.rows.filter({ hasText: name }).first();
302
- if ((await alphaFeature.count()) < 1) {
303
- // Returning here used to report the feature as enabled while nothing
304
- // had been enabled at all, so the org silently stayed opted out and
305
- // every dependent spec failed later on a missing UI affordance.
306
- // Throw instead: the surrounding loop reloads and retries, and a
307
- // genuinely absent row fails this step where the cause is visible.
308
- throw new Error(`No alpha feature(${name}) is found.`);
309
- }
310
- //Opt-in The Alpha Feature
311
- const alphaFeatureOptInButton = alphaFeature.getByRole('button', {
312
- name: 'Opt in to enable',
313
- });
314
- if (await alphaFeatureOptInButton.isVisible({ timeout: 10000 })) {
315
- await alphaFeatureOptInButton.click({ timeout: 30000 });
316
- await this.optInAICheckbox.scrollIntoViewIfNeeded();
317
- await this.optInAICheckbox.check({ timeout: 30000 });
318
- await (0, sleep_1.sleep)(3000);
319
- }
320
- //Enable Alpha Feature
321
- const toggleText = await alphaFeature
322
- .locator('[class= "cds--toggle__text"]')
323
- .textContent();
324
- console.info(`Previous feature(${name}) setting is ${toggleText}.`);
325
- if (toggleText == 'Enabled') {
326
- console.log(`Feature ${name} is already enabled.`);
327
- return;
328
- }
329
- if (toggleText == 'Disabled') {
330
- await alphaFeature
331
- .locator('[class= "cds--toggle__switch"]')
332
- .first()
333
- .click();
334
- await (0, sleep_1.sleep)(10000);
335
- }
336
- await (0, test_1.expect)(alphaFeature.locator('[class= "cds--toggle__text"]')).toHaveText('Enabled');
337
- return;
294
+ },
295
+ });
296
+ const alphaFeature = this.rows.filter({ hasText: name }).first();
297
+ if ((await alphaFeature.count()) < 1) {
298
+ throw new Error(`No alpha feature(${name}) is found.`);
299
+ }
300
+ const alphaFeatureOptInButton = alphaFeature.getByRole('button', {
301
+ name: 'Opt in to enable',
302
+ });
303
+ if (await alphaFeatureOptInButton.isVisible({ timeout: 10000 })) {
304
+ if (await alphaFeatureOptInButton.isEnabled()) {
305
+ await alphaFeatureOptInButton.click({ timeout: 90000 });
306
+ await (0, test_1.expect)(this.dialog.first()).toBeVisible({ timeout: 60000 });
307
+ await this.scrollToOptInCheckbox();
308
+ await this.optInAICheckbox.check({ timeout: 90000 });
309
+ await this.closeTermsDialog();
338
310
  }
339
- catch (error) {
340
- console.error(`Click attempt ${retries + 1} failed: ${error}`);
311
+ }
312
+ const toggle = alphaFeature.getByRole('switch').first();
313
+ await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, toggle, {
314
+ visibilityTimeout: 30000,
315
+ totalTimeout: 180000,
316
+ maxRetries: 5,
317
+ postAction: async () => {
341
318
  await this.page.reload();
342
- await (0, sleep_1.sleep)(10000);
343
- }
319
+ await this.clickSettingsTab();
320
+ },
321
+ });
322
+ if (await toggle.isChecked()) {
323
+ console.log(`Feature ${name} is already enabled.`);
324
+ return;
344
325
  }
345
- throw new Error(`Failed to eanble alpha feature ${name} after ${maxRetries} attempts.`);
326
+ await toggle.click();
327
+ await (0, test_1.expect)(toggle).toBeChecked({ timeout: 60000 });
328
+ }
329
+ 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();
335
+ }
336
+ await (0, test_1.expect)(this.dialog.first()).toBeHidden({ timeout: 60000 });
346
337
  }
347
338
  async scrollToOptInCheckbox() {
348
- await this.page.locator('.ps-contract-scroll').evaluate((el) => {
349
- el.scrollTop = el.scrollHeight;
339
+ const dialog = this.dialog.first();
340
+ await (0, test_1.expect)(dialog).toBeVisible({ timeout: 30000 });
341
+ const contractScroll = this.page.locator('.ps-contract-scroll').first();
342
+ if (await contractScroll.isVisible({ timeout: 5000 }).catch(() => false)) {
343
+ await contractScroll.evaluate((el) => {
344
+ el.scrollTop = el.scrollHeight;
345
+ el.dispatchEvent(new Event('scroll', { bubbles: true }));
346
+ });
347
+ return;
348
+ }
349
+ const box = await dialog.boundingBox();
350
+ if (box) {
351
+ await this.page.mouse.move(box.x + box.width / 2, box.y + box.height * 0.6);
352
+ for (let i = 0; i < 20; i++) {
353
+ await this.page.mouse.wheel(0, 300);
354
+ }
355
+ }
356
+ await dialog.evaluate((dlg) => {
357
+ const all = [dlg, ...Array.from(dlg.querySelectorAll('*'))];
358
+ for (const node of all) {
359
+ if (!(node instanceof HTMLElement))
360
+ continue;
361
+ node.scrollTop = node.scrollHeight;
362
+ node.dispatchEvent(new Event('scroll', { bubbles: true }));
363
+ }
350
364
  });
351
365
  }
352
366
  async checkOptInCheckbox() {
@@ -378,15 +392,17 @@ class ConsoleOrganizationPage {
378
392
  await this.page.reload();
379
393
  },
380
394
  });
381
- try {
382
- await (0, test_1.expect)(this.optInButton).toBeVisible({ timeout: 30000 });
383
- await this.clickOptInButton();
384
- await this.scrollToOptInCheckbox();
385
- await this.checkOptInCheckbox();
386
- }
387
- catch {
388
- await (0, test_1.expect)(this.optInButton).not.toBeVisible();
395
+ if (!(await this.optInButton.isVisible({ timeout: 30000 }).catch(() => false))) {
396
+ return;
389
397
  }
398
+ await this.clickOptInButton();
399
+ await (0, test_1.expect)(this.dialog.first()).toBeVisible({ timeout: 60000 });
400
+ await this.scrollToOptInCheckbox();
401
+ await this.optInCheckbox.check({ timeout: 90000 });
402
+ await this.closeTermsDialog();
403
+ await this.page.reload();
404
+ await this.clickSettingsTab();
405
+ await (0, test_1.expect)(this.optInButton).not.toBeVisible({ timeout: 60000 });
390
406
  }
391
407
  async clickGroupsTab() {
392
408
  await this.groupsTab.click({ timeout: 60000 });
@@ -302,8 +302,17 @@ class ModelerCreatePage {
302
302
  this.processIdInput = page.getByLabel('ID', { exact: true });
303
303
  this.payloadNameInput = page.getByLabel('Full Name');
304
304
  this.payloadDateInput = page.getByLabel('Date of Birth');
305
- this.payloadCheckboxInput = this.form.getByLabel('Agree');
306
- this.payloadNumberInput = this.form.getByLabel('Count');
305
+ // Scoped to the deploy/run dialog and matched by role, not through the
306
+ // exact-class form container: the start form renders inside the dialog
307
+ // and `[class="fjs-container"]` only matches when that element carries
308
+ // no other class, so an extra class on the form root silently empties
309
+ // every locator built on it.
310
+ this.payloadCheckboxInput = this.dialog
311
+ .first()
312
+ .getByRole('checkbox', { name: 'Agree' });
313
+ this.payloadNumberInput = this.dialog
314
+ .first()
315
+ .getByRole('textbox', { name: 'Count' });
307
316
  this.formPropertySection = page.locator('[data-group-id="group-form"]');
308
317
  this.formLinkingTypeDropdown = page.getByLabel('Type');
309
318
  this.formLinkTypeOptions = page.locator('#bio-properties-panel-formType');
@@ -18,8 +18,7 @@ _8_11_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_11_1.test.skip('Enable Alpha Features', async ({ page, loginPage, consoleOrganizationsPage, homePage, }, testInfo) => {
21
+ (0, _8_11_1.test)('Enable Alpha Features', async ({ page, loginPage, consoleOrganizationsPage, homePage, }, testInfo) => {
23
22
  _8_11_1.test.skip(process.env.IS_PROD === 'true', 'Skipping test because not required on PROD test org');
24
23
  _8_11_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);
@@ -35,8 +35,7 @@ _8_11_1.test.describe('Web Modeler User Flow Tests', () => {
35
35
  await (0, mailSlurpClient_1.deleteInbox)(inboxes[testInfo.title]);
36
36
  }
37
37
  });
38
- // Skipped due to bug #29346: https://github.com/camunda/camunda-hub/issues/29346
39
- _8_11_1.test.skip('Form.js Integration with User Task and AI Generated Form @ai-external', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, formJsPage, consoleOrganizationsPage, loginPage, }, testInfo) => {
38
+ (0, _8_11_1.test)('Form.js Integration with User Task and AI Generated Form @ai-external', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, formJsPage, consoleOrganizationsPage, loginPage, }, testInfo) => {
40
39
  _8_11_1.test.slow();
41
40
  const randomString = await (0, _setup_1.generateRandomStringAsync)(3);
42
41
  const processName = 'User_Task_Process_With_AI_Form' + randomString;
@@ -75,7 +74,7 @@ _8_11_1.test.describe('Web Modeler User Flow Tests', () => {
75
74
  // identity-provider page, and if so signs back in before trying once
76
75
  // more (run 35562939552, "Camunda Modeler" banner absent 90s after 3
77
76
  // such retries).
78
- await (0, UtilitiesPage_1.withSessionRecovery)(page, loginPage, appsPage, modelerHomePage.modelerPageBanner, testUser, (testInfo.workerIndex + 1) * 1000, () => appsPage.openModelerWithRetry(modelerHomePage.modelerPageBanner, 90000, 3, modelerHomePage.createNewProjectButton));
77
+ await (0, UtilitiesPage_1.withSessionRecovery)(page, loginPage, appsPage, modelerHomePage.modelerPageBanner, testUser, (testInfo.workerIndex + 1) * 1000, () => appsPage.openModelerWithRetry(modelerHomePage.modelerPageBanner, 90000, 3, modelerHomePage.createNewProjectButton.or(modelerHomePage.createWorkspaceButton)));
79
78
  });
80
79
  await _8_11_1.test.step('Open Cross Component Test Project', async () => {
81
80
  await modelerHomePage.clickCrossComponentProjectFolder();
@@ -141,8 +140,7 @@ _8_11_1.test.describe('Web Modeler User Flow Tests', () => {
141
140
  await operateTabTaskDetailsPage.clickCompleteTaskButton();
142
141
  });
143
142
  });
144
- // Skipped due to bug #29346: https://github.com/camunda/camunda-hub/issues/29346
145
- _8_11_1.test.skip('Form.js Integration with AI generated Start form @ai-external', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, formJsPage, }) => {
143
+ (0, _8_11_1.test)('Form.js Integration with AI generated Start form @ai-external', async ({ page, homePage, modelerHomePage, appsPage, modelerCreatePage, formJsPage, }) => {
146
144
  _8_11_1.test.slow();
147
145
  const randomString = await (0, _setup_1.generateRandomStringAsync)(3);
148
146
  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.1598",
3
+ "version": "0.0.1599",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",