fix(test): refresh token e2e enabled (#20862)

* fix(test): refresh token e2e enabled

* update config

* revert config changes

* revert config changes
This commit is contained in:
Chirag Madlani 2025-04-22 17:42:51 +05:30 committed by GitHub
parent 110e578d1c
commit 3fc0bdd23b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -11,7 +11,7 @@
* limitations under the License. * limitations under the License.
*/ */
export const JWT_EXPIRY_TIME_MAP = { export const JWT_EXPIRY_TIME_MAP = {
'3 minutes': 180, '2 minutes': 120,
'1 hour': 3600, '1 hour': 3600,
'2 hours': 7200, '2 hours': 7200,
'3 hours': 10800, '3 hours': 10800,

View File

@ -52,7 +52,7 @@ test.describe('Login flow should work properly', () => {
// update expiry for 3 mins // update expiry for 3 mins
await updateJWTTokenExpiryTime( await updateJWTTokenExpiryTime(
apiContext, apiContext,
JWT_EXPIRY_TIME_MAP['3 minutes'] JWT_EXPIRY_TIME_MAP['2 minutes']
); );
await afterAction(); await afterAction();
@ -140,7 +140,7 @@ test.describe('Login flow should work properly', () => {
await page.locator('[data-testid="go-back-button"]').click(); 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 browserContext = await browser.newContext();
const { apiContext, afterAction } = await performAdminLogin(browser); const { apiContext, afterAction } = await performAdminLogin(browser);
const page1 = await browserContext.newPage(), 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); await expect(page1.getByTestId('nav-user-name')).toContainText(/admin/i);
// Wait for token expiry // Wait for token expiry, kept 61 instead 60 so that ensure refresh API done withing timeframe
await page2.waitForTimeout(3 * 60 * 1000); await page2.waitForTimeout(2 * 61 * 1000);
await redirectToHomePage(page2); await redirectToHomePage(page2);