test: improve searching for elements on users page

This commit is contained in:
Jakub P
2025-03-28 16:09:53 +01:00
parent 80132054b6
commit 04f75ed15b
3 changed files with 20 additions and 5 deletions

View File

@@ -43,6 +43,10 @@ export class AdminApplicationSettingsPage extends AuthenticatedPage {
await this.saveButton.click();
}
async expectOnlyOneSuccessSnackbarToBeVisible() {
await expect(this.successSnackbar).toBeVisible();
}
async expectSuccessSnackbarToBeVisible() {
const snackbars = await this.successSnackbar.all();
for (const snackbar of snackbars) {

View File

@@ -27,6 +27,11 @@ export class AdminUsersPage extends AuthenticatedPage {
await this.profileMenuButton.click();
await this.adminMenuItem.click();
await this.isMounted();
await Promise.all([
this.page.waitForResponse(
(resp) => resp.url().includes('/admin/users') && resp.status() === 200
),
]);
if (await this.usersLoader.isVisible()) {
await this.usersLoader.waitFor({
state: 'detached',