@camunda/e2e-test-suite 0.0.393 → 0.0.395

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.
@@ -223,12 +223,28 @@ class AppsPage {
223
223
  this.appSwitcherButton,
224
224
  ];
225
225
  for (let retries = 0; retries < maxRetries; retries++) {
226
+ try {
227
+ const blockingModal = this.page.locator('.cds--modal.is-visible');
228
+ if ((await blockingModal.count()) > 0) {
229
+ await this.page.keyboard.press('Escape');
230
+ await (0, sleep_1.sleep)(1000);
231
+ }
232
+ }
233
+ catch {
234
+ // No blocking modal to dismiss
235
+ }
226
236
  for (const appButton of appButtons) {
227
- if (await appButton.isVisible({ timeout: 20000 })) {
228
- await appButton.click({ timeout: 15000 });
229
- return;
237
+ try {
238
+ if (await appButton.isVisible({ timeout: 20000 })) {
239
+ await appButton.click({ timeout: 15000 });
240
+ return;
241
+ }
242
+ }
243
+ catch {
244
+ // Button click failed, try next or retry
230
245
  }
231
246
  }
247
+ await (0, sleep_1.sleep)(2000);
232
248
  }
233
249
  }
234
250
  async clickConsoleLink() {
@@ -69,6 +69,7 @@ declare class ConsoleOrganizationPage {
69
69
  clickMainUser(email: string): Promise<void>;
70
70
  clickAuthorizations(): Promise<void>;
71
71
  authorizedResourceAssertion(processId: string, maxRetries?: number, timeout?: number): Promise<void>;
72
+ authorizedResourcesAssertion(processIds: string[], maxRetries?: number, perCheckTimeout?: number): Promise<void>;
72
73
  clickNewContextPadButton(): Promise<void>;
73
74
  optInToAlphaFeatures(): Promise<void>;
74
75
  clickGroupsTab(): Promise<void>;
@@ -324,20 +324,44 @@ class ConsoleOrganizationPage {
324
324
  await (0, test_1.expect)(this.authorizations).toBeVisible({ timeout: 60000 });
325
325
  await this.authorizations.click();
326
326
  }
327
- async authorizedResourceAssertion(processId, maxRetries = 5, timeout = 30000) {
327
+ async authorizedResourceAssertion(processId, maxRetries = 20, timeout = 60000) {
328
+ const url = this.page.url();
328
329
  for (let attempt = 0; attempt < maxRetries; attempt++) {
329
330
  try {
330
- await this.page.reload();
331
+ await this.page.goto(url, { timeout: 30000 });
331
332
  await this.clickAuthorizations();
332
333
  await (0, test_1.expect)(this.page.getByRole('row', { name: processId })).toBeVisible({ timeout: timeout });
333
334
  return;
334
335
  }
335
336
  catch (error) {
336
337
  if (attempt < maxRetries - 1) {
337
- console.warn(`Attempt ${attempt + 1} failed. Retrying...`);
338
+ console.warn(`Attempt ${attempt + 1} failed. Error: ${error}. Retrying...`);
339
+ await (0, sleep_1.sleep)(5000);
340
+ }
341
+ else {
342
+ throw new Error(`Assertion failed after ${maxRetries} attempts. Last error: ${error}`);
343
+ }
344
+ }
345
+ }
346
+ }
347
+ async authorizedResourcesAssertion(processIds, maxRetries = 20, perCheckTimeout = 60000) {
348
+ const url = this.page.url();
349
+ for (let attempt = 0; attempt < maxRetries; attempt++) {
350
+ try {
351
+ await this.page.goto(url, { timeout: 30000 });
352
+ await this.clickAuthorizations();
353
+ for (const processId of processIds) {
354
+ await (0, test_1.expect)(this.page.getByRole('row', { name: processId })).toBeVisible({ timeout: perCheckTimeout });
355
+ }
356
+ return;
357
+ }
358
+ catch (error) {
359
+ if (attempt < maxRetries - 1) {
360
+ console.warn(`Attempt ${attempt + 1} failed. Error: ${error}. Retrying...`);
361
+ await (0, sleep_1.sleep)(30000);
338
362
  }
339
363
  else {
340
- throw new Error(`Assertion failed after ${maxRetries} attempts`);
364
+ throw new Error(`Assertion failed after ${maxRetries} attempts. Last error: ${error}`);
341
365
  }
342
366
  }
343
367
  }
@@ -375,7 +399,22 @@ class ConsoleOrganizationPage {
375
399
  }
376
400
  }
377
401
  async clickGroupsTab() {
378
- await this.groupsTab.click({ timeout: 60000 });
402
+ for (let attempt = 0; attempt < 3; attempt++) {
403
+ try {
404
+ await this.groupsTab.click({ timeout: 60000 });
405
+ return;
406
+ }
407
+ catch (error) {
408
+ if (attempt < 2) {
409
+ console.warn(`clickGroupsTab attempt ${attempt + 1} failed. Retrying...`);
410
+ await (0, sleep_1.sleep)(5000);
411
+ await this.page.reload();
412
+ }
413
+ else {
414
+ throw error;
415
+ }
416
+ }
417
+ }
379
418
  }
380
419
  async clickCreateGroupButton() {
381
420
  const maxRetries = 3;
@@ -175,6 +175,16 @@ class ModelerHomePage {
175
175
  async clickCrossComponentProjectFolder() {
176
176
  await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.crossComponentProjectFolder, {
177
177
  preAction: async () => {
178
+ try {
179
+ const blockingModal = this.page.locator('.cds--modal.is-visible');
180
+ if ((await blockingModal.count()) > 0) {
181
+ await this.page.keyboard.press('Escape');
182
+ await (0, sleep_1.sleep)(1000);
183
+ }
184
+ }
185
+ catch {
186
+ // No blocking modal to dismiss
187
+ }
178
188
  await this.clickMessageBanner();
179
189
  },
180
190
  });
@@ -52,7 +52,12 @@ class OptimizeDashboardPage {
52
52
  catch (error) {
53
53
  if (attempt < maxRetries - 1) {
54
54
  console.warn(`Attempt ${attempt + 1} failed for asserting owner name ${result} assertion for ${processName} in Optimize.. Retrying...`);
55
- await this.page.reload();
55
+ try {
56
+ await this.page.reload();
57
+ }
58
+ catch {
59
+ throw new Error(`Owner name ${result} assertion for ${processName} failed after ${attempt + 1} attempts (page closed)`);
60
+ }
56
61
  await new Promise((resolve) => setTimeout(resolve, retryDelay));
57
62
  }
58
63
  else {
@@ -77,19 +77,33 @@ class SignUpPage {
77
77
  this.verifyEmailText = page.getByText('Verify your email');
78
78
  }
79
79
  async signupToC8(emailAddress, password) {
80
- await this.page.goto('https://accounts.ultrawombat.com/signup');
81
- await this.clickFirstNameInput();
82
- await this.fillFirstNameInput('QA');
83
- await this.clickLastNameInput();
84
- await this.fillLastNameInput('Camunda');
85
- await this.clickEmailInput();
86
- await this.fillEmailInput(emailAddress);
87
- await this.clickPasswordInput();
88
- await this.fillPasswordInput(password);
89
- await this.clickSignupButton();
90
- await (0, test_1.expect)(this.verifyEmailText.first()).toBeVisible({
91
- timeout: 90000,
92
- });
80
+ const maxRetries = 3;
81
+ for (let attempt = 0; attempt < maxRetries; attempt++) {
82
+ try {
83
+ await this.page.goto('https://accounts.ultrawombat.com/signup');
84
+ await this.clickFirstNameInput();
85
+ await this.fillFirstNameInput('QA');
86
+ await this.clickLastNameInput();
87
+ await this.fillLastNameInput('Camunda');
88
+ await this.clickEmailInput();
89
+ await this.fillEmailInput(emailAddress);
90
+ await this.clickPasswordInput();
91
+ await this.fillPasswordInput(password);
92
+ await this.clickSignupButton();
93
+ await (0, test_1.expect)(this.verifyEmailText.first()).toBeVisible({
94
+ timeout: 180000,
95
+ });
96
+ return;
97
+ }
98
+ catch (error) {
99
+ if (attempt < maxRetries - 1) {
100
+ console.warn(`Signup attempt ${attempt + 1} failed. Retrying...`);
101
+ }
102
+ else {
103
+ throw error;
104
+ }
105
+ }
106
+ }
93
107
  }
94
108
  async clickFirstNameInput() {
95
109
  await this.firstNameInput.click({ timeout: 30000 });
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TaskDetailsPage = void 0;
4
4
  const test_1 = require("@playwright/test");
5
- const UtilitiesPage_1 = require("../8.7/UtilitiesPage");
6
5
  function cardinalToOrdinal(numberValue) {
7
6
  const realOrderIndex = numberValue.toString();
8
7
  if (['11', '12', '13'].includes(realOrderIndex.slice(-2))) {
@@ -218,7 +217,9 @@ class TaskDetailsPage {
218
217
  await (0, test_1.expect)(this.page.locator(`button[aria-label="Download ${documentName}"]`)).toBeVisible({ timeout: 60000 });
219
218
  }
220
219
  async assertLoadedImage(documentName) {
221
- await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(this.page, this.page.locator(`img[alt="${documentName}"]`), documentName, 60000, 10);
220
+ await (0, test_1.expect)(this.page.locator(`img[alt="${documentName}"]`)).toBeVisible({
221
+ timeout: 120000,
222
+ });
222
223
  }
223
224
  async assertPdfPreviewViewerExists() {
224
225
  const containers = this.page.locator('[class="fjs-documentPreview-single-document-container"]');
@@ -228,7 +229,9 @@ class TaskDetailsPage {
228
229
  const lastPdfViewer = containers
229
230
  .last()
230
231
  .locator('.fjs-documentPreview-pdf-viewer');
231
- await (0, test_1.expect)(firstPdfViewer.or(lastPdfViewer)).toBeVisible();
232
+ await (0, test_1.expect)(firstPdfViewer.or(lastPdfViewer)).toBeVisible({
233
+ timeout: 60000,
234
+ });
232
235
  }
233
236
  async clickSubmitButton() {
234
237
  await (0, test_1.expect)(this.submitButton).toBeVisible();
@@ -17,7 +17,7 @@ import { ConnectorTemplatePage } from './ConnectorTemplatePage';
17
17
  export declare function loginWithRetry(page: Page, loginPage: LoginPage, testUser: {
18
18
  username: string;
19
19
  password: string;
20
- }, timeout: number, maxRetries?: number): Promise<void>;
20
+ }, timeout: number, maxRetries?: number, skipOrgAssertion?: boolean): Promise<void>;
21
21
  export declare function modelRestConnector(modelerCreatePage: ModelerCreatePage, connectorSettingsPage: ConnectorSettingsPage, processName: string, url: string, auth: string, resultExpression: string, resultVariable?: string, basicAuthCredentials?: {
22
22
  username: string;
23
23
  password: string;
@@ -8,12 +8,17 @@ const sleep_1 = require("../../utils/sleep");
8
8
  const randomSleep_1 = require("../../utils/randomSleep");
9
9
  const fileUpload_1 = require("../../utils/fileUpload");
10
10
  const mailSlurpClient_1 = require("../../utils/mailSlurpClient");
11
- async function loginWithRetry(page, loginPage, testUser, timeout, maxRetries = 3) {
11
+ async function loginWithRetry(page, loginPage, testUser, timeout, maxRetries = 3, skipOrgAssertion = false) {
12
12
  for (let attempt = 0; attempt < maxRetries; attempt++) {
13
13
  try {
14
14
  await page.goto('/');
15
15
  await (0, sleep_1.sleep)(timeout);
16
- await loginPage.login(testUser);
16
+ if (skipOrgAssertion) {
17
+ await loginPage.loginWithoutOrgAssertion(testUser);
18
+ }
19
+ else {
20
+ await loginPage.login(testUser);
21
+ }
17
22
  return;
18
23
  }
19
24
  catch (error) {
@@ -99,6 +104,7 @@ async function assertLocatorVisibleWithRetry(page, locator, text, timeout = 1200
99
104
  catch (error) {
100
105
  if (attempt < maxRetries - 1) {
101
106
  console.warn(`Attempt ${attempt + 1} failed for asserting ${text}. Retrying...`);
107
+ await (0, sleep_1.sleep)(5000);
102
108
  }
103
109
  else {
104
110
  throw new Error(`Assertion of ${text} failed after ${maxRetries} attempts`);
@@ -205,7 +205,7 @@ _8_7_1.test.describe('Connectors User Flow Tests', () => {
205
205
  const operateTab = await page.waitForEvent('popup', { timeout: 60000 });
206
206
  const operateTabProcessInstancePage = new OperateProcessInstancePage_1.OperateProcessInstancePage(operateTab);
207
207
  await operateTab.reload();
208
- await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(operateTab, operateTabProcessInstancePage.completedIcon, 'Completed icon', 60000, 10);
208
+ await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(operateTab, operateTabProcessInstancePage.completedIcon, 'Completed icon', 60000, 20);
209
209
  await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(operateTab, operateTab.getByTestId('variables-list'), 'Variable list', 60000);
210
210
  await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(operateTab, operateTab
211
211
  .getByTestId('variable-message')
@@ -220,7 +220,7 @@ _8_7_1.test.describe('RBA Enabled User Flows Test', () => {
220
220
  const processId2 = processName + '2';
221
221
  await _8_7_1.test.step('Navigate to Console and Enable RBA', async () => {
222
222
  await (0, UtilitiesPage_1.enableRBA)(clusterName, homePage, clusterPage, clusterDetailsPage, appsPage);
223
- await (0, sleep_1.sleep)(90000);
223
+ await (0, sleep_1.sleep)(180000);
224
224
  });
225
225
  await _8_7_1.test.step('Navigate to Web Modeler', async () => {
226
226
  await appsPage.clickCamundaApps();
@@ -237,6 +237,7 @@ _8_7_1.test.describe('RBA Enabled User Flows Test', () => {
237
237
  processName: processName,
238
238
  uploadFromFile: 'Camunda_Simple_User_Task_1',
239
239
  });
240
+ await (0, sleep_1.sleep)(60000);
240
241
  });
241
242
  await _8_7_1.test.step('Navigate to Users and Assert Authorized Resources Are Created For Both Processes', async () => {
242
243
  await appsPage.clickCamundaApps();
@@ -245,8 +246,10 @@ _8_7_1.test.describe('RBA Enabled User Flows Test', () => {
245
246
  await consoleOrganizationsPage.clickUsersTab();
246
247
  await consoleOrganizationsPage.clickMainUser(mainUser.username);
247
248
  await consoleOrganizationsPage.clickAuthorizations();
248
- await consoleOrganizationsPage.authorizedResourceAssertion(processId1);
249
- await consoleOrganizationsPage.authorizedResourceAssertion(processId2);
249
+ await consoleOrganizationsPage.authorizedResourcesAssertion([
250
+ processId1,
251
+ processId2,
252
+ ]);
250
253
  });
251
254
  await _8_7_1.test.step('Navigate to Tasklist and Assert Both Processes Are Accessible', async () => {
252
255
  await appsPage.clickCamundaApps();
@@ -485,13 +485,13 @@ _8_7_1.test.describe('Web Modeler User Flow Tests', () => {
485
485
  await (0, UtilitiesPage_1.loginWithRetry)(page, loginPage, {
486
486
  username: emailAddress,
487
487
  password: password,
488
- }, 1000);
488
+ }, 1000, 3, true);
489
489
  await appsPage.clickCamundaApps();
490
490
  await appsPage.clickModeler();
491
491
  await (0, test_1.expect)(modelerHomePage.modelerPageBanner).toBeVisible({
492
492
  timeout: 120000,
493
493
  });
494
- await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(modelerHomePage, modelerHomePage.crossComponentProjectFolder, 'Cross Component Test Project', 60000, 5);
494
+ await (0, UtilitiesPage_1.assertLocatorVisibleWithRetry)(modelerHomePage, modelerHomePage.crossComponentProjectFolder, 'Cross Component Test Project', 90000, 30);
495
495
  });
496
496
  await _8_7_1.test.step('Log out from Second User', async () => {
497
497
  await settingsPage.clickOpenSettingsButton();
@@ -36,6 +36,7 @@ async function deleteOrganization(page, uuid) {
36
36
  'Content-Type': 'application/json',
37
37
  Authorization: `Bearer ${token}`,
38
38
  },
39
+ timeout: 60000,
39
40
  });
40
41
  if (deleteResponse.status() !== 200) {
41
42
  const errorBody = await deleteResponse.text();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.393",
3
+ "version": "0.0.395",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",