@camunda/e2e-test-suite 0.0.562 → 0.0.563

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.
@@ -13,7 +13,7 @@ declare class KeycloakAdminPage {
13
13
  clickAddUser(): Promise<void>;
14
14
  fillUser(username: string): Promise<void>;
15
15
  saveUser(): Promise<void>;
16
- fillPassword(password: string): Promise<void>;
16
+ fillPassword(password: string, maxRetries?: number): Promise<void>;
17
17
  savePassword(): Promise<void>;
18
18
  }
19
19
  export { KeycloakAdminPage };
@@ -69,15 +69,29 @@ class KeycloakAdminPage {
69
69
  async saveUser() {
70
70
  await this.page.getByTestId('user-creation-save').click();
71
71
  }
72
- async fillPassword(password) {
73
- await (0, test_1.expect)(this.credentialsTab).toBeVisible();
74
- await this.credentialsTab.click();
75
- await (0, test_1.expect)(this.noCredentialsEmptyAction).toBeVisible({ timeout: 60000 });
76
- await this.noCredentialsEmptyAction.click();
77
- await (0, test_1.expect)(this.passwordField).toBeVisible();
78
- await this.passwordField.fill(password);
79
- await (0, test_1.expect)(this.passwordConfirmationField).toBeVisible();
80
- await this.passwordConfirmationField.fill(password);
72
+ async fillPassword(password, maxRetries = 3) {
73
+ for (let attempt = 1; attempt <= maxRetries; attempt++) {
74
+ try {
75
+ await (0, test_1.expect)(this.credentialsTab).toBeVisible();
76
+ await this.credentialsTab.click();
77
+ await (0, test_1.expect)(this.noCredentialsEmptyAction).toBeVisible({
78
+ timeout: 60000,
79
+ });
80
+ await this.noCredentialsEmptyAction.click();
81
+ await (0, test_1.expect)(this.passwordField).toBeVisible();
82
+ await this.passwordField.fill(password);
83
+ await (0, test_1.expect)(this.passwordConfirmationField).toBeVisible();
84
+ await this.passwordConfirmationField.fill(password);
85
+ return;
86
+ }
87
+ catch (error) {
88
+ if (attempt === maxRetries) {
89
+ throw new Error(`fillPassword failed after ${maxRetries} attempts: ${error}`);
90
+ }
91
+ console.warn(`fillPassword attempt ${attempt} failed: ${error}. Retrying...`);
92
+ await (0, sleep_1.sleep)(3000);
93
+ }
94
+ }
81
95
  }
82
96
  async savePassword() {
83
97
  await this.page
@@ -5,7 +5,7 @@ declare class KeycloakLoginPage {
5
5
  constructor(page: Page);
6
6
  toBeVisible(): Promise<void>;
7
7
  fillUsername(username: string): Promise<void>;
8
- fillPassword(password: string): Promise<void>;
8
+ fillPassword(password: string, maxRetries?: number): Promise<void>;
9
9
  clickLogin(): Promise<void>;
10
10
  }
11
11
  export { KeycloakLoginPage };
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.KeycloakLoginPage = void 0;
4
4
  const test_1 = require("@playwright/test");
5
+ const sleep_1 = require("../../utils/sleep");
5
6
  class KeycloakLoginPage {
6
7
  page;
7
8
  keycloakBanner;
@@ -15,8 +16,20 @@ class KeycloakLoginPage {
15
16
  async fillUsername(username) {
16
17
  await this.page.fill('#username', username);
17
18
  }
18
- async fillPassword(password) {
19
- await this.page.fill('#password', password);
19
+ async fillPassword(password, maxRetries = 3) {
20
+ for (let attempt = 1; attempt <= maxRetries; attempt++) {
21
+ try {
22
+ await this.page.fill('#password', password);
23
+ return;
24
+ }
25
+ catch (error) {
26
+ if (attempt === maxRetries) {
27
+ throw new Error(`fillPassword failed after ${maxRetries} attempts: ${error}`);
28
+ }
29
+ console.warn(`fillPassword attempt ${attempt} failed: ${error}. Retrying...`);
30
+ await (0, sleep_1.sleep)(3000);
31
+ }
32
+ }
20
33
  }
21
34
  async clickLogin() {
22
35
  await this.page.click('button[type="submit"]');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.562",
3
+ "version": "0.0.563",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",