Files
at-digitaltwin/page-objects/LoginPage.ts

32 lines
687 B
TypeScript

// 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');
}
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'); // или '/', если перебрасывает на главную
}
}