Browse Source

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

pull/9190/head
Ramesh Mane 4 months ago committed by GitHub
parent
commit
5fe1be1d8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      tests/playwright/pages/Account/Users.ts

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

Loading…
Cancel
Save