test: write tests for role management (#1396)

This commit is contained in:
QAComet
2023-11-06 02:35:20 -07:00
committed by GitHub
parent 5fb48ed54b
commit 1581b5ac0a
21 changed files with 899 additions and 13 deletions

View File

@@ -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;