test: add change own user data test
This commit is contained in:
@@ -8,6 +8,7 @@ export class AuthenticatedPage extends BasePage {
|
||||
super(page);
|
||||
|
||||
this.profileMenuButton = this.page.getByTestId('profile-menu-button');
|
||||
this.logoutMenuItem = this.page.getByTestId('logout-item');
|
||||
this.adminMenuItem = this.page.getByRole('menuitem', { name: 'Admin' });
|
||||
this.userInterfaceDrawerItem = this.page.getByTestId(
|
||||
'user-interface-drawer-link'
|
||||
@@ -18,4 +19,9 @@ export class AuthenticatedPage extends BasePage {
|
||||
this.typographyLogo = this.page.getByTestId('typography-logo');
|
||||
this.customLogo = this.page.getByTestId('custom-logo');
|
||||
}
|
||||
|
||||
async logout() {
|
||||
await this.profileMenuButton.click();
|
||||
await this.logoutMenuItem.click();
|
||||
}
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@ exports.test = test.extend({
|
||||
userInterfacePage: async ({ page }, use) => {
|
||||
await use(new UserInterfacePage(page));
|
||||
},
|
||||
...adminFixtures
|
||||
...adminFixtures,
|
||||
});
|
||||
|
||||
exports.publicTest = test.extend({
|
||||
@@ -49,21 +49,18 @@ exports.publicTest = test.extend({
|
||||
|
||||
await use(loginPage);
|
||||
},
|
||||
|
||||
acceptInvitationPage: async ({ page }, use) => {
|
||||
const acceptInvitationPage = new AcceptInvitation(page);
|
||||
await use(acceptInvitationPage);
|
||||
},
|
||||
|
||||
adminSetupPage: async ({ page }, use) => {
|
||||
const adminSetupPage = new AdminSetupPage(page);
|
||||
await use(adminSetupPage);
|
||||
},
|
||||
|
||||
adminCreateUserPage: async ({page}, use) => {
|
||||
adminCreateUserPage: async ({ page }, use) => {
|
||||
const adminCreateUserPage = new AdminCreateUserPage(page);
|
||||
await use(adminCreateUserPage);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
expect.extend({
|
||||
|
21
packages/e2e-tests/fixtures/my-profile-page.js
Normal file
21
packages/e2e-tests/fixtures/my-profile-page.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const { AuthenticatedPage } = require('./authenticated-page');
|
||||
|
||||
export class MyProfilePage extends AuthenticatedPage {
|
||||
constructor(page) {
|
||||
super(page);
|
||||
|
||||
this.fullName = this.page.locator('[name="fullName"]');
|
||||
this.email = this.page.locator('[name="email"]');
|
||||
this.newPassword = this.page.locator('[name="password"]');
|
||||
this.passwordConfirmation = this.page.locator('[name="confirmPassword"]');
|
||||
this.updateProfileButton = this.page.getByTestId('update-profile-button');
|
||||
this.settingsMenuItem = this.page.getByRole('menuitem', {
|
||||
name: 'Settings',
|
||||
});
|
||||
}
|
||||
|
||||
async navigateTo() {
|
||||
await this.profileMenuButton.click();
|
||||
await this.settingsMenuItem.click();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user