Initial commit: added Playwright tests
This commit is contained in:
33
tests/ui/recovery/recover-password.spec.ts
Normal file
33
tests/ui/recovery/recover-password.spec.ts
Normal 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();
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user