From 5fe1be1d8adf59016ded2e93c7e8fedda474e7ab Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Thu, 8 Aug 2024 14:27:17 +0530 Subject: [PATCH] test(nc-gui): fix user management flaky test (#9180) --- tests/playwright/pages/Account/Users.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/playwright/pages/Account/Users.ts b/tests/playwright/pages/Account/Users.ts index 2a3c08a635..41ca2ebc3d 100644 --- a/tests/playwright/pages/Account/Users.ts +++ b/tests/playwright/pages/Account/Users.ts @@ -76,9 +76,11 @@ export class AccountUsersPage extends BasePage { // ensure page is loaded email = this.prefixEmail(email); - await this.get().locator('.nc-table-row').first().waitFor({ state: 'visible' }); + const userRow = this.get().locator(`.nc-table-row:has-text("${email}")`).first(); - return this.get().locator(`.nc-table-row:has-text("${email}")`).first(); + await userRow.waitFor({ state: 'visible' }); + + return userRow.first(); } async updateRole({ email, role }: { email: string; role: string }) { @@ -103,5 +105,6 @@ export class AccountUsersPage extends BasePage { await this.rootPage.locator('.nc-menu-item:visible:has-text("Remove user")').click(); await this.rootPage.locator('.ant-modal.active button:has-text("Delete User")').click(); await this.verifyToast({ message: 'User deleted successfully' }); + await this.get().locator(`.nc-table-row:has-text("${email}")`).first().waitFor({ state: 'hidden' }); } }