From b68ae69ef0cd39e6086b45b765893d04c60c17a4 Mon Sep 17 00:00:00 2001 From: Shrushti Polekar Date: Wed, 6 Aug 2025 10:08:51 +0530 Subject: [PATCH] fix login test failure (#22753) --- .../e2e/Pages/LoginConfiguration.spec.ts | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/LoginConfiguration.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/LoginConfiguration.spec.ts index a90da17b68c..2fdf1551ce0 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/LoginConfiguration.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/LoginConfiguration.spec.ts @@ -28,18 +28,34 @@ test.describe('Login configuration', () => { // Click the edit button await page.click('[data-testid="edit-button"]'); - // Update JWT Token Expiry Time - await page.fill('[data-testid="jwtTokenExpiryTime"]', '5000'); + // Clear and update JWT Token Expiry Time + await page.locator('[data-testid="jwtTokenExpiryTime"]').clear(); + await page.locator('[data-testid="jwtTokenExpiryTime"]').fill('5000'); + await page.locator('[data-testid="jwtTokenExpiryTime"]').press('Tab'); - // Update Access Block Time - await page.fill('[data-testid="accessBlockTime"]', '500'); + // Clear and update Access Block Time + await page.locator('[data-testid="accessBlockTime"]').clear(); + await page.locator('[data-testid="accessBlockTime"]').fill('500'); + await page.locator('[data-testid="accessBlockTime"]').press('Tab'); - // Update Max Login Fail Attempts - await page.fill('[data-testid="maxLoginFailAttempts"]', '5'); + // Clear and update Max Login Fail Attempts + await page.locator('[data-testid="maxLoginFailAttempts"]').clear(); + await page.locator('[data-testid="maxLoginFailAttempts"]').fill('5'); + await page.locator('[data-testid="maxLoginFailAttempts"]').press('Tab'); + + // Wait for the settings API call to complete + const settingsResponsePromise = page.waitForResponse( + '/api/v1/system/settings' + ); // Click the save button await page.click('[data-testid="save-button"]'); + // Wait for the API response to complete + await settingsResponsePromise; + + await page.waitForLoadState('networkidle'); + // Assert the updated values await expect( page.locator('[data-testid="max-login-fail-attampts"]')