Добавлен позитивный тест для проверки заполнения информации профиля абитуриента

This commit is contained in:
Vlad Smykov
2026-02-09 15:28:43 +03:00
parent 96394f726b
commit bc0d50610c
11 changed files with 125 additions and 3 deletions

View File

@@ -0,0 +1,65 @@
// page-objects/ProfileApplicantPage.ts
import { Page } from '@playwright/test';
export class ProfileApplicantPage {
readonly page: Page;
constructor(page: Page) {
this.page = page;
}
async goto() {
await this.page.goto('/account/profile');
}
async openBasicInfoEditor() {
await this.page.getByTestId('btn-pensil').nth(0).click();
}
async uploadAvatar(filePath: string) {
const [fileChooser] = await Promise.all([
this.page.waitForEvent('filechooser'),
this.page.getByTestId('ModalUserInfo').getByTestId('btn-pensil').first().click(),
]);
await fileChooser.setFiles(filePath);
}
async fillCity(city: string) {
await this.page.fill('input[name="city"]', city);
}
async saveBasicInfo() {
await this.page.getByTestId('btn-save').click();
}
async openRepresentativeEditor() {
await this.page.getByTestId('btn-pensil').nth(1).click();
}
async fillRepresentative(from: string, fullName: string, phone: string) {
await this.page.fill('input[name="parents.0.from"]', from);
await this.page.fill('input[name="parents.0.fio"]', fullName);
await this.page.fill('input[name="parents.0.phone"]', phone);
}
async saveRepresentative() {
await this.page.locator('button:has-text("Сохранить")').click();
}
async openDisabilityEditor() {
await this.page.getByTestId('btn-pensil').nth(2).click();
}
async selectDisability(disability: string) {
await this.page.getByText(disability).click();
}
async selectDisabilityGroup(group: string) {
await this.page.getByText(group).first().click();
}
async saveDisabilityInfo() {
await this.page.locator('button:has-text("Сохранить")').click();
}
}