@camunda/e2e-test-suite 0.0.1324 → 0.0.1326
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.
- package/.github/c8_versions.json +2 -1
- package/README.md +3 -0
- package/dist/fixtures/c8Run-8.11.d.ts +20 -0
- package/dist/fixtures/c8Run-8.11.js +56 -0
- package/dist/pages/c8Run-8.11/OperateHomePage.d.ts +22 -0
- package/dist/pages/c8Run-8.11/OperateHomePage.js +154 -0
- package/dist/pages/c8Run-8.11/OperateLoginPage.d.ts +14 -0
- package/dist/pages/c8Run-8.11/OperateLoginPage.js +37 -0
- package/dist/pages/c8Run-8.11/OperateProcessInstancePage.d.ts +28 -0
- package/dist/pages/c8Run-8.11/OperateProcessInstancePage.js +122 -0
- package/dist/pages/c8Run-8.11/OperateProcessesPage.d.ts +22 -0
- package/dist/pages/c8Run-8.11/OperateProcessesPage.js +109 -0
- package/dist/pages/c8Run-8.11/TaskDetailsPage.d.ts +65 -0
- package/dist/pages/c8Run-8.11/TaskDetailsPage.js +246 -0
- package/dist/pages/c8Run-8.11/TaskListLoginPage.d.ts +16 -0
- package/dist/pages/c8Run-8.11/TaskListLoginPage.js +52 -0
- package/dist/pages/c8Run-8.11/TaskPanelPage.d.ts +23 -0
- package/dist/pages/c8Run-8.11/TaskPanelPage.js +167 -0
- package/dist/pages/c8Run-8.11/UtilitiesPage.d.ts +8 -0
- package/dist/pages/c8Run-8.11/UtilitiesPage.js +114 -0
- package/dist/tests/c8Run-8.11/api-tests-v2.spec.d.ts +1 -0
- package/dist/tests/c8Run-8.11/api-tests-v2.spec.js +57 -0
- package/dist/tests/c8Run-8.11/connectors-user-flows.spec.d.ts +1 -0
- package/dist/tests/c8Run-8.11/connectors-user-flows.spec.js +120 -0
- package/dist/tests/c8Run-8.11/hto-user-flows.spec.d.ts +1 -0
- package/dist/tests/c8Run-8.11/hto-user-flows.spec.js +166 -0
- package/dist/tests/c8Run-8.11/login.spec.d.ts +1 -0
- package/dist/tests/c8Run-8.11/login.spec.js +21 -0
- package/dist/tests/c8Run-8.11/mcp-connector-authentication.spec.d.ts +1 -0
- package/dist/tests/c8Run-8.11/mcp-connector-authentication.spec.js +75 -0
- package/dist/tests/c8Run-8.11/mcp-meta.spec.d.ts +1 -0
- package/dist/tests/c8Run-8.11/mcp-meta.spec.js +73 -0
- package/dist/tests/c8Run-8.11/mcp-user-flows.spec.d.ts +1 -0
- package/dist/tests/c8Run-8.11/mcp-user-flows.spec.js +110 -0
- package/package.json +1 -1
- package/playwright.config.ts +13 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Page, Locator } from '@playwright/test';
|
|
2
|
+
declare class TaskDetailsPage {
|
|
3
|
+
private page;
|
|
4
|
+
readonly assignToMeButton: Locator;
|
|
5
|
+
readonly completeButton: Locator;
|
|
6
|
+
readonly unassignButton: Locator;
|
|
7
|
+
readonly assignee: Locator;
|
|
8
|
+
readonly completeTaskButton: Locator;
|
|
9
|
+
readonly addVariableButton: Locator;
|
|
10
|
+
readonly detailsPanel: Locator;
|
|
11
|
+
readonly detailsHeader: Locator;
|
|
12
|
+
readonly pendingTaskDescription: Locator;
|
|
13
|
+
readonly pickATaskHeader: Locator;
|
|
14
|
+
readonly emptyTaskMessage: Locator;
|
|
15
|
+
readonly nameInput: Locator;
|
|
16
|
+
readonly addressInput: Locator;
|
|
17
|
+
readonly ageInput: Locator;
|
|
18
|
+
readonly variablesTable: Locator;
|
|
19
|
+
readonly nameColumnHeader: Locator;
|
|
20
|
+
readonly valueColumnHeader: Locator;
|
|
21
|
+
readonly form: Locator;
|
|
22
|
+
readonly numberInput: Locator;
|
|
23
|
+
readonly incrementButton: Locator;
|
|
24
|
+
readonly decrementButton: Locator;
|
|
25
|
+
readonly dateInput: Locator;
|
|
26
|
+
readonly timeInput: Locator;
|
|
27
|
+
readonly checkbox: Locator;
|
|
28
|
+
readonly selectDropdown: Locator;
|
|
29
|
+
readonly tagList: Locator;
|
|
30
|
+
readonly detailsInfo: Locator;
|
|
31
|
+
readonly textInput: Locator;
|
|
32
|
+
readonly taskCompletedBanner: Locator;
|
|
33
|
+
readonly assignedToMeText: Locator;
|
|
34
|
+
constructor(page: Page);
|
|
35
|
+
clickAssignToMeButton(): Promise<void>;
|
|
36
|
+
clickUnassignButton(): Promise<void>;
|
|
37
|
+
clickCompleteTaskButton(): Promise<void>;
|
|
38
|
+
clickAddVariableButton(): Promise<void>;
|
|
39
|
+
replaceExistingVariableValue(values: {
|
|
40
|
+
name: string;
|
|
41
|
+
value: string;
|
|
42
|
+
}): Promise<void>;
|
|
43
|
+
getNthVariableNameInput(nth: number): Locator;
|
|
44
|
+
getNthVariableValueInput(nth: number): Locator;
|
|
45
|
+
addVariable(payload: {
|
|
46
|
+
name: string;
|
|
47
|
+
value: string;
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
fillNumber(number: string): Promise<void>;
|
|
50
|
+
clickIncrementButton(): Promise<void>;
|
|
51
|
+
clickDecrementButton(): Promise<void>;
|
|
52
|
+
fillDate(date: string): Promise<void>;
|
|
53
|
+
enterTime(time: string): Promise<void>;
|
|
54
|
+
checkCheckbox(): Promise<void>;
|
|
55
|
+
selectDropdownValue(value: string): Promise<void>;
|
|
56
|
+
clickRadioButton(radioBtnLabel: string): Promise<void>;
|
|
57
|
+
checkChecklistBox(label: string): Promise<void>;
|
|
58
|
+
enterTwoValuesInTagList(value1: string, value2: string): Promise<void>;
|
|
59
|
+
clickTextInput(): Promise<void>;
|
|
60
|
+
fillTextInput(value: string): Promise<void>;
|
|
61
|
+
priorityAssertion(priority: string): Promise<void>;
|
|
62
|
+
taskAssertion(name: string): Promise<void>;
|
|
63
|
+
assertVariableValue(variableName: string, variableValue: string): Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
export { TaskDetailsPage };
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskDetailsPage = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
const sleep_1 = require("../../utils/sleep");
|
|
6
|
+
function cardinalToOrdinal(numberValue) {
|
|
7
|
+
const realOrderIndex = numberValue.toString();
|
|
8
|
+
if (['11', '12', '13'].includes(realOrderIndex.slice(-2))) {
|
|
9
|
+
return `${realOrderIndex}th`;
|
|
10
|
+
}
|
|
11
|
+
switch (realOrderIndex.slice(-1)) {
|
|
12
|
+
case '1':
|
|
13
|
+
return `${realOrderIndex}st`;
|
|
14
|
+
case '2':
|
|
15
|
+
return `${realOrderIndex}nd`;
|
|
16
|
+
case '3':
|
|
17
|
+
return `${realOrderIndex}rd`;
|
|
18
|
+
default:
|
|
19
|
+
return `${realOrderIndex}th`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
class TaskDetailsPage {
|
|
23
|
+
page;
|
|
24
|
+
assignToMeButton;
|
|
25
|
+
completeButton;
|
|
26
|
+
unassignButton;
|
|
27
|
+
assignee;
|
|
28
|
+
completeTaskButton;
|
|
29
|
+
addVariableButton;
|
|
30
|
+
detailsPanel;
|
|
31
|
+
detailsHeader;
|
|
32
|
+
pendingTaskDescription;
|
|
33
|
+
pickATaskHeader;
|
|
34
|
+
emptyTaskMessage;
|
|
35
|
+
nameInput;
|
|
36
|
+
addressInput;
|
|
37
|
+
ageInput;
|
|
38
|
+
variablesTable;
|
|
39
|
+
nameColumnHeader;
|
|
40
|
+
valueColumnHeader;
|
|
41
|
+
form;
|
|
42
|
+
numberInput;
|
|
43
|
+
incrementButton;
|
|
44
|
+
decrementButton;
|
|
45
|
+
dateInput;
|
|
46
|
+
timeInput;
|
|
47
|
+
checkbox;
|
|
48
|
+
selectDropdown;
|
|
49
|
+
tagList;
|
|
50
|
+
detailsInfo;
|
|
51
|
+
textInput;
|
|
52
|
+
taskCompletedBanner;
|
|
53
|
+
assignedToMeText;
|
|
54
|
+
constructor(page) {
|
|
55
|
+
this.page = page;
|
|
56
|
+
this.assignToMeButton = page.getByRole('button', { name: 'Assign to me' });
|
|
57
|
+
this.completeButton = page.getByRole('button', { name: 'Complete' });
|
|
58
|
+
this.unassignButton = page.getByRole('button', { name: 'Unassign' });
|
|
59
|
+
this.assignee = page.getByTestId('assignee');
|
|
60
|
+
this.completeTaskButton = page.getByRole('button', { name: 'Complete Task' });
|
|
61
|
+
this.addVariableButton = page.getByRole('button', { name: 'Add Variable' });
|
|
62
|
+
this.detailsPanel = this.page.getByRole('complementary', {
|
|
63
|
+
name: 'Task details right panel',
|
|
64
|
+
});
|
|
65
|
+
this.detailsHeader = page.getByTitle('Task details header');
|
|
66
|
+
this.pendingTaskDescription = page.getByText('Pending task');
|
|
67
|
+
this.pickATaskHeader = page.getByRole('heading', {
|
|
68
|
+
name: 'Pick a task to work on',
|
|
69
|
+
});
|
|
70
|
+
this.emptyTaskMessage = page.getByRole('heading', {
|
|
71
|
+
name: /task has no variables/i,
|
|
72
|
+
});
|
|
73
|
+
this.nameInput = page.getByLabel('Name*');
|
|
74
|
+
this.addressInput = page.getByLabel('Address*');
|
|
75
|
+
this.ageInput = page.getByLabel('Age');
|
|
76
|
+
this.variablesTable = page.getByTestId('variables-table');
|
|
77
|
+
this.nameColumnHeader = this.variablesTable.getByRole('columnheader', {
|
|
78
|
+
name: 'Name',
|
|
79
|
+
});
|
|
80
|
+
this.valueColumnHeader = this.variablesTable.getByRole('columnheader', {
|
|
81
|
+
name: 'Value',
|
|
82
|
+
});
|
|
83
|
+
this.form = page.getByTestId('embedded-form');
|
|
84
|
+
this.numberInput = this.form.getByLabel('Number');
|
|
85
|
+
this.incrementButton = page.getByRole('button', { name: 'Increment' });
|
|
86
|
+
this.decrementButton = page.getByRole('button', { name: 'Decrement' });
|
|
87
|
+
this.dateInput = page.getByPlaceholder('mm/dd/yyyy');
|
|
88
|
+
this.timeInput = page.getByPlaceholder('hh:mm ?m');
|
|
89
|
+
this.checkbox = this.form.getByLabel('Checkbox');
|
|
90
|
+
this.selectDropdown = this.form.getByText('Select').last();
|
|
91
|
+
this.tagList = page.getByPlaceholder('Search');
|
|
92
|
+
this.detailsInfo = page.getByTestId('details-info');
|
|
93
|
+
this.textInput = page.locator('[class="fjs-input"]');
|
|
94
|
+
this.taskCompletedBanner = this.page.getByText('Task completed').first();
|
|
95
|
+
this.assignedToMeText = this.page
|
|
96
|
+
.getByTestId('assignee')
|
|
97
|
+
.getByText('Assigned to me');
|
|
98
|
+
}
|
|
99
|
+
async clickAssignToMeButton() {
|
|
100
|
+
await this.assignToMeButton.click({ timeout: 60000 });
|
|
101
|
+
}
|
|
102
|
+
async clickUnassignButton() {
|
|
103
|
+
await this.unassignButton.click();
|
|
104
|
+
}
|
|
105
|
+
async clickCompleteTaskButton() {
|
|
106
|
+
await this.completeTaskButton.click({ timeout: 60000 });
|
|
107
|
+
await (0, test_1.expect)(this.taskCompletedBanner).toBeVisible({
|
|
108
|
+
timeout: 200000,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
async clickAddVariableButton() {
|
|
112
|
+
await this.addVariableButton.click({ timeout: 60000 });
|
|
113
|
+
}
|
|
114
|
+
async replaceExistingVariableValue(values) {
|
|
115
|
+
const { name, value } = values;
|
|
116
|
+
await this.page.getByTitle(name).clear();
|
|
117
|
+
await this.page.getByTitle(name).fill(value);
|
|
118
|
+
}
|
|
119
|
+
getNthVariableNameInput(nth) {
|
|
120
|
+
return this.page.getByRole('textbox', {
|
|
121
|
+
name: `${cardinalToOrdinal(nth)} variable name`,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
getNthVariableValueInput(nth) {
|
|
125
|
+
return this.page.getByRole('textbox', {
|
|
126
|
+
name: `${cardinalToOrdinal(nth)} variable value`,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
async addVariable(payload) {
|
|
130
|
+
const { name, value } = payload;
|
|
131
|
+
this.clickAddVariableButton();
|
|
132
|
+
await this.getNthVariableNameInput(1).fill(name);
|
|
133
|
+
await this.getNthVariableValueInput(1).fill(value);
|
|
134
|
+
}
|
|
135
|
+
async fillNumber(number) {
|
|
136
|
+
await this.numberInput.fill(number);
|
|
137
|
+
}
|
|
138
|
+
async clickIncrementButton() {
|
|
139
|
+
await this.incrementButton.click();
|
|
140
|
+
}
|
|
141
|
+
async clickDecrementButton() {
|
|
142
|
+
await this.decrementButton.click();
|
|
143
|
+
}
|
|
144
|
+
async fillDate(date) {
|
|
145
|
+
await this.dateInput.click();
|
|
146
|
+
await this.dateInput.fill(date);
|
|
147
|
+
await this.dateInput.press('Enter');
|
|
148
|
+
}
|
|
149
|
+
async enterTime(time) {
|
|
150
|
+
await this.timeInput.click();
|
|
151
|
+
await this.page.getByText(time).click();
|
|
152
|
+
}
|
|
153
|
+
async checkCheckbox() {
|
|
154
|
+
await this.checkbox.check();
|
|
155
|
+
}
|
|
156
|
+
async selectDropdownValue(value) {
|
|
157
|
+
await this.selectDropdown.click();
|
|
158
|
+
await this.page.getByText(value).click();
|
|
159
|
+
}
|
|
160
|
+
async clickRadioButton(radioBtnLabel) {
|
|
161
|
+
await this.page.getByText(radioBtnLabel).click();
|
|
162
|
+
}
|
|
163
|
+
async checkChecklistBox(label) {
|
|
164
|
+
await this.page.getByLabel(label).check();
|
|
165
|
+
}
|
|
166
|
+
async enterTwoValuesInTagList(value1, value2) {
|
|
167
|
+
await this.tagList.click();
|
|
168
|
+
await this.page.getByText(value1).click();
|
|
169
|
+
await this.page.getByText(value2, { exact: true }).click();
|
|
170
|
+
}
|
|
171
|
+
async clickTextInput() {
|
|
172
|
+
await this.textInput.click({ timeout: 60000 });
|
|
173
|
+
}
|
|
174
|
+
async fillTextInput(value) {
|
|
175
|
+
await this.textInput.fill(value);
|
|
176
|
+
}
|
|
177
|
+
async priorityAssertion(priority) {
|
|
178
|
+
let retryCount = 0;
|
|
179
|
+
const maxRetries = 2;
|
|
180
|
+
while (retryCount < maxRetries) {
|
|
181
|
+
try {
|
|
182
|
+
await (0, test_1.expect)(this.detailsPanel.getByText(priority)).toBeVisible({
|
|
183
|
+
timeout: 45000,
|
|
184
|
+
});
|
|
185
|
+
return; // Exit the function if the expectation is met
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
retryCount++;
|
|
189
|
+
console.log(`Attempt ${retryCount} failed. Retrying...`);
|
|
190
|
+
await this.page.reload();
|
|
191
|
+
await (0, sleep_1.sleep)(10000);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
throw new Error(`Active icon not visible after ${maxRetries} attempts.`);
|
|
195
|
+
}
|
|
196
|
+
async taskAssertion(name) {
|
|
197
|
+
let retryCount = 0;
|
|
198
|
+
const maxRetries = 2;
|
|
199
|
+
while (retryCount < maxRetries) {
|
|
200
|
+
try {
|
|
201
|
+
await (0, test_1.expect)(this.detailsInfo.getByText(name)).toBeVisible({
|
|
202
|
+
timeout: 45000,
|
|
203
|
+
});
|
|
204
|
+
return; // Exit the function if the expectation is met
|
|
205
|
+
}
|
|
206
|
+
catch (error) {
|
|
207
|
+
retryCount++;
|
|
208
|
+
console.log(`Attempt ${retryCount} failed. Retrying...`);
|
|
209
|
+
await this.page.reload();
|
|
210
|
+
await (0, sleep_1.sleep)(10000);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
throw new Error(`Active icon not visible after ${maxRetries} attempts.`);
|
|
214
|
+
}
|
|
215
|
+
async assertVariableValue(variableName, variableValue) {
|
|
216
|
+
// Tasklist migrated its variables editor to the shadcn design system
|
|
217
|
+
// (@camunda/design-system's Label + LoadingTextarea/TextInput, see
|
|
218
|
+
// camunda/camunda#60894). The value field's accessible name comes from a
|
|
219
|
+
// visually-hidden <label> ("<variable name> Value", via
|
|
220
|
+
// taskVariablesValueLabel) associated by htmlFor -- the old Carbon input
|
|
221
|
+
// exposed the same string as an HTML title attribute, which getByTitle
|
|
222
|
+
// matched directly; getByLabel is the equivalent for a real <label>.
|
|
223
|
+
//
|
|
224
|
+
// The panel fetches the task's variables once, when the task is opened, so
|
|
225
|
+
// polling the DOM alone can never observe a value that was still being
|
|
226
|
+
// exported at that moment. Reload between attempts to force a re-fetch --
|
|
227
|
+
// same retry shape as taskAssertion/priorityAssertion above.
|
|
228
|
+
const valueInput = this.page.getByLabel(variableName + ' Value');
|
|
229
|
+
const maxRetries = 3;
|
|
230
|
+
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
231
|
+
try {
|
|
232
|
+
await (0, test_1.expect)(valueInput).toHaveValue(variableValue, { timeout: 30000 });
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
if (attempt === maxRetries) {
|
|
237
|
+
throw error;
|
|
238
|
+
}
|
|
239
|
+
console.log(`Attempt ${attempt} failed. Retrying...`);
|
|
240
|
+
await this.page.reload();
|
|
241
|
+
await (0, sleep_1.sleep)(5000);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
exports.TaskDetailsPage = TaskDetailsPage;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Page, Locator } from '@playwright/test';
|
|
2
|
+
declare class TaskListLoginPage {
|
|
3
|
+
private page;
|
|
4
|
+
readonly usernameInput: Locator;
|
|
5
|
+
readonly passwordInput: Locator;
|
|
6
|
+
readonly loginButton: Locator;
|
|
7
|
+
readonly taskListPageBanner: Locator;
|
|
8
|
+
constructor(page: Page);
|
|
9
|
+
fillUsername(username: string): Promise<void>;
|
|
10
|
+
clickUsername(): Promise<void>;
|
|
11
|
+
fillPassword(password: string): Promise<void>;
|
|
12
|
+
clickLoginButton(): Promise<void>;
|
|
13
|
+
isLoggedIn(): Promise<boolean>;
|
|
14
|
+
login(username: string, password: string): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export { TaskListLoginPage };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskListLoginPage = void 0;
|
|
4
|
+
const test_1 = require("@playwright/test");
|
|
5
|
+
class TaskListLoginPage {
|
|
6
|
+
page;
|
|
7
|
+
usernameInput;
|
|
8
|
+
passwordInput;
|
|
9
|
+
loginButton;
|
|
10
|
+
taskListPageBanner;
|
|
11
|
+
constructor(page) {
|
|
12
|
+
this.page = page;
|
|
13
|
+
this.usernameInput = page.getByLabel('Username');
|
|
14
|
+
this.passwordInput = page.getByRole('textbox', { name: 'password' });
|
|
15
|
+
this.loginButton = page.getByRole('button', { name: 'Login' });
|
|
16
|
+
// The header logo's accessible name is now just "Camunda logo" (the old
|
|
17
|
+
// Carbon header appended the product name, "Camunda logo Tasklist") --
|
|
18
|
+
// see camunda/camunda#60894.
|
|
19
|
+
this.taskListPageBanner = page.getByRole('link', {
|
|
20
|
+
name: 'Camunda logo',
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
async fillUsername(username) {
|
|
24
|
+
await this.usernameInput.fill(username);
|
|
25
|
+
}
|
|
26
|
+
async clickUsername() {
|
|
27
|
+
await this.usernameInput.click({ timeout: 60000 });
|
|
28
|
+
}
|
|
29
|
+
async fillPassword(password) {
|
|
30
|
+
await this.passwordInput.fill(password);
|
|
31
|
+
}
|
|
32
|
+
async clickLoginButton() {
|
|
33
|
+
await this.loginButton.click({ timeout: 60000 });
|
|
34
|
+
}
|
|
35
|
+
async isLoggedIn() {
|
|
36
|
+
// /tasklist/login redirects an already-authenticated user straight to
|
|
37
|
+
// /tasklist, so the form never renders on a re-login within a session.
|
|
38
|
+
await (0, test_1.expect)(this.usernameInput.or(this.taskListPageBanner).first()).toBeVisible({ timeout: 180000 });
|
|
39
|
+
return this.taskListPageBanner.isVisible();
|
|
40
|
+
}
|
|
41
|
+
async login(username, password) {
|
|
42
|
+
if (await this.isLoggedIn()) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
await this.clickUsername();
|
|
46
|
+
await this.fillUsername(username);
|
|
47
|
+
await this.fillPassword(password);
|
|
48
|
+
await (0, test_1.expect)(this.loginButton).toBeVisible({ timeout: 120000 });
|
|
49
|
+
await this.clickLoginButton();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.TaskListLoginPage = TaskListLoginPage;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Page, Locator } from '@playwright/test';
|
|
2
|
+
declare class TaskPanelPage {
|
|
3
|
+
readonly assignmentTag: Locator;
|
|
4
|
+
readonly assignToMeButton: Locator;
|
|
5
|
+
readonly availableTasks: Locator;
|
|
6
|
+
readonly completeTaskButton: Locator;
|
|
7
|
+
readonly emptyTaskMessage: Locator;
|
|
8
|
+
readonly filterSelectButton: Locator;
|
|
9
|
+
private page;
|
|
10
|
+
readonly taskListPageBanner: Locator;
|
|
11
|
+
constructor(page: Page);
|
|
12
|
+
assertAssigmentStatus(status: string): Promise<void>;
|
|
13
|
+
assignTaskToMe(): Promise<void>;
|
|
14
|
+
completeATask(): Promise<void>;
|
|
15
|
+
taskCard(name: string, userTaskName?: string): Locator;
|
|
16
|
+
revealTaskCard(card: Locator, name: string): Promise<void>;
|
|
17
|
+
assertTaskVisible(name: string): Promise<void>;
|
|
18
|
+
openTask(name: string, userTaskName?: string): Promise<string>;
|
|
19
|
+
taskListBannerIsVisible(): Promise<void>;
|
|
20
|
+
asssertUnnassignedTaskEmptyMessage(): Promise<void>;
|
|
21
|
+
filterBy(option: 'All open tasks' | 'Unassigned' | 'Assigned to me' | 'Completed' | 'Custom'): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export { TaskPanelPage };
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under
|
|
4
|
+
* one or more contributor license agreements. See the NOTICE file distributed
|
|
5
|
+
* with this work for additional information regarding copyright ownership.
|
|
6
|
+
* Licensed under the Camunda License 1.0. You may not use this file
|
|
7
|
+
* except in compliance with the Camunda License 1.0.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.TaskPanelPage = void 0;
|
|
11
|
+
const test_1 = require("@playwright/test");
|
|
12
|
+
class TaskPanelPage {
|
|
13
|
+
assignmentTag;
|
|
14
|
+
assignToMeButton;
|
|
15
|
+
availableTasks;
|
|
16
|
+
completeTaskButton;
|
|
17
|
+
emptyTaskMessage;
|
|
18
|
+
filterSelectButton;
|
|
19
|
+
page;
|
|
20
|
+
taskListPageBanner;
|
|
21
|
+
constructor(page) {
|
|
22
|
+
this.page = page;
|
|
23
|
+
this.assignmentTag = page.locator(' header > div').nth(2);
|
|
24
|
+
this.assignToMeButton = page.getByRole('button', { name: 'Assign to me' });
|
|
25
|
+
this.availableTasks = page.getByTitle('Available tasks');
|
|
26
|
+
this.completeTaskButton = page.getByRole('button', { name: 'Complete Task' });
|
|
27
|
+
this.emptyTaskMessage = this.emptyTaskMessage = page.getByRole('heading', {
|
|
28
|
+
name: /Task has no variables/i,
|
|
29
|
+
});
|
|
30
|
+
// The old Carbon expandable filter sidebar ([aria-label="Filter
|
|
31
|
+
// controls"], "Expand to show filters") no longer exists on the shadcn
|
|
32
|
+
// UI shipped since camunda/camunda#60894. Filtering is now a single
|
|
33
|
+
// dropdown-trigger button (accessible name "Filters") that opens a menu
|
|
34
|
+
// of filter options -- see filterBy() below.
|
|
35
|
+
this.filterSelectButton = page.getByRole('button', {
|
|
36
|
+
name: 'Filters',
|
|
37
|
+
exact: true,
|
|
38
|
+
});
|
|
39
|
+
// The header logo's accessible name is now just "Camunda logo" (the old
|
|
40
|
+
// Carbon header appended the product name, "Camunda logo Tasklist").
|
|
41
|
+
this.taskListPageBanner = page.getByRole('link', {
|
|
42
|
+
name: 'Camunda logo',
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
async assertAssigmentStatus(status) {
|
|
46
|
+
await (0, test_1.expect)(this.assignmentTag).toContainText(status);
|
|
47
|
+
}
|
|
48
|
+
async assignTaskToMe() {
|
|
49
|
+
await this.filterBy('Unassigned');
|
|
50
|
+
await this.openTask('usertask_to_be_assigned');
|
|
51
|
+
await this.assignToMeButton.click();
|
|
52
|
+
}
|
|
53
|
+
async completeATask() {
|
|
54
|
+
await this.filterBy('Unassigned');
|
|
55
|
+
await this.openTask('usertask_to_be_assigned');
|
|
56
|
+
await this.assignToMeButton.click();
|
|
57
|
+
await this.completeTaskButton.click();
|
|
58
|
+
}
|
|
59
|
+
taskCard(name, userTaskName = '') {
|
|
60
|
+
let cards = this.availableTasks
|
|
61
|
+
.getByRole('article')
|
|
62
|
+
.filter({ has: this.page.getByText(name, { exact: true }) });
|
|
63
|
+
if (userTaskName != '') {
|
|
64
|
+
cards = cards.filter({ hasText: userTaskName });
|
|
65
|
+
}
|
|
66
|
+
return cards.first();
|
|
67
|
+
}
|
|
68
|
+
// AvailableTasks.tsx renders the list through @tanstack/react-virtual, so
|
|
69
|
+
// only the cards inside the scroll window (plus a five-item overscan) are
|
|
70
|
+
// in the DOM. A task further down the list is not hidden, it is not
|
|
71
|
+
// rendered at all, so getByText() keeps reporting "element(s) not found"
|
|
72
|
+
// however long it waits. Page through the list until the card renders,
|
|
73
|
+
// wrapping back to the top so the layout's 5s refetch can bring in a task
|
|
74
|
+
// that was still being indexed.
|
|
75
|
+
async revealTaskCard(card, name) {
|
|
76
|
+
const scrollableList = this.availableTasks.getByTestId('scrollable-list');
|
|
77
|
+
await test_1.expect
|
|
78
|
+
.poll(async () => {
|
|
79
|
+
if (await card.isVisible()) {
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
if (await scrollableList.isVisible()) {
|
|
83
|
+
await scrollableList.evaluate((list) => {
|
|
84
|
+
const maxScrollTop = list.scrollHeight - list.clientHeight;
|
|
85
|
+
if (list.scrollTop >= maxScrollTop - 1) {
|
|
86
|
+
list.scrollTop = 0;
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
list.scrollTop += Math.max(list.clientHeight - 100, 200);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
return false;
|
|
93
|
+
}, {
|
|
94
|
+
timeout: 90000,
|
|
95
|
+
intervals: [500],
|
|
96
|
+
message: `Task "${name}" never rendered in the task list`,
|
|
97
|
+
})
|
|
98
|
+
.toBe(true);
|
|
99
|
+
}
|
|
100
|
+
async assertTaskVisible(name) {
|
|
101
|
+
await this.revealTaskCard(this.taskCard(name), name);
|
|
102
|
+
}
|
|
103
|
+
// Returns the opened task's userTaskKey -- the only identifier that tells
|
|
104
|
+
// two tasks sharing a name apart.
|
|
105
|
+
async openTask(name, userTaskName = '') {
|
|
106
|
+
const card = this.taskCard(name, userTaskName);
|
|
107
|
+
await this.revealTaskCard(card, name);
|
|
108
|
+
await card.click({ timeout: 20000 });
|
|
109
|
+
await this.page.waitForURL(/\/tasklist\/\d+/, { timeout: 30000 });
|
|
110
|
+
const openedTask = /\/tasklist\/(\d+)/.exec(this.page.url());
|
|
111
|
+
if (openedTask === null) {
|
|
112
|
+
throw new Error(`Opening task "${name}" did not open a task`);
|
|
113
|
+
}
|
|
114
|
+
return openedTask[1];
|
|
115
|
+
}
|
|
116
|
+
async taskListBannerIsVisible() {
|
|
117
|
+
await (0, test_1.expect)(this.taskListPageBanner).toBeVisible({ timeout: 30000 });
|
|
118
|
+
}
|
|
119
|
+
async asssertUnnassignedTaskEmptyMessage() {
|
|
120
|
+
await (0, test_1.expect)(this.emptyTaskMessage).toBeVisible();
|
|
121
|
+
}
|
|
122
|
+
async filterBy(option) {
|
|
123
|
+
// Open the filter dropdown, then pick the option from the menu that
|
|
124
|
+
// appears. Unlike the old Carbon sidebar, the trigger is always visible
|
|
125
|
+
// -- there's no separate expand/collapse step, and selecting an option
|
|
126
|
+
// closes the menu on its own.
|
|
127
|
+
//
|
|
128
|
+
// The trigger also carries the active filter's label, so it doubles as
|
|
129
|
+
// the "selection applied" signal -- the same one camunda/camunda's own
|
|
130
|
+
// Filters.test.tsx and TasklistIndex.page.ts assert on. It replaces the
|
|
131
|
+
// heading the old Carbon panel rendered for the active filter, which the
|
|
132
|
+
// shadcn panel no longer has.
|
|
133
|
+
//
|
|
134
|
+
// TasksLayoutPage renders <Filters disabled={isPending} />, so a task
|
|
135
|
+
// list refetch landing while the menu is open disables the trigger and
|
|
136
|
+
// tears the menu down before Radix runs the item's onSelect: the menu
|
|
137
|
+
// closes but the filter never changes. Re-open and pick again rather
|
|
138
|
+
// than failing on the first dropped selection.
|
|
139
|
+
const menuItem = this.page.getByRole('menuitem', {
|
|
140
|
+
name: option,
|
|
141
|
+
exact: true,
|
|
142
|
+
});
|
|
143
|
+
const triggerShowingOption = this.filterSelectButton.filter({
|
|
144
|
+
hasText: new RegExp(`^${option}$`),
|
|
145
|
+
});
|
|
146
|
+
const maxAttempts = 3;
|
|
147
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
148
|
+
await (0, test_1.expect)(this.filterSelectButton).toBeEnabled({ timeout: 30000 });
|
|
149
|
+
await this.filterSelectButton.click();
|
|
150
|
+
await (0, test_1.expect)(menuItem).toBeVisible({ timeout: 10000 });
|
|
151
|
+
await menuItem.click();
|
|
152
|
+
const applied = await triggerShowingOption
|
|
153
|
+
.waitFor({ state: 'visible', timeout: 15000 })
|
|
154
|
+
.then(() => true)
|
|
155
|
+
.catch(() => false);
|
|
156
|
+
if (applied) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
console.warn(`Attempt ${attempt} to apply the "${option}" task filter did not ` +
|
|
160
|
+
'take effect. Retrying...');
|
|
161
|
+
await this.page.keyboard.press('Escape');
|
|
162
|
+
await (0, test_1.expect)(this.filterSelectButton).toHaveAttribute('aria-expanded', 'false', { timeout: 10000 });
|
|
163
|
+
}
|
|
164
|
+
throw new Error(`Task filter "${option}" was not applied after ${maxAttempts} attempts`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
exports.TaskPanelPage = TaskPanelPage;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { APIRequestContext, Page, Locator } from '@playwright/test';
|
|
2
|
+
import { TaskPanelPage } from '../c8Run-8.11/TaskPanelPage';
|
|
3
|
+
import { TaskDetailsPage } from '../c8Run-8.11/TaskDetailsPage';
|
|
4
|
+
export declare function navigateToApp(page: Page, appName: string): Promise<void>;
|
|
5
|
+
export declare function openUserTaskOfProcessInstance(page: Page, request: APIRequestContext, processInstanceKey: string, maxRetries?: number, retryDelayMs?: number): Promise<string>;
|
|
6
|
+
export declare function assertLocatorVisibleWithRetry(page: Page, locator: Locator, text: string, timeout?: number, maxRetries?: number): Promise<void>;
|
|
7
|
+
export declare function validateURL(page: Page, URL: RegExp): Promise<void>;
|
|
8
|
+
export declare function completeTaskWithRetry(taskPanelPage: TaskPanelPage, taskDetailsPage: TaskDetailsPage, taskName: string, taskPriority: string, userTaskName?: string, textInput?: string, maxRetries?: number): Promise<void>;
|