test(nc-gui): fix user management flaky test (#9180)

This commit is contained in:
Ramesh Mane
2024-08-08 14:27:17 +05:30
committed by GitHub
parent 34e1902aa1
commit 5fe1be1d8a

View File

@@ -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' });
}
}