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

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

@@ -4,40 +4,90 @@ import path from 'path';
import { LoginPage } from '../../../page-objects/LoginPage';
import { ProfileApplicantPage } from '../../../page-objects/UsersAccount/ProfileApplicantPage';
test('UI: Личный кабинет абитуриента — заполнение профиля', async ({ page }) => {
const user = JSON.parse(fs.readFileSync('temp/user.json', 'utf-8'));
const loginPage = new LoginPage(page);
const profilePage = new ProfileApplicantPage(page);
test.describe('UI: Личный кабинет абитуриента', () => {
test.beforeEach(async ({ page }) => {
const user = JSON.parse(fs.readFileSync('temp/user.json', 'utf-8'));
const loginPage = new LoginPage(page);
const profilePage = new ProfileApplicantPage(page);
// Авторизация
await loginPage.goto();
await loginPage.fillLogin(user.login);
await loginPage.fillPassword(user.password);
await loginPage.submit();
await expect(page).toHaveURL(/.*\/account\/profile/);
await loginPage.goto();
await loginPage.fillLogin(user.login);
await loginPage.fillPassword(user.password);
await loginPage.submit();
await expect(page).toHaveURL(/.*\/account\/profile/);
// Открытие редактирования базовой информации
await profilePage.goto();
await profilePage.openBasicInfoEditor();
await profilePage.uploadAvatar(path.resolve('fixtures', 'avatar.png')); // добавь этот файл в проект
await profilePage.fillCity('Таганрог');
await profilePage.saveBasicInfo();
await profilePage.goto();
});
// Редактирование представителя
await profilePage.openRepresentativeEditor();
await profilePage.fillRepresentative(
'Мать',
'Иванова Мария Петровна',
'+7 (900) 123-45-67'
);
await profilePage.saveRepresentative();
test('UI: Личный кабинет абитуриента — заполнение профиля', async ({ page }) => {
const loginPage = new LoginPage(page);
const profilePage = new ProfileApplicantPage(page);
await profilePage.openBasicInfoEditor();
await profilePage.uploadAvatar(path.resolve('fixtures', 'avatar.png'));
await profilePage.fillCity('Таганрог');
await profilePage.saveBasicInfo();
await profilePage.openRepresentativeEditor();
await profilePage.fillRepresentative(
'Мать',
'Иванова Мария Петровна',
'+7 (900) 123-45-67'
);
await profilePage.saveRepresentative();
await profilePage.openDisabilityEditor();
await profilePage.selectDisability('Нарушение слуха');
await profilePage.selectDisabilityGroup('I группа');
await profilePage.saveDisabilityInfo();
// Редактирование инвалидности
await profilePage.openDisabilityEditor();
await profilePage.selectDisability('Нарушение слуха');
await profilePage.selectDisabilityGroup('I группа');
await profilePage.saveDisabilityInfo();
await expect(page).toHaveURL(/.*\/account\/profile/);
});
test('UI: Личный кабинет абитуриента — прохождение теста', async ({ page }) => {
const loginPage = new LoginPage(page);
const profilePage = new ProfileApplicantPage(page);
await profilePage.openTestsPage();
await expect(page.getByRole('button', { name: 'Посмотреть результаты' })).toBeVisible();
});
test('UI: Личный кабинет абитуриента — заполнение портфолио', async ({ page }) => {
const loginPage = new LoginPage(page);
const profilePage = new ProfileApplicantPage(page);
//Достижения
await profilePage.openPortfolioPage();
await profilePage.clickAchievementButton();
await profilePage.fillAchievementInfo();
await profilePage.uploadAchievement(path.resolve('fixtures', 'achievement_information.pdf'));
await profilePage.clickAchievementSaveButton();
await expect(page.getByRole('heading', { name: 'Тестовое достижение' })).toBeVisible();
await expect(page.getByText('2026', { exact: true })).toBeVisible();
await expect(page.getByRole('link', { name: 'achievement_information.pdf' })).toBeVisible();
//Образование
await profilePage.clickEducationButton();
await profilePage.fillEducationInfo();
await profilePage.uploadEducation(path.resolve('fixtures', 'education_information.pdf'));
await profilePage.clickEducationSaveButton();
await expect(page.getByRole('heading', { name: 'Тестовое заведение' })).toBeVisible();
await expect(page.getByRole('heading', { name: 'Тестовая специальность' })).toBeVisible();
await expect(page.getByText('- 2026')).toBeVisible();
await expect(page.getByText('Форма обучения: Очная')).toBeVisible();
await expect(page.getByText('Основа обучения: Бюджет')).toBeVisible();
await expect(page.getByText('Уровень образования: Бакалавриат')).toBeVisible();
//Опыт работы
await profilePage.clickWorkExpButton();
await profilePage.fillWorkExpInfo();
await profilePage.uploadWorkExp(path.resolve('fixtures', 'workExp_information.pdf'));
await profilePage.clickWorkExpSaveButton();
//Дополнительные ссылки
await profilePage.clickAdditionalLinksButton();
await profilePage.fillAdditionalLinksInfo();
await profilePage.clickAdditionalLinksSaveButton();
})
})
// Проверка, что остались на профиле
await expect(page).toHaveURL(/.*\/account\/profile/);
});