test: write tests for role management (#1396)
This commit is contained in:
@@ -25,6 +25,11 @@ export class AdminUsersPage extends AuthenticatedPage {
|
||||
async navigateTo () {
|
||||
await this.profileMenuButton.click();
|
||||
await this.adminMenuItem.click();
|
||||
if (await this.usersLoader.isVisible()) {
|
||||
await this.usersLoader.waitFor({
|
||||
state: 'detached'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,8 +71,14 @@ export class AdminUsersPage extends AuthenticatedPage {
|
||||
|
||||
/**
|
||||
* @param {string} email
|
||||
* @returns {import('@playwright/test').Locator | null}
|
||||
*/
|
||||
async findUserPageWithEmail (email) {
|
||||
if (await this.usersLoader.isVisible()) {
|
||||
await this.usersLoader.waitFor({
|
||||
state: 'detached'
|
||||
});
|
||||
}
|
||||
// start at the first page
|
||||
const firstPageDisabled = await this.firstPageButton.isDisabled();
|
||||
if (!firstPageDisabled) {
|
||||
@@ -75,6 +86,11 @@ export class AdminUsersPage extends AuthenticatedPage {
|
||||
}
|
||||
|
||||
while (true) {
|
||||
if (await this.usersLoader.isVisible()) {
|
||||
await this.usersLoader.waitFor({
|
||||
state: 'detached'
|
||||
});
|
||||
}
|
||||
const rowLocator = await this.getUserRowByEmail(email);
|
||||
if ((await rowLocator.count()) === 1) {
|
||||
return rowLocator;
|
||||
|
Reference in New Issue
Block a user