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.
This commit is contained in:
1 parent
b38e62770e
commit
d33a8f6dad
4 files changed
+638
-27
No files matched your search
@@ -0,0 +1,17 @@
|
||||
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)
|
||||
}
|
||||
Reference in new issue
Block a user