From 3fc0bdd23b9fa0e8023c686a25ebf934cef60f1c Mon Sep 17 00:00:00 2001 From: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> Date: Tue, 22 Apr 2025 17:42:51 +0530 Subject: [PATCH] fix(test): refresh token e2e enabled (#20862) * fix(test): refresh token e2e enabled * update config * revert config changes * revert config changes --- .../src/main/resources/ui/playwright/constant/login.ts | 2 +- .../main/resources/ui/playwright/e2e/Pages/Login.spec.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/constant/login.ts b/openmetadata-ui/src/main/resources/ui/playwright/constant/login.ts index d71e9ae8614..b5ab13475f5 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/constant/login.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/constant/login.ts @@ -11,7 +11,7 @@ * limitations under the License. */ export const JWT_EXPIRY_TIME_MAP = { - '3 minutes': 180, + '2 minutes': 120, '1 hour': 3600, '2 hours': 7200, '3 hours': 10800, diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Login.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Login.spec.ts index 46d1baa9129..a90433cd1e9 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Login.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Login.spec.ts @@ -52,7 +52,7 @@ test.describe('Login flow should work properly', () => { // update expiry for 3 mins await updateJWTTokenExpiryTime( apiContext, - JWT_EXPIRY_TIME_MAP['3 minutes'] + JWT_EXPIRY_TIME_MAP['2 minutes'] ); await afterAction(); @@ -140,7 +140,7 @@ test.describe('Login flow should work properly', () => { await page.locator('[data-testid="go-back-button"]').click(); }); - test.fixme('Refresh should work', async ({ browser }) => { + test('Refresh should work', async ({ browser }) => { const browserContext = await browser.newContext(); const { apiContext, afterAction } = await performAdminLogin(browser); const page1 = await browserContext.newPage(), @@ -188,8 +188,8 @@ test.describe('Login flow should work properly', () => { await expect(page1.getByTestId('nav-user-name')).toContainText(/admin/i); - // Wait for token expiry - await page2.waitForTimeout(3 * 60 * 1000); + // Wait for token expiry, kept 61 instead 60 so that ensure refresh API done withing timeframe + await page2.waitForTimeout(2 * 61 * 1000); await redirectToHomePage(page2);