@camunda/e2e-test-suite 0.0.1614 → 0.0.1616

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.
@@ -98,11 +98,16 @@ class KeycloakAdminPage {
98
98
  .locator('label.pf-v5-c-switch[for="temporaryPassword"]')
99
99
  .click();
100
100
  await this.page.getByTestId('confirm').click();
101
+ // The second confirm fires PUT .../users/<id>/reset-password. Returning
102
+ // right after the click let the caller navigate away (goToIdentity) and
103
+ // abort that request, leaving the user with no password, so every later
104
+ // login as that user failed with "Please enter a valid username or
105
+ // password". Wait for Keycloak to acknowledge the reset instead.
106
+ const resetPasswordResponse = this.page.waitForResponse((response) => response.url().includes('/reset-password') &&
107
+ response.request().method() === 'PUT', { timeout: 30000 });
101
108
  await this.page.getByTestId('confirm').click();
102
- // if the browser is firefox, delay for 500 ms
103
- if (await this.page.evaluate(() => navigator.userAgent.includes('Firefox'))) {
104
- await (0, sleep_1.sleep)(500);
105
- }
109
+ const response = await resetPasswordResponse;
110
+ (0, test_1.expect)(response.ok(), `Keycloak reset-password returned HTTP ${response.status()}`).toBe(true);
106
111
  }
107
112
  }
108
113
  exports.KeycloakAdminPage = KeycloakAdminPage;
@@ -38,6 +38,7 @@ declare class IdentityTenantPage {
38
38
  clickRemoveButton(): Promise<void>;
39
39
  createTenant(tenantName: string): Promise<void>;
40
40
  clickTenant(tenantName: string): Promise<void>;
41
+ private isTenantDetailsOpen;
41
42
  private isRowVisible;
42
43
  assignUserToTenant(tenantName: string, user: string, userEmail: string): Promise<void>;
43
44
  removeUserFromTenant(tenantName: string): Promise<void>;
@@ -158,6 +158,13 @@ class IdentityTenantPage {
158
158
  for (let attempt = 1; attempt <= maxRetries; attempt++) {
159
159
  try {
160
160
  await this.page.waitForLoadState('domcontentloaded').catch(() => { });
161
+ // A failed assignUserToTenant attempt reloads the tenant *details*
162
+ // page, which has no tenants list. Its "Name | Default" row matches
163
+ // this.row() but has no clickable list cell, so every retry timed
164
+ // out. If the tenant is already open, there is nothing to click.
165
+ if (await this.isTenantDetailsOpen(tenantName)) {
166
+ return;
167
+ }
161
168
  const tenantRow = this.row(tenantName);
162
169
  await (0, expectLocatorWithPagination_1.expectLocatorWithPagination)(this.page, tenantRow);
163
170
  await tenantRow.locator('td').first().click({ timeout: 30000 });
@@ -174,6 +181,14 @@ class IdentityTenantPage {
174
181
  }
175
182
  }
176
183
  }
184
+ async isTenantDetailsOpen(tenantName) {
185
+ const heading = this.page.getByRole('heading', {
186
+ level: 1,
187
+ name: tenantName,
188
+ exact: true,
189
+ });
190
+ return (await heading.isVisible()) && (await this.usersTab.isVisible());
191
+ }
177
192
  async isRowVisible(name) {
178
193
  await (0, sleep_1.sleep)(1000);
179
194
  if (await this.row(name).isVisible()) {
@@ -38,6 +38,7 @@ declare class IdentityTenantPage {
38
38
  clickRemoveButton(): Promise<void>;
39
39
  createTenant(tenantName: string): Promise<void>;
40
40
  clickTenant(tenantName: string): Promise<void>;
41
+ private isTenantDetailsOpen;
41
42
  private isRowVisible;
42
43
  assignUserToTenant(tenantName: string, user: string, userEmail: string): Promise<void>;
43
44
  removeUserFromTenant(tenantName: string): Promise<void>;
@@ -158,6 +158,13 @@ class IdentityTenantPage {
158
158
  for (let attempt = 1; attempt <= maxRetries; attempt++) {
159
159
  try {
160
160
  await this.page.waitForLoadState('domcontentloaded').catch(() => { });
161
+ // A failed assignUserToTenant attempt reloads the tenant *details*
162
+ // page, which has no tenants list. Its "Name | Default" row matches
163
+ // this.row() but has no clickable list cell, so every retry timed
164
+ // out. If the tenant is already open, there is nothing to click.
165
+ if (await this.isTenantDetailsOpen(tenantName)) {
166
+ return;
167
+ }
161
168
  const tenantRow = this.row(tenantName);
162
169
  await (0, expectLocatorWithPagination_1.expectLocatorWithPagination)(this.page, tenantRow);
163
170
  await tenantRow.locator('td').first().click({ timeout: 30000 });
@@ -174,6 +181,14 @@ class IdentityTenantPage {
174
181
  }
175
182
  }
176
183
  }
184
+ async isTenantDetailsOpen(tenantName) {
185
+ const heading = this.page.getByRole('heading', {
186
+ level: 1,
187
+ name: tenantName,
188
+ exact: true,
189
+ });
190
+ return (await heading.isVisible()) && (await this.usersTab.isVisible());
191
+ }
177
192
  async isRowVisible(name) {
178
193
  await (0, sleep_1.sleep)(1000);
179
194
  if (await this.row(name).isVisible()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1614",
3
+ "version": "0.0.1616",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",