init: базовая структура АТ
This commit is contained in:
55
page-objects/RegisterPage.ts
Normal file
55
page-objects/RegisterPage.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
// page-objects/RegisterPage.ts
|
||||
|
||||
import { Page } from '@playwright/test';
|
||||
|
||||
export class RegisterPage {
|
||||
readonly page: Page;
|
||||
|
||||
constructor(page: Page) {
|
||||
this.page = page;
|
||||
}
|
||||
|
||||
async goto() {
|
||||
await this.page.goto('/registration');
|
||||
}
|
||||
|
||||
async fillLastName(lastName: string) {
|
||||
await this.page.fill('input[name="surname"]', lastName);
|
||||
}
|
||||
|
||||
async fillFirstName(firstName: string) {
|
||||
await this.page.fill('input[name="name"]', firstName);
|
||||
}
|
||||
|
||||
async fillMiddleName(middleName: string) {
|
||||
await this.page.fill('input[name="patronymic"]', middleName);
|
||||
}
|
||||
|
||||
async fillEmail(email: string) {
|
||||
await this.page.fill('input[name="email"]', email);
|
||||
}
|
||||
|
||||
async fillLogin(login: string) {
|
||||
await this.page.fill('input[name="login"]', login);
|
||||
}
|
||||
|
||||
async fillPhone(phone: string) {
|
||||
await this.page.fill('input[name="phone"]', phone);
|
||||
}
|
||||
|
||||
async fillPassword(password: string) {
|
||||
await this.page.fill('input[name="password"]', password);
|
||||
}
|
||||
|
||||
async fillPasswordRepeat(password: string) {
|
||||
await this.page.fill('input[name="passwordRepeat"]', password);
|
||||
}
|
||||
|
||||
async checkConsentCheckbox() {
|
||||
await this.page.locator('span.Checkmark_checkmark__58fWm').click();
|
||||
}
|
||||
|
||||
async submit() {
|
||||
await this.page.locator('button[data-testid="btn-save"]').click();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user