From 99502df8535d37af331991be6d50f2925a6c50f0 Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Tue, 23 Jan 2024 13:08:43 +0530 Subject: [PATCH] test: remove user before retry Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- tests/playwright/pages/Account/Users.ts | 3 ++- .../tests/db/usersAccounts/accountUserManagement.spec.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/playwright/pages/Account/Users.ts b/tests/playwright/pages/Account/Users.ts index 349e310e43..af2d6b2c9e 100644 --- a/tests/playwright/pages/Account/Users.ts +++ b/tests/playwright/pages/Account/Users.ts @@ -50,7 +50,8 @@ export class AccountUsersPage extends BasePage { await this.verifyToast({ message: 'Successfully added user' }); // TODO: Wait on the invite api and get the invite url a better way as we are not waiting if the url is reflected in the UI - await this.rootPage.waitForTimeout(1000); + // await this.rootPage.waitForTimeout(1000); + await this.inviteUserModal.waitFor({ state: 'visible' }); // http://localhost:3000/#/signup/a5e7bf3a-cbb0-46bc-87f7-c2ae21796707 return (await this.inviteUserModal.locator(`.ant-alert-message`).innerText()).split('\n')[0]; diff --git a/tests/playwright/tests/db/usersAccounts/accountUserManagement.spec.ts b/tests/playwright/tests/db/usersAccounts/accountUserManagement.spec.ts index ab994f4ece..ea82fc235f 100644 --- a/tests/playwright/tests/db/usersAccounts/accountUserManagement.spec.ts +++ b/tests/playwright/tests/db/usersAccounts/accountUserManagement.spec.ts @@ -52,7 +52,8 @@ test.describe('User roles', () => { for (let i = 0; i < roleDb.length; i++) { const user = await api.orgUsers.list(); if (user.list.length > 0) { - const u = user.list.find((u: any) => u.email === roleDb[i].email); + // const u = user.list.find((u: any) => u.email === roleDb[i].email); + const u = user.list.find((u: any) => u.email === accountUsersPage.prefixEmail(roleDb[i].email)); if (u) await api.orgUsers.delete(u.id); } }