@camunda/e2e-test-suite 0.0.462 → 0.0.463

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.
@@ -19,7 +19,7 @@ export declare function runMultipleProcesses(page: Page, modelerHomePage: Modele
19
19
  export declare function createUserAndAssignToRole(page: Page, navigationPage: NavigationPage, managementIdentityPage: ManagementIdentityPage, keycloakLoginPage: KeycloakLoginPage, keycloakAdminPage: KeycloakAdminPage, ocIdentityHomePage: OCIdentityHomePage, identityMappingRulesPage: OCIdentityMappingRulesPage, ocIdentityRolesPage: OCIdentityRolesPage, username: string, password: string, role?: string, testMappings?: Serializable): Promise<void>;
20
20
  export declare function assignMappingToRole(page: Page, ocIdentityHomePage: OCIdentityHomePage, ocIdentityRolesPage: OCIdentityRolesPage, role: string, mappingRuleId: string, testMappings?: Serializable): Promise<void>;
21
21
  export declare function createAndRunProcess(page: Page, modelerHomePage: ModelerHomePage, modelerCreatePage: ModelerCreatePage, processName: string, processId?: string): Promise<void>;
22
- export declare function completeTaskWithRetry(page: Page, taskPanelPage: TaskPanelPage, taskDetailsPage: TaskDetailsPage, taskName: string, taskPriority: string, maxRetries?: number): Promise<void>;
22
+ export declare function completeTaskWithRetry(page: Page, taskPanelPage: TaskPanelPage, taskDetailsPage: TaskDetailsPage, taskName: string, taskPriority: string): Promise<void>;
23
23
  export declare function modelRestConnector(modelerCreatePage: ModelerCreatePage, connectorSettingsPage: ConnectorSettingsPage, connectorMarketplacePage: ConnectorMarketplacePage, processName: string, url: string, auth: string, resultExpression: string, resultVariable?: string, basicAuthCredentials?: {
24
24
  username: string;
25
25
  password: string;
@@ -8,6 +8,7 @@ const fileUpload_1 = require("../../utils/fileUpload");
8
8
  const findLocatorInPaginatedList_1 = require("../../utils/findLocatorInPaginatedList");
9
9
  const KeycloakUtils_1 = require("../SM-8.8/KeycloakUtils");
10
10
  const expectLocatorWithPagination_1 = require("../../utils/assertionHelpers/expectLocatorWithPagination");
11
+ const env_1 = require("../../utils/env");
11
12
  // This step will be skipped until new Identity expected flow is confirmed
12
13
  async function deleteAllUserGroups() {
13
14
  // await navigationPage.goToOCIdentity();
@@ -66,8 +67,14 @@ async function createAndRunProcess(page, modelerHomePage, modelerCreatePage, pro
66
67
  await modelerHomePage.clickProjectBreadcrumb();
67
68
  }
68
69
  exports.createAndRunProcess = createAndRunProcess;
69
- async function completeTaskWithRetry(page, taskPanelPage, taskDetailsPage, taskName, taskPriority, maxRetries = 7) {
70
- for (let attempt = 0; attempt < maxRetries; attempt++) {
70
+ async function completeTaskWithRetry(page, taskPanelPage, taskDetailsPage, taskName, taskPriority) {
71
+ // OpenSearch indexes slower than Elasticsearch, so allow more time
72
+ const TOTAL_TIMEOUT_MS = env_1.isOpenSearch ? 5 * 60 * 1000 : 2 * 60 * 1000;
73
+ const taskVisibilityTimeout = env_1.isOpenSearch ? 30000 : 10000;
74
+ const startTime = Date.now();
75
+ let attempt = 0;
76
+ while (Date.now() - startTime < TOTAL_TIMEOUT_MS) {
77
+ attempt++;
71
78
  try {
72
79
  await page.waitForLoadState('networkidle');
73
80
  await (0, sleep_1.sleep)(500);
@@ -75,7 +82,10 @@ async function completeTaskWithRetry(page, taskPanelPage, taskDetailsPage, taskN
75
82
  .getByText(taskName, { exact: true })
76
83
  .first();
77
84
  try {
78
- await taskLocator.waitFor({ state: 'visible', timeout: 10000 });
85
+ await taskLocator.waitFor({
86
+ state: 'visible',
87
+ timeout: taskVisibilityTimeout,
88
+ });
79
89
  }
80
90
  catch {
81
91
  throw new Error(`Task ${taskName} not found in available tasks`);
@@ -93,18 +103,13 @@ async function completeTaskWithRetry(page, taskPanelPage, taskDetailsPage, taskN
93
103
  return;
94
104
  }
95
105
  catch (error) {
96
- console.warn(`Attempt ${attempt + 1} failed for completing task ${taskName}:`, error instanceof Error ? error.message : error);
97
- if (attempt < maxRetries - 1) {
98
- await page.reload();
99
- await page.waitForLoadState('networkidle');
100
- await (0, sleep_1.sleep)(500);
101
- }
102
- else {
103
- console.error(`All ${maxRetries} attempts failed for task ${taskName}`);
104
- throw new Error(`Completion of task ${taskName} failed after ${maxRetries} attempts`);
105
- }
106
+ console.warn(`Attempt ${attempt} failed for completing task ${taskName}:`, error instanceof Error ? error.message : error);
107
+ await page.reload();
108
+ await page.waitForLoadState('networkidle');
109
+ await (0, sleep_1.sleep)(500);
106
110
  }
107
111
  }
112
+ throw new Error(`Completion of task ${taskName} failed after ${attempt} attempts (${TOTAL_TIMEOUT_MS / 1000}s timeout)`);
108
113
  }
109
114
  exports.completeTaskWithRetry = completeTaskWithRetry;
110
115
  async function modelRestConnector(modelerCreatePage, connectorSettingsPage, connectorMarketplacePage, processName, url, auth, resultExpression, resultVariable = '', basicAuthCredentials = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.462",
3
+ "version": "0.0.463",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",