Добавлены позитивные сценарии добавления информации в подразделе Портфолио. Роль – Абитуриент

This commit is contained in:
Vlad Smykov
2026-02-13 16:46:38 +03:00
parent bc0d50610c
commit bd487e09e4
9 changed files with 192 additions and 35 deletions

View File

@@ -13,6 +13,7 @@ export class ProfileApplicantPage {
await this.page.goto('/account/profile');
}
// Профиль
async openBasicInfoEditor() {
await this.page.getByTestId('btn-pensil').nth(0).click();
}
@@ -62,4 +63,110 @@ export class ProfileApplicantPage {
async saveDisabilityInfo() {
await this.page.locator('button:has-text("Сохранить")').click();
}
}
//Тесты
async openTestsPage() {
await this.page.getByRole('main').getByText('Тесты').click()
await this.page.getByText('Тест для позитивного сценария Playwright', { exact: true }).scrollIntoViewIfNeeded();
await this.page.getByRole('button', { name: 'Пройти тест' }).first().click();
await this.page.getByRole('button', { name: 'Начать тест' }).click();
await this.page.locator('.Checkmark_checkmark__58fWm').first().click();
await this.page.getByRole('button', { name: 'next' }).click();
await this.page.locator('.swiper-slide.swiper-slide-active > .Questions_slide__-Yhoj > #questionItem >' +
'.Question_answers__xra74 > #answer > #checkmark > .Checkmark_checkmark__58fWm').click();
await this.page.getByRole('button', { name: 'Завершить тест' }).click();
await this.page.getByRole('button', { name: 'К тестам' }).click();
}
//Портфолио
async openPortfolioPage() {
await this.page.getByRole('main').getByRole('listitem').filter({ hasText: 'Портфолио' }).click();
}
//Достижения
async clickAchievementButton() {
await this.page.locator('button').filter({ hasText: /^\+ Добавить$/ }).click();
}
async fillAchievementInfo() {
await this.page.getByRole('textbox', { name: 'Полное название' }).fill('Тестовое достижение');
await this.page.getByRole('textbox', { name: 'Не выбран' }).click();
await this.page.locator('#modal-main').getByText('2026', { exact: true }).first().click();
}
async uploadAchievement(filePath: string) {
const [fileChooser] = await Promise.all([
this.page.waitForEvent('filechooser'),
await this.page.getByText('Загрузите сертификат').click()
]);
await fileChooser.setFiles(filePath);
}
async clickAchievementSaveButton() {
await this.page.getByTestId('btn-save').click();
}
//Образование
async clickEducationButton() {
await this.page.locator('section').filter({ hasText: 'Образование' }).getByRole('button').click();
}
async fillEducationInfo() {
await this.page.getByRole('textbox', { name: 'Учебное заведение' }).fill('Тестовое заведение');
await this.page.getByRole('textbox', { name: 'Название специальности' }).fill('Тестовая специальность');
await this.page.locator('#yearStart').click();
await this.page.getByText('2020').click();
await this.page.locator('.Checkmark_checkmark__58fWm').click();
await this.page.locator('#yearEnd').click();
await this.page.locator('#scroll').getByText('2026').click();
await this.page.getByRole('textbox', { name: 'Очное' }).click();
await this.page.getByText('Очная', { exact: true }).click();
await this.page.getByRole('textbox', { name: 'Бюджет' }).click();
await this.page.getByText('Бюджет', { exact: true }).click();
await this.page.locator('#educationLevel').click();
await this.page.getByText('Бакалавриат').click();
}
async uploadEducation(filePath: string) {
const [fileChooser] = await Promise.all([
this.page.waitForEvent('filechooser'),
await this.page.getByText('Загрузите документ об образовании').click()
]);
await fileChooser.setFiles(filePath);
}
async clickEducationSaveButton() {
await this.page.getByRole('button', { name: 'Сохранить' }).click();
}
//Опыт работы
async clickWorkExpButton() {
await this.page.locator('section').filter({ hasText: 'Опыт работы + Добавить' }).getByRole('button').click();
}
async fillWorkExpInfo() {
await this.page.getByRole('textbox', { name: 'Полное название' }).fill('Тестовое название компании');
await this.page.getByRole('textbox', { name: 'Название должности' }).fill('Тестовая должность');
await this.page.getByRole('textbox', { name: 'Не выбрано' }).click();
await this.page.getByRole('textbox', { name: 'Не выбрано' }).fill('программист');
await this.page.getByRole('heading', { name: 'Связь, информационные и коммуникационные технологии' }).click();
await this.page.getByText('Программист', { exact: true }).click();
await this.page.getByRole('textbox', { name: 'Описание' }).fill('Тестовое описание опыта работы');
await this.page.getByRole('textbox', { name: '01.01.1999' }).fill('01.01.2020');
}
async uploadWorkExp(filePath: string) {
const [fileChooser] = await Promise.all([
this.page.waitForEvent('filechooser'),
await this.page.getByText('Загрузить подтверждающий документ').click()
]);
await fileChooser.setFiles(filePath);
}
async clickWorkExpSaveButton() {
await this.page.getByRole('button', { name: 'Сохранить' }).click();
}
//Дополнительные ссылки
async clickAdditionalLinksButton() {
await this.page.getByTestId('btn-pensil').click();
await this.page.getByRole('button', { name: 'plusIcon Добавить' }).click();
}
async fillAdditionalLinksInfo() {
await this.page.getByRole('textbox', { name: 'Название' }).fill('Тестовая платформа');
await this.page.getByRole('textbox', { name: 'Вставьте ссылку' }).fill('https://github.com/vsmykov');
}
async clickAdditionalLinksSaveButton() {
await this.page.getByRole('button', { name: 'Сохранить' }).click();
}
}