@camunda/e2e-test-suite 0.0.550 → 0.0.551
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.
|
@@ -37,9 +37,10 @@ class TaskPanelPage {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
async openTask(name, assignButton = true) {
|
|
40
|
-
|
|
40
|
+
const maxAttempts = 10;
|
|
41
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
41
42
|
try {
|
|
42
|
-
await this.page.waitForLoadState('
|
|
43
|
+
await this.page.waitForLoadState('domcontentloaded');
|
|
43
44
|
await this.availableTasks
|
|
44
45
|
.getByText(name, { exact: true })
|
|
45
46
|
.nth(0)
|
|
@@ -52,13 +53,13 @@ class TaskPanelPage {
|
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
54
55
|
catch (error) {
|
|
55
|
-
if (attempt <
|
|
56
|
+
if (attempt < maxAttempts) {
|
|
56
57
|
console.warn(`Attempt ${attempt} failed. Reloading page...`);
|
|
57
58
|
await this.page.reload();
|
|
58
|
-
await this.page.waitForLoadState('
|
|
59
|
+
await this.page.waitForLoadState('domcontentloaded');
|
|
59
60
|
}
|
|
60
61
|
else {
|
|
61
|
-
throw new Error(`Failed to open task "${name}" after ${
|
|
62
|
+
throw new Error(`Failed to open task "${name}" after ${maxAttempts} attempts: ${error}`);
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -84,7 +85,7 @@ class TaskPanelPage {
|
|
|
84
85
|
await this.processesPageTab.click();
|
|
85
86
|
}
|
|
86
87
|
async taskCount(name, waitForStable = true) {
|
|
87
|
-
await this.page.waitForLoadState('
|
|
88
|
+
await this.page.waitForLoadState('domcontentloaded');
|
|
88
89
|
if (waitForStable) {
|
|
89
90
|
// Wait for the task list to stabilize: poll until count is unchanged for 2s
|
|
90
91
|
let previousCount = -1;
|
|
@@ -38,12 +38,14 @@ class TaskPanelPage {
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
async openTask(name, assignButton = true) {
|
|
41
|
-
|
|
41
|
+
const maxAttempts = 10;
|
|
42
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
42
43
|
try {
|
|
44
|
+
await this.page.waitForLoadState('domcontentloaded');
|
|
43
45
|
await this.availableTasks
|
|
44
46
|
.getByText(name, { exact: true })
|
|
45
47
|
.nth(0)
|
|
46
|
-
.click({ timeout: constants_1._1_SECOND_IN_MS * 4 });
|
|
48
|
+
.click({ timeout: constants_1._1_SECOND_IN_MS * 4 });
|
|
47
49
|
if (assignButton) {
|
|
48
50
|
await (0, test_1.expect)(this.assignToMeButton).toBeVisible({
|
|
49
51
|
timeout: constants_1._1_SECOND_IN_MS * 10,
|
|
@@ -52,12 +54,13 @@ class TaskPanelPage {
|
|
|
52
54
|
return;
|
|
53
55
|
}
|
|
54
56
|
catch (error) {
|
|
55
|
-
if (attempt <
|
|
57
|
+
if (attempt < maxAttempts) {
|
|
56
58
|
console.warn(`Attempt ${attempt} failed. Reloading page...`);
|
|
57
59
|
await this.page.reload();
|
|
60
|
+
await this.page.waitForLoadState('domcontentloaded');
|
|
58
61
|
}
|
|
59
62
|
else {
|
|
60
|
-
throw new Error(`Failed to open task "${name}" after
|
|
63
|
+
throw new Error(`Failed to open task "${name}" after ${maxAttempts} attempts: ${error}`);
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
}
|
|
@@ -25,33 +25,51 @@ async function createAndRunProcess(modelerHomePage, modelerCreatePage, processNa
|
|
|
25
25
|
await modelerHomePage.clickProjectBreadcrumb();
|
|
26
26
|
}
|
|
27
27
|
exports.createAndRunProcess = createAndRunProcess;
|
|
28
|
-
async function completeTaskWithRetry(page, taskPanelPage, taskDetailsPage, taskName, taskPriority, maxRetries =
|
|
28
|
+
async function completeTaskWithRetry(page, taskPanelPage, taskDetailsPage, taskName, taskPriority, maxRetries = 5) {
|
|
29
29
|
for (let attempt = 0; attempt < maxRetries; attempt++) {
|
|
30
30
|
try {
|
|
31
|
-
await
|
|
31
|
+
await page.waitForLoadState('domcontentloaded');
|
|
32
32
|
await (0, sleep_1.sleep)(1000);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
// Wait for task to appear in the list before trying to open it
|
|
34
|
+
const taskLocator = taskPanelPage.availableTasks
|
|
35
|
+
.getByText(taskName, { exact: true })
|
|
36
|
+
.first();
|
|
37
|
+
try {
|
|
38
|
+
await taskLocator.waitFor({ state: 'visible', timeout: 10000 });
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
throw new Error(`Task ${taskName} not found in available tasks`);
|
|
42
|
+
}
|
|
43
|
+
await taskPanelPage.openTask(taskName, false);
|
|
44
|
+
await (0, sleep_1.sleep)(500);
|
|
45
|
+
await (0, test_1.expect)(taskDetailsPage.detailsPanel).toBeVisible({ timeout: 30000 });
|
|
46
|
+
// Only assign if not already assigned (handles retry after partial success)
|
|
47
|
+
if (!(await taskDetailsPage.assignedToMeText.isVisible({ timeout: 5000 }))) {
|
|
48
|
+
await (0, test_1.expect)(taskDetailsPage.assignToMeButton).toBeVisible({
|
|
49
|
+
timeout: 10000,
|
|
50
|
+
});
|
|
51
|
+
await taskDetailsPage.clickAssignToMeButton();
|
|
52
|
+
}
|
|
53
|
+
await (0, sleep_1.sleep)(500);
|
|
54
|
+
await (0, test_1.expect)(taskDetailsPage.detailsPanel.getByText(taskPriority)).toBeVisible({ timeout: 30000 });
|
|
39
55
|
await taskDetailsPage.clickCompleteTaskButton();
|
|
40
56
|
await (0, test_1.expect)(page.getByText('Task completed').first()).toBeVisible({
|
|
41
57
|
timeout: 200000,
|
|
42
58
|
});
|
|
43
59
|
await (0, test_1.expect)(taskPanelPage.availableTasks.getByText(taskName, { exact: true }).first()).not.toBeVisible({ timeout: 10000 });
|
|
44
|
-
|
|
60
|
+
console.log(`Successfully completed task: ${taskName}`);
|
|
45
61
|
return;
|
|
46
62
|
}
|
|
47
63
|
catch (error) {
|
|
64
|
+
console.warn(`Attempt ${attempt + 1} failed for completing task ${taskName}:`, error instanceof Error ? error.message : error);
|
|
48
65
|
if (attempt < maxRetries - 1) {
|
|
49
66
|
await page.reload();
|
|
50
|
-
|
|
67
|
+
await page.waitForLoadState('domcontentloaded');
|
|
68
|
+
await (0, sleep_1.sleep)(1000);
|
|
51
69
|
}
|
|
52
70
|
else {
|
|
53
71
|
console.error(error);
|
|
54
|
-
throw new Error(`Assertion failed after ${maxRetries} attempts`);
|
|
72
|
+
throw new Error(`Assertion failed after ${maxRetries} attempts for task ${taskName}`);
|
|
55
73
|
}
|
|
56
74
|
}
|
|
57
75
|
}
|
|
@@ -37,7 +37,8 @@ class TaskPanelPage {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
async openTask(name, assignButton = true) {
|
|
40
|
-
|
|
40
|
+
const maxAttempts = 10;
|
|
41
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
41
42
|
try {
|
|
42
43
|
await this.availableTasks
|
|
43
44
|
.getByText(name, { exact: true })
|
|
@@ -51,13 +52,13 @@ class TaskPanelPage {
|
|
|
51
52
|
return;
|
|
52
53
|
}
|
|
53
54
|
catch (error) {
|
|
54
|
-
if (attempt <
|
|
55
|
+
if (attempt < maxAttempts) {
|
|
55
56
|
console.warn(`Attempt ${attempt} failed. Reloading page...`);
|
|
56
57
|
await this.page.reload();
|
|
57
|
-
await this.page.waitForLoadState('
|
|
58
|
+
await this.page.waitForLoadState('domcontentloaded');
|
|
58
59
|
}
|
|
59
60
|
else {
|
|
60
|
-
throw new Error(`Failed to open task "${name}" after
|
|
61
|
+
throw new Error(`Failed to open task "${name}" after ${maxAttempts} attempts: ${error}`);
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
64
|
}
|
|
@@ -83,7 +84,7 @@ class TaskPanelPage {
|
|
|
83
84
|
await this.processesPageTab.click();
|
|
84
85
|
}
|
|
85
86
|
async taskCount(name, waitForStable = true) {
|
|
86
|
-
await this.page.waitForLoadState('
|
|
87
|
+
await this.page.waitForLoadState('domcontentloaded');
|
|
87
88
|
if (waitForStable) {
|
|
88
89
|
// Wait for the task list to stabilize: poll until count is unchanged for 2s
|
|
89
90
|
let previousCount = -1;
|
|
@@ -37,9 +37,10 @@ class TaskPanelPage {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
async openTask(name, assignButton = true) {
|
|
40
|
-
|
|
40
|
+
const maxAttempts = 10;
|
|
41
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
41
42
|
try {
|
|
42
|
-
await this.page.waitForLoadState('
|
|
43
|
+
await this.page.waitForLoadState('domcontentloaded');
|
|
43
44
|
await this.availableTasks
|
|
44
45
|
.getByText(name, { exact: true })
|
|
45
46
|
.nth(0)
|
|
@@ -52,13 +53,13 @@ class TaskPanelPage {
|
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
54
55
|
catch (error) {
|
|
55
|
-
if (attempt <
|
|
56
|
+
if (attempt < maxAttempts) {
|
|
56
57
|
console.warn(`Attempt ${attempt} failed. Reloading page...`);
|
|
57
58
|
await this.page.reload();
|
|
58
|
-
await this.page.waitForLoadState('
|
|
59
|
+
await this.page.waitForLoadState('domcontentloaded');
|
|
59
60
|
}
|
|
60
61
|
else {
|
|
61
|
-
throw new Error(`Failed to open task "${name}" after ${
|
|
62
|
+
throw new Error(`Failed to open task "${name}" after ${maxAttempts} attempts: ${error}`);
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -84,7 +85,7 @@ class TaskPanelPage {
|
|
|
84
85
|
await this.processesPageTab.click();
|
|
85
86
|
}
|
|
86
87
|
async taskCount(name, waitForStable = true) {
|
|
87
|
-
await this.page.waitForLoadState('
|
|
88
|
+
await this.page.waitForLoadState('domcontentloaded');
|
|
88
89
|
if (waitForStable) {
|
|
89
90
|
// Wait for the task list to stabilize: poll until count is unchanged for 2s
|
|
90
91
|
let previousCount = -1;
|