@camunda/e2e-test-suite 0.0.18 → 0.0.19

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.
@@ -127,7 +127,7 @@ class IdentityPage {
127
127
  await this.page
128
128
  .locator('td:right-of(:text("' + accessToDelete + '"))')
129
129
  .first()
130
- .click({ timeout: 60000 });
130
+ .click({ timeout: 1000 });
131
131
  }
132
132
  catch {
133
133
  console.log('Access already deleted');
@@ -135,7 +135,7 @@ class IdentityPage {
135
135
  }
136
136
  async clickConfirmDeleteButton() {
137
137
  try {
138
- await this.confirmDeleteButton.click();
138
+ await this.confirmDeleteButton.click({ timeout: 1000 });
139
139
  }
140
140
  catch {
141
141
  console.log('Access already deleted');
@@ -4,7 +4,12 @@ declare class LoginPage {
4
4
  readonly usernameInput: Locator;
5
5
  readonly passwordInput: Locator;
6
6
  readonly loginButton: Locator;
7
+ readonly keycloakUsernameInput: Locator;
8
+ readonly keycloakPasswordInput: Locator;
9
+ readonly keycloakLoginButton: Locator;
10
+ private useKeycloak;
7
11
  constructor(page: Page);
12
+ detectLoginForm(): Promise<void>;
8
13
  fillUsername(username: string): Promise<void>;
9
14
  clickUsername(): Promise<void>;
10
15
  fillPassword(password: string): Promise<void>;
@@ -7,23 +7,57 @@ class LoginPage {
7
7
  usernameInput;
8
8
  passwordInput;
9
9
  loginButton;
10
+ keycloakUsernameInput;
11
+ keycloakPasswordInput;
12
+ keycloakLoginButton;
13
+ useKeycloak = false;
10
14
  constructor(page) {
11
15
  this.page = page;
12
16
  this.usernameInput = page.getByLabel('Username or email');
17
+ this.keycloakUsernameInput = page.locator('#username');
18
+ this.keycloakPasswordInput = page.locator('#password');
19
+ this.keycloakLoginButton = page.locator('#kc-login');
13
20
  this.passwordInput = page.getByLabel('Password');
14
21
  this.loginButton = page.getByRole('button', { name: 'Log in' });
15
22
  }
23
+ async detectLoginForm() {
24
+ const winner = await Promise.race([
25
+ this.keycloakUsernameInput.waitFor({ state: 'visible' }).then(() => 'keycloak'),
26
+ this.usernameInput.waitFor({ state: 'visible' }).then(() => 'default'),
27
+ ]);
28
+ this.useKeycloak = winner === 'keycloak';
29
+ }
16
30
  async fillUsername(username) {
17
- await this.usernameInput.fill(username);
31
+ if (this.useKeycloak) {
32
+ await this.keycloakUsernameInput.fill(username);
33
+ }
34
+ else {
35
+ await this.usernameInput.fill(username);
36
+ }
18
37
  }
19
38
  async clickUsername() {
20
- await this.usernameInput.click({ timeout: 60000 });
39
+ if (this.useKeycloak) {
40
+ await this.keycloakUsernameInput.click({ timeout: 60000 });
41
+ }
42
+ else {
43
+ await this.usernameInput.click({ timeout: 60000 });
44
+ }
21
45
  }
22
46
  async fillPassword(password) {
23
- await this.passwordInput.fill(password);
47
+ if (this.useKeycloak) {
48
+ await this.keycloakPasswordInput.fill(process.env.DISTRO_QA_E2E_TESTS_KEYCLOAK_PASSWORD);
49
+ }
50
+ else {
51
+ await this.passwordInput.fill(password);
52
+ }
24
53
  }
25
54
  async clickLoginButton() {
26
- await this.loginButton.click({ timeout: 60000 });
55
+ if (this.useKeycloak) {
56
+ await this.keycloakLoginButton.click({ timeout: 60000 });
57
+ }
58
+ else {
59
+ await this.loginButton.click({ timeout: 60000 });
60
+ }
27
61
  }
28
62
  async login(username, password) {
29
63
  try {
@@ -32,10 +66,14 @@ class LoginPage {
32
66
  catch (error) {
33
67
  return;
34
68
  }
69
+ await this.detectLoginForm();
35
70
  await this.clickUsername();
36
71
  await this.fillUsername(username);
37
72
  await this.fillPassword(password);
38
- await (0, test_1.expect)(this.loginButton).toBeVisible({ timeout: 10000 });
73
+ Promise.race([
74
+ this.loginButton.waitFor({ state: 'visible' }).then(() => 'default'),
75
+ this.keycloakLoginButton.waitFor({ state: 'visible' }).then(() => 'keycloak'),
76
+ ]);
39
77
  await this.clickLoginButton();
40
78
  }
41
79
  }
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const test_1 = require("@playwright/test");
4
4
  const SM_8_7_1 = require("../../fixtures/SM-8.7");
5
5
  const _setup_1 = require("../../test-setup.js");
6
- const sleep_1 = require("../../utils/sleep");
7
6
  const UtlitiesPage_1 = require("../../pages/SM-8.7/UtlitiesPage");
8
7
  const env_1 = require("../../utils/env");
9
8
  SM_8_7_1.test.describe('SM Setup Tests', () => {
@@ -49,7 +48,6 @@ SM_8_7_1.test.describe('SM Setup Tests', () => {
49
48
  await identityPage.clickConfirmDeleteButton();
50
49
  await identityPage.clickDeleteAccessButton('Grants full access to Console');
51
50
  await identityPage.clickConfirmDeleteButton();
52
- await (0, sleep_1.sleep)(50000);
53
51
  });
54
52
  await SM_8_7_1.test.step('Ensure Apps are not Accessible', async () => {
55
53
  //No permission for Optimize
@@ -102,7 +100,6 @@ SM_8_7_1.test.describe('SM Setup Tests', () => {
102
100
  await identityPage.clickModelerCheckbox();
103
101
  await identityPage.clickConsoleCheckbox();
104
102
  await identityPage.clickAddButton();
105
- await (0, sleep_1.sleep)(60000);
106
103
  });
107
104
  await SM_8_7_1.test.step('Ensure Apps are Accessible', async () => {
108
105
  await navigationPage.goToOperate();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [