@camunda/e2e-test-suite 0.0.203 → 0.0.205

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.
Files changed (29) hide show
  1. package/dist/fixtures/c8Run-8.10.d.ts +20 -0
  2. package/dist/fixtures/c8Run-8.10.js +56 -0
  3. package/dist/pages/c8Run-8.10/OperateHomePage.d.ts +20 -0
  4. package/dist/pages/c8Run-8.10/OperateHomePage.js +64 -0
  5. package/dist/pages/c8Run-8.10/OperateLoginPage.d.ts +14 -0
  6. package/dist/pages/c8Run-8.10/OperateLoginPage.js +37 -0
  7. package/dist/pages/c8Run-8.10/OperateProcessInstancePage.d.ts +17 -0
  8. package/dist/pages/c8Run-8.10/OperateProcessInstancePage.js +76 -0
  9. package/dist/pages/c8Run-8.10/OperateProcessesPage.d.ts +20 -0
  10. package/dist/pages/c8Run-8.10/OperateProcessesPage.js +84 -0
  11. package/dist/pages/c8Run-8.10/TaskDetailsPage.d.ts +65 -0
  12. package/dist/pages/c8Run-8.10/TaskDetailsPage.js +219 -0
  13. package/dist/pages/c8Run-8.10/TaskListLoginPage.d.ts +14 -0
  14. package/dist/pages/c8Run-8.10/TaskListLoginPage.js +37 -0
  15. package/dist/pages/c8Run-8.10/TaskPanelPage.d.ts +23 -0
  16. package/dist/pages/c8Run-8.10/TaskPanelPage.js +81 -0
  17. package/dist/pages/c8Run-8.10/UtilitiesPage.d.ts +7 -0
  18. package/dist/pages/c8Run-8.10/UtilitiesPage.js +71 -0
  19. package/dist/tests/c8Run-8.10/api-tests-v1.spec.d.ts +1 -0
  20. package/dist/tests/c8Run-8.10/api-tests-v1.spec.js +80 -0
  21. package/dist/tests/c8Run-8.10/api-tests-v2.spec.d.ts +1 -0
  22. package/dist/tests/c8Run-8.10/api-tests-v2.spec.js +57 -0
  23. package/dist/tests/c8Run-8.10/connectors-user-flows.spec.d.ts +1 -0
  24. package/dist/tests/c8Run-8.10/connectors-user-flows.spec.js +107 -0
  25. package/dist/tests/c8Run-8.10/hto-user-flows.spec.d.ts +1 -0
  26. package/dist/tests/c8Run-8.10/hto-user-flows.spec.js +190 -0
  27. package/dist/tests/c8Run-8.10/login.spec.d.ts +1 -0
  28. package/dist/tests/c8Run-8.10/login.spec.js +21 -0
  29. package/package.json +1 -1
