test: improve navigateTo on users-page
This commit is contained in:
@@ -24,6 +24,16 @@ export class AdminUsersPage extends AuthenticatedPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async navigateTo() {
|
async navigateTo() {
|
||||||
|
await this.profileMenuButton.click();
|
||||||
|
await Promise.all([this.adminMenuItem.click(), this.isMounted()]);
|
||||||
|
if (await this.usersLoader.isVisible()) {
|
||||||
|
await this.usersLoader.waitFor({
|
||||||
|
state: 'detached',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async navigateToAndWaitForUsers() {
|
||||||
await this.profileMenuButton.click();
|
await this.profileMenuButton.click();
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
this.page.waitForResponse(
|
this.page.waitForResponse(
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ test.describe('Role management page', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await test.step('Change the role the user has', async () => {
|
await test.step('Change the role the user has', async () => {
|
||||||
await adminUsersPage.navigateTo();
|
await adminUsersPage.navigateToAndWaitForUsers();
|
||||||
await adminUsersPage.usersLoader.waitFor({
|
await adminUsersPage.usersLoader.waitFor({
|
||||||
state: 'detached',
|
state: 'detached',
|
||||||
});
|
});
|
||||||
@@ -264,7 +264,7 @@ test.describe('Role management page', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await test.step('Delete this user', async () => {
|
await test.step('Delete this user', async () => {
|
||||||
await adminUsersPage.navigateTo();
|
await adminUsersPage.navigateToAndWaitForUsers();
|
||||||
const row = await adminUsersPage.findUserPageWithEmail(
|
const row = await adminUsersPage.findUserPageWithEmail(
|
||||||
'user-delete-role-test@automatisch.io'
|
'user-delete-role-test@automatisch.io'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ test.describe('User management page', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await test.step('Delete the created user', async () => {
|
await test.step('Delete the created user', async () => {
|
||||||
await adminUsersPage.navigateTo();
|
await adminUsersPage.navigateToAndWaitForUsers();
|
||||||
await adminUsersPage.findUserPageWithEmail(testUser.email);
|
await adminUsersPage.findUserPageWithEmail(testUser.email);
|
||||||
const userRow = await adminUsersPage.getUserRowByEmail(testUser.email);
|
const userRow = await adminUsersPage.getUserRowByEmail(testUser.email);
|
||||||
await adminUsersPage.clickDeleteUser(userRow);
|
await adminUsersPage.clickDeleteUser(userRow);
|
||||||
@@ -198,7 +198,7 @@ test.describe('User management page', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await test.step('Try editing the second user to have the email of the first user', async () => {
|
await test.step('Try editing the second user to have the email of the first user', async () => {
|
||||||
await adminUsersPage.navigateTo();
|
await adminUsersPage.navigateToAndWaitForUsers();
|
||||||
await adminUsersPage.findUserPageWithEmail(user2.email);
|
await adminUsersPage.findUserPageWithEmail(user2.email);
|
||||||
let userRow = await adminUsersPage.getUserRowByEmail(user2.email);
|
let userRow = await adminUsersPage.getUserRowByEmail(user2.email);
|
||||||
await adminUsersPage.clickEditUser(userRow);
|
await adminUsersPage.clickEditUser(userRow);
|
||||||
|
|||||||
Reference in New Issue
Block a user