Some checks failed
Frontend / Unit Tests & Coverage (push) Has been skipped
Regenerate POT file (translatable strings) / Regenerate POT file (develop) (push) Failing after 1m13s
Regenerate POT file (translatable strings) / Regenerate POT file (main-hotfix) (push) Failing after 6s
Server / Tests (frappe ${{ matrix.frappe-branch }}) (push) Has been skipped
Server / Resolve frappe matrix (push) Failing after 1s
Frontend / Lint (push) Failing after 1s
Frontend / Production Build (push) Failing after 1s
Server / Coverage Wrap Up (push) Has been skipped
Frontend / Coverage Wrap Up (push) Has been skipped
27 lines
723 B
TypeScript
27 lines
723 B
TypeScript
import { Page, expect } from '@playwright/test'
|
|
|
|
/**
|
|
* Frappe's standard login page. After a successful login with
|
|
* redirect-to=/crm the browser lands on the CRM SPA.
|
|
*/
|
|
export class LoginPage {
|
|
constructor(private page: Page) {}
|
|
|
|
async goto() {
|
|
await this.page.goto('/login?redirect-to=/crm')
|
|
await this.page.waitForLoadState('networkidle')
|
|
}
|
|
|
|
async login(email = 'Administrator', password = 'admin') {
|
|
await this.goto()
|
|
await this.page.fill('#login_email', email)
|
|
await this.page.fill('#login_password', password)
|
|
await this.page.click('button.btn-login')
|
|
await this.page.waitForURL(/\/crm/, { timeout: 30000 })
|
|
}
|
|
|
|
async expectOnLoginPage() {
|
|
await expect(this.page).toHaveURL(/.*login.*/)
|
|
}
|
|
}
|