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
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import { test, expect } from '@playwright/test'
|
|
import { LoginPage } from '../pages'
|
|
|
|
/**
|
|
* Exercises the real login flow through Frappe's login page into the CRM SPA.
|
|
* Runs without the shared auth state so it can assert the guest -> logged-in
|
|
* transition itself.
|
|
*/
|
|
test.describe('Login', () => {
|
|
test.use({ storageState: { cookies: [], origins: [] } })
|
|
|
|
test('logs in and lands on the CRM app', async ({ page }) => {
|
|
const login = new LoginPage(page)
|
|
await login.login(
|
|
process.env.FRAPPE_USER || 'Administrator',
|
|
process.env.FRAPPE_PASSWORD || 'admin',
|
|
)
|
|
|
|
await expect(page).toHaveURL(/\/crm/)
|
|
// The CRM shell renders its primary navigation once booted.
|
|
await expect(
|
|
page.getByRole('link', { name: 'Leads' }).first(),
|
|
).toBeVisible()
|
|
})
|
|
|
|
test('rejects invalid credentials', async ({ page }) => {
|
|
const login = new LoginPage(page)
|
|
await login.goto()
|
|
await page.fill('#login_email', 'Administrator')
|
|
await page.fill('#login_password', 'wrong-password')
|
|
await page.click('button.btn-login')
|
|
|
|
await login.expectOnLoginPage()
|
|
})
|
|
})
|