Merge branch 'main' into AUT-1372

This commit is contained in:
Jakub P.
2025-01-25 20:44:30 +01:00
240 changed files with 7212 additions and 1234 deletions

View File

@@ -1,4 +1,4 @@
import { BasePage } from "./base-page";
import { BasePage } from './base-page';
const { faker } = require('@faker-js/faker');
const { expect } = require('@playwright/test');
@@ -6,16 +6,18 @@ export class AdminSetupPage extends BasePage {
path = '/installation';
/**
* @param {import('@playwright/test').Page} page
*/
* @param {import('@playwright/test').Page} page
*/
constructor(page) {
super(page);
this.fullNameTextField = this.page.getByTestId('fullName-text-field');
this.emailTextField = this.page.getByTestId('email-text-field');
this.passwordTextField = this.page.getByTestId('password-text-field');
this.repeatPasswordTextField = this.page.getByTestId('repeat-password-text-field');
this.createAdminButton = this.page.getByTestId('signUp-button');
this.repeatPasswordTextField = this.page.getByTestId(
'repeat-password-text-field'
);
this.createAdminButton = this.page.getByTestId('installation-button');
this.invalidFields = this.page.locator('p.Mui-error');
this.successAlert = this.page.getByTestId('success-alert');
}
@@ -46,7 +48,7 @@ export class AdminSetupPage extends BasePage {
await this.repeatPasswordTextField.fill(testUser.wronglyRepeatedPassword);
}
async submitAdminForm() {
async submitAdminForm() {
await this.createAdminButton.click();
}
@@ -59,7 +61,10 @@ export class AdminSetupPage extends BasePage {
}
async expectSuccessMessageToContainLoginLink() {
await expect(await this.successAlert.locator('a')).toHaveAttribute('href', '/login');
await expect(await this.successAlert.locator('a')).toHaveAttribute(
'href',
'/login'
);
}
generateUser() {
@@ -69,7 +74,7 @@ export class AdminSetupPage extends BasePage {
fullName: faker.person.fullName(),
email: faker.internet.email(),
password: faker.internet.password(),
wronglyRepeatedPassword: faker.internet.password()
wronglyRepeatedPassword: faker.internet.password(),
};
}
};
}

View File

@@ -1,3 +1,5 @@
const { expect } = require('@playwright/test');
const { faker } = require('@faker-js/faker');
const { AuthenticatedPage } = require('../authenticated-page');
@@ -11,7 +13,7 @@ export class AdminCreateUserPage extends AuthenticatedPage {
super(page);
this.fullNameInput = page.getByTestId('full-name-input');
this.emailInput = page.getByTestId('email-input');
this.roleInput = page.getByTestId('role.id-autocomplete');
this.roleInput = page.getByTestId('roleId-autocomplete');
this.createButton = page.getByTestId('create-button');
this.pageTitle = page.getByTestId('create-user-title');
this.invitationEmailInfoAlert = page.getByTestId(
@@ -20,6 +22,8 @@ export class AdminCreateUserPage extends AuthenticatedPage {
this.acceptInvitationLink = page
.getByTestId('invitation-email-info-alert')
.getByRole('link');
this.createUserSuccessAlert = page.getByTestId('create-user-success-alert');
this.fieldError = page.locator('p[id$="-helper-text"]');
}
seed(seed) {
@@ -32,4 +36,8 @@ export class AdminCreateUserPage extends AuthenticatedPage {
email: faker.internet.email().toLowerCase(),
};
}
async expectCreateUserSuccessAlertToBeVisible() {
await expect(this.createUserSuccessAlert).toBeVisible();
}
}

View File

@@ -9,6 +9,7 @@ export class DeleteRoleModal {
this.modal = page.getByTestId('delete-role-modal');
this.cancelButton = this.modal.getByTestId('confirmation-cancel-button');
this.deleteButton = this.modal.getByTestId('confirmation-confirm-button');
this.deleteAlert = this.modal.getByTestId('confirmation-dialog-error-alert');
}
async close () {

View File

@@ -13,9 +13,10 @@ export class AdminEditUserPage extends AuthenticatedPage {
super(page);
this.fullNameInput = page.getByTestId('full-name-input');
this.emailInput = page.getByTestId('email-input');
this.roleInput = page.getByTestId('role.id-autocomplete');
this.roleInput = page.getByTestId('roleId-autocomplete');
this.updateButton = page.getByTestId('update-button');
this.pageTitle = page.getByTestId('edit-user-title');
this.fieldError = page.locator('p[id$="-helper-text"]');
}
/**