@@ -0,0 +1,219 @@
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');
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
+ await (0, test_1.expect)(this.page.getByTitle(variableName + ' Value')).toHaveValue(variableValue, { timeout: 60000 });
217
+ }
218
+ }
219
+ exports.TaskDetailsPage = TaskDetailsPage;
@@ -0,0 +1,14 @@
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
+ constructor(page: Page);
8
+ fillUsername(username: string): Promise<void>;
9
+ clickUsername(): Promise<void>;
10
+ fillPassword(password: string): Promise<void>;
11
+ clickLoginButton(): Promise<void>;
12
+ login(username: string, password: string): Promise<void>;
13
+ }
14
+ export { TaskListLoginPage };
@@ -0,0 +1,37 @@
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
+ constructor(page) {
11
+ this.page = page;
12
+ this.usernameInput = page.getByLabel('Username');
13
+ this.passwordInput = page.getByRole('textbox', { name: 'password' });
14
+ this.loginButton = page.getByRole('button', { name: 'Login' });
15
+ }
16
+ async fillUsername(username) {
17
+ await this.usernameInput.fill(username);
18
+ }
19
+ async clickUsername() {
20
+ await this.usernameInput.click({ timeout: 60000 });
21
+ }
22
+ async fillPassword(password) {
23
+ await this.passwordInput.fill(password);
24
+ }
25
+ async clickLoginButton() {
26
+ await this.loginButton.click({ timeout: 60000 });
27
+ }
28
+ async login(username, password) {
29
+ await (0, test_1.expect)(this.usernameInput).toBeVisible({ timeout: 180000 });
30
+ await this.clickUsername();
31
+ await this.fillUsername(username);
32
+ await this.fillPassword(password);
33
+ await (0, test_1.expect)(this.loginButton).toBeVisible({ timeout: 120000 });
34
+ await this.clickLoginButton();
35
+ }
36
+ }
37
+ 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 collapseSidePanelButton: Locator;
8
+ readonly emptyTaskMessage: Locator;
9
+ readonly expandSidePanelButton: Locator;
10
+ private page;
11
+ readonly taskListPageBanner: Locator;
12
+ readonly collapseFilter: Locator;
13
+ constructor(page: Page);
14
+ assertAssigmentStatus(status: string): Promise<void>;
15
+ assignTaskToMe(): Promise<void>;
16
+ completeATask(): Promise<void>;
17
+ openTask(name: string, userTaskName?: string): Promise<void>;
18
+ taskListBannerIsVisible(): Promise<void>;
19
+ asssertUnnassignedTaskEmptyMessage(): Promise<void>;
20
+ filterBy(option: 'All open tasks' | 'Unassigned' | 'Assigned to me' | 'Completed' | 'Custom'): Promise<void>;
21
+ clickCollapseFilter(): Promise<void>;
22
+ }
23
+ export { TaskPanelPage };
@@ -0,0 +1,81 @@
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
+ collapseSidePanelButton;
18
+ emptyTaskMessage;
19
+ expandSidePanelButton;
20
+ page;
21
+ taskListPageBanner;
22
+ collapseFilter;
23
+ constructor(page) {
24
+ this.page = page;
25
+ this.assignmentTag = page.locator(' header > div').nth(2);
26
+ this.assignToMeButton = page.getByRole('button', { name: 'Assign to me' });
27
+ this.availableTasks = page.getByTitle('Available tasks');
28
+ this.completeTaskButton = page.getByRole('button', { name: 'Complete Task' });
29
+ this.collapseSidePanelButton = page.locator('button[aria-controls="task-nav-bar"][aria-expanded="true"]');
30
+ this.emptyTaskMessage = this.emptyTaskMessage = page.getByRole('heading', {
31
+ name: /Task has no variables/i,
32
+ });
33
+ this.expandSidePanelButton = page
34
+ .locator('[aria-label="Filter controls"] li')
35
+ .filter({ hasText: 'Expand to show filters' });
36
+ this.taskListPageBanner = page.getByRole('link', {
37
+ name: 'Camunda logo Tasklist',
38
+ });
39
+ this.collapseFilter = page.locator('button[aria-controls="task-nav-bar"][aria-expanded="false"]');
40
+ }
41
+ async assertAssigmentStatus(status) {
42
+ await (0, test_1.expect)(this.assignmentTag).toContainText(status);
43
+ }
44
+ async assignTaskToMe() {
45
+ await this.filterBy('Unassigned');
46
+ await this.openTask('usertask_to_be_assigned');
47
+ await this.assignToMeButton.click();
48
+ }
49
+ async completeATask() {
50
+ await this.filterBy('Unassigned');
51
+ await this.openTask('usertask_to_be_assigned');
52
+ await this.assignToMeButton.click();
53
+ await this.completeTaskButton.click();
54
+ }
55
+ async openTask(name, userTaskName = '') {
56
+ let tasks = this.availableTasks.getByText(name, { exact: true });
57
+ if (userTaskName != '') {
58
+ tasks = this.availableTasks
59
+ .getByRole('article')
60
+ .filter({ hasText: name })
61
+ .filter({ hasText: userTaskName });
62
+ }
63
+ await (0, test_1.expect)(tasks.nth(0)).toBeVisible({ timeout: 20000 });
64
+ await tasks.nth(0).click({ timeout: 20000 });
65
+ }
66
+ async taskListBannerIsVisible() {
67
+ await (0, test_1.expect)(this.taskListPageBanner).toBeVisible({ timeout: 30000 });
68
+ }
69
+ async asssertUnnassignedTaskEmptyMessage() {
70
+ await (0, test_1.expect)(this.emptyTaskMessage).toBeVisible();
71
+ }
72
+ async filterBy(option) {
73
+ await this.expandSidePanelButton.click();
74
+ await this.page.getByRole('link', { name: option, exact: true }).click();
75
+ await this.collapseSidePanelButton.click();
76
+ }
77
+ async clickCollapseFilter() {
78
+ await this.collapseFilter.click({ timeout: 45000 });
79
+ }
80
+ }
81
+ exports.TaskPanelPage = TaskPanelPage;
@@ -0,0 +1,7 @@
1
+ import { Page, Locator } from '@playwright/test';
2
+ import { TaskPanelPage } from '../c8Run-8.10/TaskPanelPage';
3
+ import { TaskDetailsPage } from '../c8Run-8.10/TaskDetailsPage';
4
+ export declare function navigateToApp(page: Page, appName: string): Promise<void>;
5
+ export declare function assertLocatorVisibleWithRetry(page: Page, locator: Locator, text: string, timeout?: number, maxRetries?: number): Promise<void>;
6
+ export declare function validateURL(page: Page, URL: RegExp): Promise<void>;
7
+ export declare function completeTaskWithRetry(taskPanelPage: TaskPanelPage, taskDetailsPage: TaskDetailsPage, taskName: string, taskPriority: string, userTaskName?: string, textInput?: string, maxRetries?: number): Promise<void>;
@@ -0,0 +1,71 @@
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.completeTaskWithRetry = exports.validateURL = exports.assertLocatorVisibleWithRetry = exports.navigateToApp = void 0;
11
+ const test_1 = require("@playwright/test");
12
+ const sleep_1 = require("../../utils/sleep");
13
+ async function navigateToApp(page, appName) {
14
+ page.goto('/' + appName.toLowerCase() + '/login');
15
+ }
16
+ exports.navigateToApp = navigateToApp;
17
+ async function assertLocatorVisibleWithRetry(page, locator, text, timeout = 20000, maxRetries = 3) {
18
+ for (let attempt = 0; attempt < maxRetries; attempt++) {
19
+ try {
20
+ await (0, test_1.expect)(locator).toBeVisible({
21
+ timeout: timeout,
22
+ });
23
+ return;
24
+ }
25
+ catch (error) {
26
+ if (attempt < maxRetries - 1) {
27
+ console.warn(`Attempt ${attempt + 1} failed for asserting ${text}. Retrying...`);
28
+ await page.reload();
29
+ await (0, sleep_1.sleep)(5000);
30
+ }
31
+ else {
32
+ throw new Error(`Assertion failed after ${maxRetries} attempts`);
33
+ }
34
+ }
35
+ }
36
+ }
37
+ exports.assertLocatorVisibleWithRetry = assertLocatorVisibleWithRetry;
38
+ async function validateURL(page, URL) {
39
+ (0, test_1.expect)(page).toHaveURL(URL);
40
+ }
41
+ exports.validateURL = validateURL;
42
+ async function completeTaskWithRetry(taskPanelPage, taskDetailsPage, taskName, taskPriority, userTaskName = '', textInput = '', maxRetries = 5) {
43
+ for (let attempt = 0; attempt < maxRetries; attempt++) {
44
+ try {
45
+ await taskPanelPage.openTask(taskName, userTaskName);
46
+ await (0, sleep_1.sleep)(500);
47
+ if (!(await taskDetailsPage.assignedToMeText.isVisible())) {
48
+ await taskDetailsPage.clickAssignToMeButton();
49
+ }
50
+ await (0, test_1.expect)(taskDetailsPage.detailsPanel.getByText(taskPriority)).toBeVisible();
51
+ if (textInput != '') {
52
+ await taskDetailsPage.clickTextInput();
53
+ await taskDetailsPage.fillTextInput(textInput);
54
+ }
55
+ await taskDetailsPage.taskCompletedBanner.waitFor({ state: 'hidden' });
56
+ await taskDetailsPage.clickCompleteTaskButton();
57
+ await (0, test_1.expect)(taskPanelPage.availableTasks.getByText(taskName, { exact: true }).first()).not.toBeVisible({ timeout: 15000 });
58
+ return;
59
+ }
60
+ catch (error) {
61
+ if (attempt < maxRetries - 1) {
62
+ console.warn(`Attempt ${attempt + 1} failed for completing task ${taskName}. Retrying...`);
63
+ }
64
+ else {
65
+ console.error(error);
66
+ throw new Error(`Assertion failed after ${maxRetries} attempts`);
67
+ }
68
+ }
69
+ }
70
+ }
71
+ exports.completeTaskWithRetry = completeTaskWithRetry;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const c8Run_8_10_1 = require("../../fixtures/c8Run-8.10");
4
+ const apiHelpers_1 = require("../../utils/apiHelpers");
5
+ const sleep_1 = require("../../utils/sleep");
6
+ const zeebeClient_1 = require("../../utils/zeebeClient");
7
+ const test_1 = require("@playwright/test");
8
+ const constants_1 = require("../../utils/constants");
9
+ if (process.env.DATABASE != 'RDBMS') {
10
+ c8Run_8_10_1.test.beforeAll(async () => {
11
+ await Promise.all([
12
+ (0, zeebeClient_1.deploy)('./resources/User_Task_Process_With_Form.bpmn'),
13
+ (0, zeebeClient_1.deploy)('./resources/New Form.form'),
14
+ (0, zeebeClient_1.deploy)('./resources/User_Task_Process_With_Form.bpmn'),
15
+ (0, zeebeClient_1.deploy)('./resources/Start_Form_Process.bpmn'),
16
+ ]);
17
+ await Promise.all([
18
+ (0, zeebeClient_1.createInstances)('Form_User_Task', 1, 3),
19
+ (0, zeebeClient_1.createInstances)('Start_Form_Process', 1, 1),
20
+ ]);
21
+ await (0, sleep_1.sleep)(10000);
22
+ });
23
+ c8Run_8_10_1.test.describe('API tests for v1', () => {
24
+ const auth = Buffer.from(`demo:demo`).toString('base64');
25
+ const requestHeaders = {
26
+ headers: {
27
+ 'Content-Type': 'application/json',
28
+ Authorization: `Basic ${auth}`,
29
+ },
30
+ };
31
+ (0, c8Run_8_10_1.test)('Search for process definitions @tasklistV2', async ({ request }) => {
32
+ const processDefinitionsList = await request.post('/v1/process-definitions/search', requestHeaders);
33
+ await (0, apiHelpers_1.assertResponseStatus)(processDefinitionsList, 200);
34
+ });
35
+ (0, c8Run_8_10_1.test)('Get a process definition via key @tasklistV2', async ({ request }) => {
36
+ await (0, test_1.expect)(async () => {
37
+ const searchProcessDefinitions = await request.post(`/v1/process-definitions/search`, requestHeaders);
38
+ const processKey = await searchProcessDefinitions.json();
39
+ (0, test_1.expect)(processKey.items.length).toBeGreaterThan(0);
40
+ const response = await request.get(`/v1/process-definitions/` + processKey.items[0].key, requestHeaders);
41
+ await (0, apiHelpers_1.assertResponseStatus)(response, 200);
42
+ }).toPass(constants_1.defaultAssertionOptions);
43
+ });
44
+ (0, c8Run_8_10_1.test)('Search for process instances @tasklistV2', async ({ request }) => {
45
+ const processInstancesList = await request.post('/v1/process-instances/search', requestHeaders);
46
+ await (0, apiHelpers_1.assertResponseStatus)(processInstancesList, 200);
47
+ });
48
+ (0, c8Run_8_10_1.test)('Search for flownode-instances @tasklistV2', async ({ request }) => {
49
+ const flowNodeInstancesList = await request.post('/v1/flownode-instances/search', requestHeaders);
50
+ await (0, apiHelpers_1.assertResponseStatus)(flowNodeInstancesList, 200);
51
+ });
52
+ (0, c8Run_8_10_1.test)('Search for variables for process instances @tasklistV2', async ({ request, }) => {
53
+ const variablesInstancesList = await request.post('/v1/variables/search', requestHeaders);
54
+ await (0, apiHelpers_1.assertResponseStatus)(variablesInstancesList, 200);
55
+ });
56
+ (0, c8Run_8_10_1.test)('Search for incidents @tasklistV2', async ({ request }) => {
57
+ const incidentsList = await request.post('/v1/incidents/search', requestHeaders);
58
+ await (0, apiHelpers_1.assertResponseStatus)(incidentsList, 200);
59
+ });
60
+ (0, c8Run_8_10_1.test)('Get connectors status @tasklistV2', async ({ request }) => {
61
+ await (0, sleep_1.sleep)(10000);
62
+ const connectorsStatus = await request.get(process.env.C8RUN_CONNECTORS_API_URL_LATEST + '/actuator/health', requestHeaders);
63
+ await (0, apiHelpers_1.assertResponseStatus)(connectorsStatus, 200);
64
+ });
65
+ (0, c8Run_8_10_1.test)('Get a inbound connectors list @tasklistV2', async ({ request }) => {
66
+ const connectorsInboundList = await request.get(process.env.C8RUN_CONNECTORS_API_URL_LATEST + '/inbound', requestHeaders);
67
+ await (0, apiHelpers_1.assertResponseStatus)(connectorsInboundList, 200);
68
+ });
69
+ (0, c8Run_8_10_1.test)('Search for tasks', async ({ request }) => {
70
+ const taskList = await request.post('/v1/tasks/search', requestHeaders);
71
+ await (0, apiHelpers_1.assertResponseStatus)(taskList, 200);
72
+ });
73
+ (0, c8Run_8_10_1.test)('Get a task via ID', async ({ request }) => {
74
+ const searchTasks = await request.post(`/v1/tasks/search`, requestHeaders);
75
+ const taskID = await searchTasks.json();
76
+ const response = await request.get('/v1/tasks/' + taskID[0].id, requestHeaders);
77
+ await (0, apiHelpers_1.assertResponseStatus)(response, 200);
78
+ });
79
+ });
80
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const c8Run_8_10_1 = require("../../fixtures/c8Run-8.10");
4
+ const test_1 = require("@playwright/test");
5
+ const apiHelpers_1 = require("../../utils/apiHelpers");
6
+ const zeebeClient_1 = require("../../utils/zeebeClient");
7
+ const sleep_1 = require("../../utils/sleep");
8
+ const constants_1 = require("../../utils/constants");
9
+ c8Run_8_10_1.test.beforeAll(async () => {
10
+ await Promise.all([
11
+ (0, zeebeClient_1.deploy)('./resources/User_Task_Process_With_Form.bpmn'),
12
+ (0, zeebeClient_1.deploy)('./resources/New Form.form'),
13
+ (0, zeebeClient_1.deploy)('./resources/User_Task_Process_With_Form.bpmn'),
14
+ (0, zeebeClient_1.deploy)('./resources/Start_Form_Process.bpmn'),
15
+ ]);
16
+ await Promise.all([
17
+ (0, zeebeClient_1.createInstances)('Form_User_Task', 1, 3),
18
+ (0, zeebeClient_1.createInstances)('Start_Form_Process', 1, 1),
19
+ ]);
20
+ await (0, sleep_1.sleep)(10000);
21
+ });
22
+ c8Run_8_10_1.test.describe('API tests for V2 @tasklistV2', () => {
23
+ (0, c8Run_8_10_1.test)('Search for process definitions', async ({ request }) => {
24
+ const processDefinitionsList = await request.post('/v2/process-definitions/search');
25
+ await (0, apiHelpers_1.assertResponseStatus)(processDefinitionsList, 200);
26
+ });
27
+ (0, c8Run_8_10_1.test)('Search for process instances', async ({ request }) => {
28
+ const processInstancesList = await request.post('/v2/process-instances/search');
29
+ await (0, apiHelpers_1.assertResponseStatus)(processInstancesList, 200);
30
+ });
31
+ (0, c8Run_8_10_1.test)('Search for element-instances', async ({ request }) => {
32
+ const elementInstancesList = await request.post('/v2/element-instances/search');
33
+ await (0, apiHelpers_1.assertResponseStatus)(elementInstancesList, 200);
34
+ });
35
+ (0, c8Run_8_10_1.test)('Search for variables for process instances', async ({ request }) => {
36
+ const variablesInstancesList = await request.post('/v2/variables/search');
37
+ await (0, apiHelpers_1.assertResponseStatus)(variablesInstancesList, 200);
38
+ });
39
+ (0, c8Run_8_10_1.test)('Search for incidents', async ({ request }) => {
40
+ const incidentsList = await request.post('/v2/incidents/search');
41
+ await (0, apiHelpers_1.assertResponseStatus)(incidentsList, 200);
42
+ });
43
+ (0, c8Run_8_10_1.test)('Get connectors status', async ({ request }) => {
44
+ await (0, test_1.expect)(async () => {
45
+ const connectorsStatus = await request.get(process.env.C8RUN_CONNECTORS_API_URL_LATEST + '/actuator/health');
46
+ await (0, apiHelpers_1.assertResponseStatus)(connectorsStatus, 200);
47
+ }).toPass(constants_1.defaultAssertionOptions);
48
+ });
49
+ (0, c8Run_8_10_1.test)('Get a inbound connectors list', async ({ request }) => {
50
+ const connectorsInboundList = await request.get(process.env.C8RUN_CONNECTORS_API_URL_LATEST + '/inbound');
51
+ await (0, apiHelpers_1.assertResponseStatus)(connectorsInboundList, 200);
52
+ });
53
+ (0, c8Run_8_10_1.test)('Search for tasks', async ({ request }) => {
54
+ const taskList = await request.post('/v2/user-tasks/search');
55
+ (0, test_1.expect)(taskList.status()).toBe(200);
56
+ });
57
+ });