Добавлен позитивный тест для проверки заполнения информации профиля абитуриента
This commit is contained in:
BIN
tests/.DS_Store
vendored
Normal file
BIN
tests/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -45,8 +45,9 @@ test('API: регистрация абитуриента + подтвержде
|
||||
|
||||
fs.writeFileSync('temp/user.json', JSON.stringify({
|
||||
email,
|
||||
password: '!Test123456',
|
||||
mailToken
|
||||
password: '!Test123456',
|
||||
login,
|
||||
mailToken
|
||||
}));
|
||||
|
||||
|
||||
|
||||
13
tests/suites/all-api-tests.serial.spec.ts
Normal file
13
tests/suites/all-api-tests.serial.spec.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// tests/suites/all-api-tests.serial.spec.ts
|
||||
import { test } from '@playwright/test';
|
||||
|
||||
test.describe.serial('API Suite', () => {
|
||||
test.describe.configure({ mode: 'serial' });
|
||||
|
||||
require('../api/registration/register-applicant.api.spec');
|
||||
require('../api/registration/register-graduate.api.spec');
|
||||
require('../api/registration/register-organization.api.spec');
|
||||
|
||||
require('../api/auth/login-applicant.api.spec');
|
||||
|
||||
});
|
||||
0
tests/suites/all-ui-tests.serial.spec.ts
Normal file
0
tests/suites/all-ui-tests.serial.spec.ts
Normal file
BIN
tests/ui/.DS_Store
vendored
Normal file
BIN
tests/ui/.DS_Store
vendored
Normal file
Binary file not shown.
43
tests/ui/account/profile-applicant.spec.ts
Normal file
43
tests/ui/account/profile-applicant.spec.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import fs from 'fs';
|
||||
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);
|
||||
|
||||
// Авторизация
|
||||
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.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 expect(page).toHaveURL(/.*\/account\/profile/);
|
||||
});
|
||||
Reference in New Issue
Block a user