@camunda/e2e-test-suite 0.0.478 → 0.0.479

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.
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IdentityTenantPage = void 0;
4
4
  const test_1 = require("@playwright/test");
5
5
  const sleep_1 = require("../../utils/sleep");
6
- const UtilitiesPage_1 = require("../SM-8.8/UtilitiesPage");
6
+ const expectLocatorWithPagination_1 = require("../../utils/assertionHelpers/expectLocatorWithPagination");
7
+ const clickLocatorWithRetry_1 = require("../../utils/assertionHelpers/clickLocatorWithRetry");
7
8
  class IdentityTenantPage {
8
9
  page;
9
10
  createTenantMainButton;
@@ -43,7 +44,7 @@ class IdentityTenantPage {
43
44
  this.assignUsersButton = page.getByRole('button', { name: 'Assign users' });
44
45
  this.searchUsersInput = page.getByPlaceholder('Search users');
45
46
  this.assignUserFinalButton = page
46
- .getByLabel('Assign users')
47
+ .getByRole('dialog', { name: 'Assign users' })
47
48
  .getByRole('button', { name: 'Assign users' });
48
49
  this.removeUserButton = page.getByLabel('Remove user');
49
50
  this.removeButton = page.getByRole('button', { name: 'danger Remove' });
@@ -91,8 +92,11 @@ class IdentityTenantPage {
91
92
  await this.enterTenantIdInput.fill(tenantId);
92
93
  }
93
94
  async clickAssignedUsersTab() {
94
- await (0, test_1.expect)(this.assignedUsersTab).toBeVisible({ timeout: 60000 });
95
- await this.assignedUsersTab.click({ timeout: 60000 });
95
+ await (0, clickLocatorWithRetry_1.clickLocatorWithRetry)(this.page, this.assignedUsersTab, {
96
+ postAction: async () => {
97
+ await this.page.reload();
98
+ },
99
+ });
96
100
  }
97
101
  async clickAssignUsersButton() {
98
102
  await (0, test_1.expect)(this.assignUsersButton).toBeVisible({ timeout: 60000 });
@@ -108,13 +112,10 @@ class IdentityTenantPage {
108
112
  try {
109
113
  await (0, test_1.expect)(this.assignUserFinalButton).toBeVisible({ timeout: 60000 });
110
114
  await this.assignUserFinalButton.click();
111
- await (0, test_1.expect)(this.page.getByText('Users assigned')).toBeVisible();
115
+ await (0, test_1.expect)(this.page.getByText('Users assigned', { exact: true })).toBeVisible();
112
116
  }
113
117
  catch (e) {
114
- if (await this.page
115
- .getByText('ALREADY_EXISTS')
116
- .first()
117
- .isVisible({ timeout: 8000 })) {
118
+ if (await this.page.getByText('ALREADY_EXISTS').first().isVisible()) {
118
119
  console.log('Tenant is already assigned to tenant');
119
120
  await this.cancelButton.click();
120
121
  await (0, test_1.expect)(this.dialog).not.toBeVisible({ timeout: 15000 });
@@ -151,7 +152,7 @@ class IdentityTenantPage {
151
152
  try {
152
153
  await this.page.waitForLoadState('domcontentloaded').catch(() => { });
153
154
  const tenantRow = this.row(tenantName);
154
- await (0, UtilitiesPage_1.assertLocatorVisibleWithPaginated)(this.page, tenantRow, `Tenant with name ${tenantName} not found`);
155
+ await (0, expectLocatorWithPagination_1.expectLocatorWithPagination)(this.page, tenantRow);
155
156
  await tenantRow.locator('td').first().click({ timeout: 30000 });
156
157
  await this.usersTab.waitFor({ state: 'visible', timeout: 30000 });
157
158
  return;
@@ -185,7 +186,7 @@ class IdentityTenantPage {
185
186
  await this.clickSearchUsersInput();
186
187
  await this.fillSearchUsersInput(user);
187
188
  await (0, test_1.expect)(this.page.getByText(userEmail)).toBeVisible({ timeout: 30000 });
188
- await this.page.getByText(userEmail).click();
189
+ await this.page.getByText(userEmail).click({ timeout: 30000 });
189
190
  await this.clickAssignUserFinalButton();
190
191
  }
191
192
  async removeUserFromTenant(tenantName) {
@@ -29,6 +29,7 @@ class NavigationPage {
29
29
  this.optimizePageBanner = page.getByRole('link', {
30
30
  name: 'Camunda logo Optimize',
31
31
  });
32
+ // TODO: Drop support for Identity once we fully rename it to Admin
32
33
  this.identityPageBanner = page
33
34
  .locator('a')
34
35
  .filter({ hasText: /^Camunda logo\s*(Identity|Admin)$/ })
@@ -36,31 +37,39 @@ class NavigationPage {
36
37
  this.consolePageBanner = page.getByRole('link', {
37
38
  name: 'Camunda logo Console',
38
39
  });
39
- this.managementIdentityPageBanner = page.getByRole('link', {
40
- name: 'Camunda logo Management Identity',
41
- });
40
+ this.managementIdentityPageBanner = page
41
+ .locator('a')
42
+ .filter({ hasText: /^Camunda logo\s*Management Identity$/ })
43
+ .first();
42
44
  this.keyboardPageBanner = page.locator('#keycloak-bg');
43
45
  }
44
46
  async goTo(url, banner, sleepTimeout, { username = 'demo', password = process.env.DISTRO_QA_E2E_TESTS_IDENTITY_FIRSTUSER_PASSWORD ??
45
47
  'demo', } = {}, maxRetries = 3) {
46
48
  const startTime = Date.now();
47
- let timeout = constants_1._1_SECOND_IN_MS * 1;
49
+ let timeout = constants_1._1_SECOND_IN_MS * 10;
48
50
  if (url === '/modeler') {
49
- timeout = constants_1._1_SECOND_IN_MS * 10;
51
+ timeout = constants_1._1_SECOND_IN_MS * 20;
50
52
  }
51
53
  for (let attempt = 0; attempt < maxRetries; attempt++) {
52
54
  try {
53
55
  if (sleepTimeout) {
54
56
  await (0, sleep_1.sleep)(sleepTimeout);
55
57
  }
56
- await this.page.goto(url, { timeout: 10000 });
58
+ await this.page.goto(url, {
59
+ timeout: 30000,
60
+ waitUntil: 'domcontentloaded',
61
+ });
57
62
  const loginPage = new LoginPage_1.LoginPage(this.page);
58
- const loginSelector = loginPage.usernameInput;
59
- await (0, test_1.expect)(banner.or(loginSelector)).toBeVisible();
60
- const isBannerVisible = await banner.isVisible();
63
+ const loginEntryPoint = banner
64
+ .or(loginPage.usernameInput)
65
+ .or(loginPage.coreUsernameInput)
66
+ .or(loginPage.keycloakBanner)
67
+ .first();
68
+ await (0, test_1.expect)(loginEntryPoint).toBeVisible({ timeout: 30000 });
69
+ const isBannerVisible = await banner.isVisible().catch(() => false);
61
70
  if (isBannerVisible) {
62
71
  try {
63
- await (0, test_1.expect)(loginSelector).toBeVisible({ timeout: 5000 });
72
+ await (0, test_1.expect)(loginPage.usernameInput).toBeVisible({ timeout: 5000 });
64
73
  await loginPage.login(username, password);
65
74
  }
66
75
  catch (error) {
@@ -71,6 +80,7 @@ class NavigationPage {
71
80
  else {
72
81
  await loginPage.login(username, password);
73
82
  }
83
+ await (0, test_1.expect)(banner).toBeVisible({ timeout: 60000 });
74
84
  return;
75
85
  }
76
86
  catch (error) {
@@ -160,7 +160,8 @@ class OCIdentityRolesPage {
160
160
  await this.clickAssignUserSubButton();
161
161
  }
162
162
  async clickAssignUserButton() {
163
- await this.assignUserButton.click();
163
+ await (0, test_1.expect)(this.assignUserButton).toBeVisible({ timeout: 60000 });
164
+ await this.assignUserButton.click({ timeout: 60000 });
164
165
  }
165
166
  async clickUsernameTextbox() {
166
167
  await this.usernameTextBox.click();
@@ -172,6 +173,7 @@ class OCIdentityRolesPage {
172
173
  await this.assignUserSubButton.click();
173
174
  }
174
175
  async clickAdminRole() {
176
+ await (0, test_1.expect)(this.adminRole).toBeVisible({ timeout: 60000 });
175
177
  await this.adminRole.click();
176
178
  }
177
179
  async clickClientsTab() {
@@ -24,6 +24,7 @@ declare class OCTenantPage {
24
24
  readonly roleIdSearchBox: Locator;
25
25
  readonly assignRoleSubButton: Locator;
26
26
  readonly cancelButton: Locator;
27
+ readonly gotItButton: Locator;
27
28
  readonly row: (name: string) => Locator;
28
29
  constructor(page: Page);
29
30
  clickCreateTenantMainButton(): Promise<void>;
@@ -44,6 +45,7 @@ declare class OCTenantPage {
44
45
  createTenant(tenantName: string): Promise<void>;
45
46
  assertTenantCreated(): Promise<void>;
46
47
  clickCancelButton(): Promise<void>;
48
+ clickGotItButton(): Promise<void>;
47
49
  clickTenant(tenantName: string): Promise<void>;
48
50
  assignUserToTenant(user: string): Promise<void>;
49
51
  removeUserFromTenant(tenantName: string): Promise<void>;
@@ -29,6 +29,7 @@ class OCTenantPage {
29
29
  roleIdSearchBox;
30
30
  assignRoleSubButton;
31
31
  cancelButton;
32
+ gotItButton;
32
33
  row;
33
34
  constructor(page) {
34
35
  this.page = page;
@@ -77,6 +78,7 @@ class OCTenantPage {
77
78
  this.cancelButton = page
78
79
  .getByRole('dialog')
79
80
  .getByRole('button', { name: 'Cancel' });
81
+ this.gotItButton = page.getByRole('button', { name: 'Got it' });
80
82
  this.row = (name) => this.page.getByRole('row').filter({ hasText: name }).first();
81
83
  }
82
84
  async clickCreateTenantMainButton() {
@@ -115,10 +117,7 @@ class OCTenantPage {
115
117
  await (0, test_1.expect)(this.page.getByRole('dialog')).not.toBeVisible();
116
118
  }
117
119
  catch (e) {
118
- if (await this.page
119
- .getByText('ALREADY_EXISTS')
120
- .first()
121
- .isVisible({ timeout: 10000 })) {
120
+ if (await this.page.getByText('ALREADY_EXISTS').first().isVisible()) {
122
121
  console.log('User is already assigned to tenant');
123
122
  await this.clickCancelButton();
124
123
  }
@@ -152,25 +151,32 @@ class OCTenantPage {
152
151
  }
153
152
  async assertTenantCreated() {
154
153
  try {
155
- await (0, test_1.expect)(this.page.getByText('Tenant created')).toBeVisible({
154
+ await (0, test_1.expect)(this.page.getByText('successfully created')).toBeVisible({
156
155
  timeout: 8000,
157
156
  });
157
+ // "Got it" button appears in some versions but not others
158
+ try {
159
+ await this.clickGotItButton();
160
+ }
161
+ catch {
162
+ // Button not present in this version, continue
163
+ }
158
164
  }
159
165
  catch (error) {
160
- if (await this.page
161
- .getByText('ALREADY_EXISTS')
162
- .first()
163
- .isVisible({ timeout: 8000 })) {
166
+ if (await this.page.getByText('ALREADY_EXISTS').first().isVisible()) {
164
167
  await this.clickCancelButton();
165
168
  }
166
169
  else {
167
- throw new Error('Assigning user to tenant failed' + error);
170
+ throw new Error('Creating tenant failed' + error);
168
171
  }
169
172
  }
170
173
  }
171
174
  async clickCancelButton() {
172
175
  await this.cancelButton.click({ timeout: 30000 });
173
176
  }
177
+ async clickGotItButton() {
178
+ await this.gotItButton.click({ timeout: 30000 });
179
+ }
174
180
  async clickTenant(tenantName) {
175
181
  const maxRetries = 10;
176
182
  for (let attempt = 1; attempt <= maxRetries; attempt++) {
@@ -6,6 +6,7 @@ const _setup_1 = require("../../test-setup.js");
6
6
  const UtilitiesPage_1 = require("../../pages/SM-8.8/UtilitiesPage");
7
7
  const resetSession_1 = require("../../utils/resetSession");
8
8
  const expectTextWithRetry_1 = require("../../utils/assertionHelpers/expectTextWithRetry");
9
+ const expectLocatorWithRetry_1 = require("../../utils/assertionHelpers/expectLocatorWithRetry");
9
10
  const demoUserEmail = process.env.DEMO_USER_EMAIL || 'demo@example.org';
10
11
  const demoUserDisplayText = `Demo User${demoUserEmail}`;
11
12
  if (process.env.IS_MT === 'true') {
@@ -49,7 +50,7 @@ if (process.env.IS_MT === 'true') {
49
50
  });
50
51
  await SM_8_8_1.test.step('Open Cross Component Test Project', async () => {
51
52
  await navigationPage.goToModeler();
52
- await modelerHomePage.clickCrossComponentProjectFolder();
53
+ await modelerHomePage.createCrossComponentProjectFolder();
53
54
  await modelerHomePage.clickDiagramTypeDropdown();
54
55
  await modelerHomePage.clickBpmnTemplateOption();
55
56
  });
@@ -490,7 +491,7 @@ if (process.env.IS_MT === 'true') {
490
491
  });
491
492
  await SM_8_8_1.test.step('Open Cross Component Test Project', async () => {
492
493
  await navigationPage.goToModeler();
493
- await modelerHomePage.clickCrossComponentProjectFolder();
494
+ await modelerHomePage.createCrossComponentProjectFolder();
494
495
  await modelerHomePage.clickDiagramTypeDropdown();
495
496
  await modelerHomePage.clickBpmnTemplateOption();
496
497
  });
@@ -531,6 +532,11 @@ if (process.env.IS_MT === 'true') {
531
532
  }
532
533
  await SM_8_8_1.test.step('Delete Tenant Access For Demo User OC', async () => {
533
534
  await navigationPage.goToOCIdentity();
535
+ await (0, expectLocatorWithRetry_1.expectLocatorWithRetry)(page, ocIdentityHomePage.tenantsTab, {
536
+ postAction: async () => {
537
+ await navigationPage.goToOCIdentity();
538
+ },
539
+ });
534
540
  await ocIdentityHomePage.clickTenantsTab();
535
541
  await ocTenantPage.removeUserFromTenant(tenantName);
536
542
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.478",
3
+ "version": "0.0.479",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",