Initial commit: added Playwright tests

This commit is contained in:
Vlad Smykov
2025-06-16 13:32:08 +03:00
commit 2b3ac01274
14 changed files with 1044 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
import { test, expect } from '@playwright/test';
import { RecoverPage } from '../../../page-objects/RecoverPage';
import { users, recovery } from '../../../utils/test-data';
test.describe('Восстановление пароля — позитивные сценарии', () => {
test('Пользователь успешно восстанавливает пароль', async ({ page }) => {
const recoverPage = new RecoverPage(page);
const email = recovery.emailExists;
const verificationCode = recovery.verificationCode;
const newPassword = users.newPassword.password;
// 1. Переход на страницу восстановления
await recoverPage.goto();
// 2. Ввод email
await recoverPage.enterEmail(email);
await expect(page).toHaveURL(/\/recoverpassword\/checkemail/);
// 3. Ввод 6-значного кода
await recoverPage.enterVerificationCode(verificationCode);
// 4. Ввод нового пароля
await expect(recoverPage.newPasswordInput).toBeVisible();
await recoverPage.enterNewPassword(newPassword, newPassword);
// 5. Ожидаем редирект на страницу авторизации
await expect(page).toHaveURL('/login/authorization');
await expect(page.getByRole('button', { name: 'Войти', exact: true })).toBeVisible();
});
});