mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-04-15 09:34:13 +00:00
24 lines
No EOL
808 B
TypeScript
24 lines
No EOL
808 B
TypeScript
import { Locator, Page } from '@playwright/test'
|
|
import { BaserowPage } from './baserowPage'
|
|
|
|
export class LoginPage extends BaserowPage {
|
|
readonly pageUrl = `login`
|
|
readonly emailInput: Locator
|
|
readonly passwordInput: Locator
|
|
readonly loginButton: Locator
|
|
|
|
constructor(page: Page) {
|
|
super(page)
|
|
this.emailInput = page.locator('input[type="email"]').first()
|
|
this.passwordInput = page.locator('input[type="password"]').first()
|
|
this.loginButton = page.locator('button:text("Sign in")').first()
|
|
}
|
|
|
|
async loginWithPassword(email: string, password: string) {
|
|
await this.emailInput.fill(email)
|
|
await this.passwordInput.fill(password)
|
|
const navigationPromise = this.page.waitForNavigation({timeout:5000})
|
|
await this.loginButton.click()
|
|
await navigationPromise
|
|
}
|
|
} |