@camunda/e2e-test-suite 0.0.460 → 0.0.461

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.
@@ -8,7 +8,6 @@ declare class OperateHomePage {
8
8
  readonly variableValueInput: Locator;
9
9
  readonly saveVariableButton: Locator;
10
10
  readonly editVariableSpinner: Locator;
11
- readonly processPageHeading: Locator;
12
11
  constructor(page: Page);
13
12
  operateBannerIsVisible(): Promise<void>;
14
13
  clickProcessesTab(): Promise<void>;
@@ -2,8 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OperateHomePage = void 0;
4
4
  const test_1 = require("@playwright/test");
5
- const clickLocatorWithRetry_1 = require("../../utils/assertionHelpers/clickLocatorWithRetry");
6
- const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
7
5
  class OperateHomePage {
8
6
  page;
9
7
  operateBanner;
@@ -13,7 +11,6 @@ class OperateHomePage {
13
11
  variableValueInput;
14
12
  saveVariableButton;
15
13
  editVariableSpinner;
16
- processPageHeading;
17
14
  constructor(page) {
18
15
  this.page = page;
19
16
  this.operateBanner = page.getByRole('link', { name: 'Camunda logo Operate' });
@@ -28,25 +25,24 @@ class OperateHomePage {
28
25
  .getByTestId('variable-operation-spinner')
29
26
  .locator('circle')
30
27
  .nth(1);
31
- this.processPageHeading = page
32
- .getByTestId('expanded-panel')
33
- .getByRole('heading', { name: 'Process' });
34
28
  }
35
29
  async operateBannerIsVisible() {
36
- await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.operateBanner, {
37
- postAction: async () => {
38
- await this.page.reload();
39
- },
40
- });
30
+ await (0, test_1.expect)(this.operateBanner).toBeVisible({ timeout: 30000 });
41
31
  }
42
32
  async clickProcessesTab() {
43
- await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.processesTab);
44
- await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(this.page, this.processPageHeading, {
45
- preAction: async () => {
46
- await (0, test_1.expect)(this.processesTab).toBeVisible({ timeout: 10000 });
47
- await this.processesTab.click({ timeout: 10000 });
48
- },
49
- });
33
+ const maxRetries = 3;
34
+ for (let retries = 0; retries < maxRetries; retries++) {
35
+ try {
36
+ await (0, test_1.expect)(this.processesTab).toBeVisible({ timeout: 30000 });
37
+ await this.processesTab.click({ timeout: 30000 });
38
+ await (0, test_1.expect)(this.page.locator('label').filter({ hasText: 'Completed' }).first()).toBeVisible();
39
+ return;
40
+ }
41
+ catch (error) {
42
+ console.warn(`Click attempt ${retries + 1} failed: ${error}`);
43
+ }
44
+ }
45
+ throw new Error(`Failed to click the processes tab after ${maxRetries} attempts.`);
50
46
  }
51
47
  async clickEditVariableButton(variableName) {
52
48
  const editVariableButton = 'Edit variable ' + variableName;
@@ -4,7 +4,6 @@ declare class OperateLoginPage {
4
4
  readonly usernameInput: Locator;
5
5
  readonly passwordInput: Locator;
6
6
  readonly loginButton: Locator;
7
- readonly backupLogin: Locator;
8
7
  constructor(page: Page);
9
8
  fillUsername(username: string): Promise<void>;
10
9
  clickUsername(): Promise<void>;
@@ -7,13 +7,11 @@ class OperateLoginPage {
7
7
  usernameInput;
8
8
  passwordInput;
9
9
  loginButton;
10
- backupLogin;
11
10
  constructor(page) {
12
11
  this.page = page;
13
12
  this.usernameInput = page.getByLabel('Username');
14
13
  this.passwordInput = page.getByRole('textbox', { name: 'password' });
15
14
  this.loginButton = page.getByRole('button', { name: 'Login' });
16
- this.backupLogin = page.getByRole('button', { name: 'Log in' });
17
15
  }
18
16
  async fillUsername(username) {
19
17
  await this.usernameInput.fill(username);
@@ -25,22 +23,15 @@ class OperateLoginPage {
25
23
  await this.passwordInput.fill(password);
26
24
  }
27
25
  async clickLoginButton() {
28
- const login = this.loginButton.or(this.backupLogin).first();
29
- await (0, test_1.expect)(login).toBeVisible({ timeout: 60000 });
30
- await login.click({ timeout: 60000 });
26
+ await this.loginButton.click({ timeout: 60000 });
31
27
  }
32
28
  async login(username, password) {
33
- try {
34
- await (0, test_1.expect)(this.usernameInput).toBeVisible();
35
- await (0, test_1.expect)(this.passwordInput).toBeVisible();
36
- await this.clickUsername();
37
- await this.fillUsername(username);
38
- await this.fillPassword(password);
39
- await this.clickLoginButton();
40
- }
41
- catch (error) {
42
- await (0, test_1.expect)(this.page.getByRole('link', { name: 'Camunda logo Operate' })).toBeVisible();
43
- }
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();
44
35
  }
45
36
  }
46
37
  exports.OperateLoginPage = OperateLoginPage;
@@ -6,15 +6,16 @@ declare class OperateProcessesPage {
6
6
  readonly processCompletedCheckbox: Locator;
7
7
  readonly processRunningInstancesCheckbox: Locator;
8
8
  readonly processIncidentsCheckbox: Locator;
9
- readonly processPageHeading: Locator;
10
9
  readonly noMatchingInstancesMessage: Locator;
11
10
  readonly processFinishedInstancesCheckbox: Locator;
11
+ readonly processNameFilteringPlaceHolder: Locator;
12
12
  constructor(page: Page);
13
13
  clickProcessActiveCheckbox(): Promise<void>;
14
14
  clickProcessCompletedCheckbox(): Promise<void>;
15
15
  clickProcessIncidentsCheckbox(): Promise<void>;
16
16
  clickRunningProcessInstancesCheckbox(): Promise<void>;
17
17
  clickFinishedProcessInstancesCheckbox(): Promise<void>;
18
+ fillProcessNameFilter(processName: string): Promise<void>;
18
19
  clickProcessInstanceLink(processName: string): Promise<void>;
19
20
  }
20
21
  export { OperateProcessesPage };
@@ -10,9 +10,9 @@ class OperateProcessesPage {
10
10
  processCompletedCheckbox;
11
11
  processRunningInstancesCheckbox;
12
12
  processIncidentsCheckbox;
13
- processPageHeading;
14
13
  noMatchingInstancesMessage;
15
14
  processFinishedInstancesCheckbox;
15
+ processNameFilteringPlaceHolder;
16
16
  constructor(page) {
17
17
  this.page = page;
18
18
  this.processResultCount = page.getByTestId('result-count');
@@ -28,25 +28,20 @@ class OperateProcessesPage {
28
28
  this.processIncidentsCheckbox = page
29
29
  .locator('label')
30
30
  .filter({ hasText: 'Incidents' });
31
- this.processPageHeading = page
32
- .getByTestId('expanded-panel')
33
- .getByRole('heading', { name: 'Process' });
34
31
  this.noMatchingInstancesMessage = page.getByText('There are no Instances matching this filter set');
35
32
  this.processFinishedInstancesCheckbox = page
36
33
  .getByTestId('filter-finished-instances')
37
34
  .getByRole('checkbox');
35
+ this.processNameFilteringPlaceHolder = this.page.getByPlaceholder('Search by Process Name');
38
36
  }
39
37
  async clickProcessActiveCheckbox() {
40
38
  await this.processActiveCheckbox.click();
41
39
  }
42
40
  async clickProcessCompletedCheckbox() {
43
41
  await (0, sleep_1.sleep)(5000);
44
- await (0, test_1.expect)(this.processCompletedCheckbox).toBeVisible({
45
- timeout: 30000,
46
- });
47
42
  if (!(await this.processCompletedCheckbox.isChecked({ timeout: 60000 }))) {
48
43
  await this.processCompletedCheckbox.click({ timeout: 120000 });
49
- await (0, sleep_1.sleep)(2000);
44
+ await (0, sleep_1.sleep)(1000);
50
45
  }
51
46
  }
52
47
  async clickProcessIncidentsCheckbox() {
@@ -58,26 +53,33 @@ class OperateProcessesPage {
58
53
  async clickFinishedProcessInstancesCheckbox() {
59
54
  await this.processFinishedInstancesCheckbox.click({ timeout: 90000 });
60
55
  }
56
+ async fillProcessNameFilter(processName) {
57
+ await this.processNameFilteringPlaceHolder.click({ timeout: 30000 });
58
+ await this.processNameFilteringPlaceHolder.fill(processName);
59
+ await this.processNameFilteringPlaceHolder.press('Enter');
60
+ }
61
61
  async clickProcessInstanceLink(processName) {
62
62
  let retryCount = 0;
63
- const maxRetries = 3;
63
+ const maxRetries = 5;
64
64
  while (retryCount < maxRetries) {
65
65
  try {
66
- await this.page.reload();
67
- await this.page
66
+ const link = this.page
68
67
  .getByRole('row')
69
68
  .filter({ hasText: new RegExp(`^Select row${processName}\\d+.*$`) })
70
69
  .first()
71
- .getByRole('link')
72
- .click({ timeout: 30000 });
73
- return; // Exit the function if the click is successful
70
+ .getByRole('link');
71
+ await (0, test_1.expect)(link).toBeVisible({ timeout: 20000 });
72
+ await link.click({ timeout: 30000 });
73
+ return;
74
74
  }
75
75
  catch (error) {
76
- // If process isn't found, reload the page and try again
77
76
  retryCount++;
78
- console.log(`Attempt ${retryCount} failed. Retrying...`);
77
+ console.log(`Attempt ${retryCount} failed. Retrying...` + error);
79
78
  await this.page.reload();
80
79
  await (0, sleep_1.sleep)(10000);
80
+ if (retryCount >= 3) {
81
+ await this.fillProcessNameFilter(processName);
82
+ }
81
83
  }
82
84
  }
83
85
  throw new Error(`Failed to click on process instance link after ${maxRetries} attempts.`);
@@ -4,7 +4,6 @@ declare class TaskListLoginPage {
4
4
  readonly usernameInput: Locator;
5
5
  readonly passwordInput: Locator;
6
6
  readonly loginButton: Locator;
7
- readonly backupLogin: Locator;
8
7
  constructor(page: Page);
9
8
  fillUsername(username: string): Promise<void>;
10
9
  clickUsername(): Promise<void>;
@@ -7,13 +7,11 @@ class TaskListLoginPage {
7
7
  usernameInput;
8
8
  passwordInput;
9
9
  loginButton;
10
- backupLogin;
11
10
  constructor(page) {
12
11
  this.page = page;
13
12
  this.usernameInput = page.getByLabel('Username');
14
13
  this.passwordInput = page.getByRole('textbox', { name: 'password' });
15
14
  this.loginButton = page.getByRole('button', { name: 'Login' });
16
- this.backupLogin = page.getByRole('button', { name: 'Log in' });
17
15
  }
18
16
  async fillUsername(username) {
19
17
  await this.usernameInput.fill(username);
@@ -25,22 +23,15 @@ class TaskListLoginPage {
25
23
  await this.passwordInput.fill(password);
26
24
  }
27
25
  async clickLoginButton() {
28
- const login = this.loginButton.or(this.backupLogin).first();
29
- await (0, test_1.expect)(login).toBeVisible({ timeout: 60000 });
30
- await login.click({ timeout: 60000 });
26
+ await this.loginButton.click({ timeout: 60000 });
31
27
  }
32
28
  async login(username, password) {
33
- try {
34
- await (0, test_1.expect)(this.usernameInput).toBeVisible();
35
- await (0, test_1.expect)(this.passwordInput).toBeVisible();
36
- await this.clickUsername();
37
- await this.fillUsername(username);
38
- await this.fillPassword(password);
39
- await this.clickLoginButton();
40
- }
41
- catch (error) {
42
- await (0, test_1.expect)(this.page.getByRole('link', { name: 'Camunda logo Tasklist' })).toBeVisible();
43
- }
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();
44
35
  }
45
36
  }
46
37
  exports.TaskListLoginPage = TaskListLoginPage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.460",
3
+ "version": "0.0.461",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",