Добавлены позитивные сценарии добавления информации в подразделе Портфолио. Роль – Абитуриент
This commit is contained in:
BIN
fixtures/.DS_Store
vendored
BIN
fixtures/.DS_Store
vendored
Binary file not shown.
BIN
fixtures/achievement_information.pdf
Normal file
BIN
fixtures/achievement_information.pdf
Normal file
Binary file not shown.
BIN
fixtures/education_information.pdf
Normal file
BIN
fixtures/education_information.pdf
Normal file
Binary file not shown.
BIN
fixtures/workExp_information.pdf
Normal file
BIN
fixtures/workExp_information.pdf
Normal file
Binary file not shown.
@@ -10,7 +10,7 @@ export class LoginPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async goto() {
|
async goto() {
|
||||||
await this.page.goto('/authorization'); // или '/auth', если маршрут другой
|
await this.page.goto('/authorization');
|
||||||
}
|
}
|
||||||
|
|
||||||
async fillLogin(login: string) {
|
async fillLogin(login: string) {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export class ProfileApplicantPage {
|
|||||||
await this.page.goto('/account/profile');
|
await this.page.goto('/account/profile');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Профиль
|
||||||
async openBasicInfoEditor() {
|
async openBasicInfoEditor() {
|
||||||
await this.page.getByTestId('btn-pensil').nth(0).click();
|
await this.page.getByTestId('btn-pensil').nth(0).click();
|
||||||
}
|
}
|
||||||
@@ -62,4 +63,110 @@ export class ProfileApplicantPage {
|
|||||||
async saveDisabilityInfo() {
|
async saveDisabilityInfo() {
|
||||||
await this.page.locator('button:has-text("Сохранить")').click();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
{"email":"testuser1770382880998@virgilian.com","password":"!Test123456","login":"user_9im58j","mailToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE3NzAzODI4ODEsInJvbGVzIjpbIlJPTEVfVVNFUiJdLCJhZGRyZXNzIjoidGVzdHVzZXIxNzcwMzgyODgwOTk4QHZpcmdpbGlhbi5jb20iLCJpZCI6IjY5ODVlNjIxNTMzYjdmZmY5YjBkZWZhOCIsIm1lcmN1cmUiOnsic3Vic2NyaWJlIjpbIi9hY2NvdW50cy82OTg1ZTYyMTUzM2I3ZmZmOWIwZGVmYTgiXX19.mO_8aGsS6FxHX53EzTXbnm063zSeKfaqR79Ls280VY54rE2Hhb32RtoD8ECYynRAeJZJekXzGZnD0ciBSFz3zA"}
|
{"email":"testuser1770898568523@dollicons.com","password":"!Test123456","login":"user_vwqo3m","mailToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE3NzA4OTg1NjksInJvbGVzIjpbIlJPTEVfVVNFUiJdLCJhZGRyZXNzIjoidGVzdHVzZXIxNzcwODk4NTY4NTIzQGRvbGxpY29ucy5jb20iLCJpZCI6IjY5OGRjNDg5MDNlZTQ5OWNkYjBhZDY3NCIsIm1lcmN1cmUiOnsic3Vic2NyaWJlIjpbIi9hY2NvdW50cy82OThkYzQ4OTAzZWU0OTljZGIwYWQ2NzQiXX19._iJUK5fg6n4nuG16K1yKqheaNd7ItjXctNAyu7F-kLHIaluoFU73dItBWgszKoZgrbD5gc1GBG3YK5V-5ds-qQ"}
|
||||||
@@ -4,26 +4,28 @@ import path from 'path';
|
|||||||
import { LoginPage } from '../../../page-objects/LoginPage';
|
import { LoginPage } from '../../../page-objects/LoginPage';
|
||||||
import { ProfileApplicantPage } from '../../../page-objects/UsersAccount/ProfileApplicantPage';
|
import { ProfileApplicantPage } from '../../../page-objects/UsersAccount/ProfileApplicantPage';
|
||||||
|
|
||||||
test('UI: Личный кабинет абитуриента — заполнение профиля', async ({ page }) => {
|
test.describe('UI: Личный кабинет абитуриента', () => {
|
||||||
|
test.beforeEach(async ({ page }) => {
|
||||||
const user = JSON.parse(fs.readFileSync('temp/user.json', 'utf-8'));
|
const user = JSON.parse(fs.readFileSync('temp/user.json', 'utf-8'));
|
||||||
const loginPage = new LoginPage(page);
|
const loginPage = new LoginPage(page);
|
||||||
const profilePage = new ProfileApplicantPage(page);
|
const profilePage = new ProfileApplicantPage(page);
|
||||||
|
|
||||||
// Авторизация
|
|
||||||
await loginPage.goto();
|
await loginPage.goto();
|
||||||
await loginPage.fillLogin(user.login);
|
await loginPage.fillLogin(user.login);
|
||||||
await loginPage.fillPassword(user.password);
|
await loginPage.fillPassword(user.password);
|
||||||
await loginPage.submit();
|
await loginPage.submit();
|
||||||
await expect(page).toHaveURL(/.*\/account\/profile/);
|
await expect(page).toHaveURL(/.*\/account\/profile/);
|
||||||
|
|
||||||
// Открытие редактирования базовой информации
|
|
||||||
await profilePage.goto();
|
await profilePage.goto();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('UI: Личный кабинет абитуриента — заполнение профиля', async ({ page }) => {
|
||||||
|
const loginPage = new LoginPage(page);
|
||||||
|
const profilePage = new ProfileApplicantPage(page);
|
||||||
await profilePage.openBasicInfoEditor();
|
await profilePage.openBasicInfoEditor();
|
||||||
await profilePage.uploadAvatar(path.resolve('fixtures', 'avatar.png')); // добавь этот файл в проект
|
await profilePage.uploadAvatar(path.resolve('fixtures', 'avatar.png'));
|
||||||
await profilePage.fillCity('Таганрог');
|
await profilePage.fillCity('Таганрог');
|
||||||
await profilePage.saveBasicInfo();
|
await profilePage.saveBasicInfo();
|
||||||
|
|
||||||
// Редактирование представителя
|
|
||||||
await profilePage.openRepresentativeEditor();
|
await profilePage.openRepresentativeEditor();
|
||||||
await profilePage.fillRepresentative(
|
await profilePage.fillRepresentative(
|
||||||
'Мать',
|
'Мать',
|
||||||
@@ -31,13 +33,61 @@ test('UI: Личный кабинет абитуриента — заполне
|
|||||||
'+7 (900) 123-45-67'
|
'+7 (900) 123-45-67'
|
||||||
);
|
);
|
||||||
await profilePage.saveRepresentative();
|
await profilePage.saveRepresentative();
|
||||||
|
|
||||||
// Редактирование инвалидности
|
|
||||||
await profilePage.openDisabilityEditor();
|
await profilePage.openDisabilityEditor();
|
||||||
await profilePage.selectDisability('Нарушение слуха');
|
await profilePage.selectDisability('Нарушение слуха');
|
||||||
await profilePage.selectDisabilityGroup('I группа');
|
await profilePage.selectDisabilityGroup('I группа');
|
||||||
await profilePage.saveDisabilityInfo();
|
await profilePage.saveDisabilityInfo();
|
||||||
|
|
||||||
// Проверка, что остались на профиле
|
|
||||||
await expect(page).toHaveURL(/.*\/account\/profile/);
|
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();
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user