Добавил LoginPage,а также позитивные UI, API тесты для авторизации пользователя

This commit is contained in:
Vlad Smykov
2026-01-29 14:36:41 +03:00
parent 018edfebbf
commit 257a53c97e
5 changed files with 76 additions and 0 deletions

31
page-objects/LoginPage.ts Normal file
View File

@@ -0,0 +1,31 @@
// page-objects/LoginPage.ts
import { Page } from '@playwright/test';
export class LoginPage {
readonly page: Page;
constructor(page: Page) {
this.page = page;
}
async goto() {
await this.page.goto('/authorization'); // или '/auth', если маршрут другой
}
async fillLogin(login: string) {
await this.page.fill('input[name="login"]', login);
}
async fillPassword(password: string) {
await this.page.fill('input[name="password"]', password);
}
async submit() {
await this.page.click('button[type="submit"]');
}
async assertSuccessfulLogin() {
await this.page.waitForURL('**/account/profile'); // или '/', если перебрасывает на главную
}
}