Files
bchanot d33a8f6dad test(app): client journeys in Chromium on the isolated stack
Create, search, edit, archive, archived filter, restore; pages of 25;
keyboard only; two accounts; a concurrent edit; a retry after a lost answer
sends the same request id; network failures; the leave guard; a change of
language; FR/EN, desktop and 375 px, axe on every state. signIn shared.
2026-10-26 01:59:26 +01:00

18 lines
818 B
TypeScript

import type { Dict } from '@/i18n/types'
import type { Page } from '@playwright/test'
import { expect } from './browser'
import type { SandboxAccount } from './sandbox'
/** Signs in through the login form; resolves on the dashboard once the profile answered. */
export async function signIn(page: Page, account: SandboxAccount, dict: Dict) {
await page.goto('/login')
await page.getByLabel(dict['auth.email']).fill(account.email)
await page
.getByLabel(dict['auth.password'], { exact: true })
.fill(account.password)
await page.getByRole('button', { name: dict['auth.login.submit'] }).click()
await expect(page).toHaveURL(/\/app\/?$/)
// The greeting needs the profile: the session and the first REST call went through.
await expect(page.locator('main h1')).toContainText(account.displayName)
}