Добавлен файл RegisterPage и позитивный сценарий register.spec

This commit is contained in:
Vlad Smykov
2025-06-17 19:53:22 +03:00
parent 7fb50eef2c
commit 395a008c74
22 changed files with 1158 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import { test, expect } from '@playwright/test';
import { RegisterPage } from '../../../page-objects/RegisterPage';
test.describe('Позитивные сценарии регистрации', () => {
test('Успешная регистрация нового пользователя', async ({ page }) => {
const registerPage = new RegisterPage(page);
await registerPage.goto();
// Генерация уникального email и телефона
const randomSuffix = Math.floor(Math.random() * 100000);
const uniqueEmail = `autotest${randomSuffix}@example.com`;
const uniquePhone = `+79${randomSuffix.toString().padStart(9, '0')}`;
await registerPage.register({
name: 'Иван',
surname: 'Тестов',
patronymic: 'Александрович',
academicTitle: 'Доцент',
degree: 'Кандидат наук',
position: 'Преподаватель',
organization: 'ЮФУ',
email: uniqueEmail,
phone: uniquePhone,
password: '!Test123456',
confirmPassword: '!Test123456'
});
// Проверяем редирект на страницу подтверждения кода
await expect(page).toHaveURL(/\/login\/confirmLogin/);
await expect(page.locator('text=Подтвердите адрес электронной почты')).toBeVisible();
});
});