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
@@ -1,6 +1,5 @@
|
||||
import { en } from '@/i18n/en'
|
||||
import { fr } from '@/i18n/fr'
|
||||
import type { Dict } from '@/i18n/types'
|
||||
import type { Page } from '@playwright/test'
|
||||
import {
|
||||
expect,
|
||||
@@ -10,11 +9,8 @@ import {
|
||||
focusedName,
|
||||
test,
|
||||
} from '../support/browser'
|
||||
import {
|
||||
createAccount,
|
||||
routeToSandbox,
|
||||
type SandboxAccount,
|
||||
} from '../support/sandbox'
|
||||
import { createAccount, routeToSandbox } from '../support/sandbox'
|
||||
import { signIn } from '../support/shell'
|
||||
|
||||
// The authenticated shell on the isolated stack: sign-in, dashboard, the
|
||||
// account photo confirmation and the mobile drawer, through the shared modal.
|
||||
@@ -24,18 +20,6 @@ const LANGUAGES = [
|
||||
['en', en],
|
||||
] as const
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
/** Focus steps of `count` Tab presses, the browser's interface written « browser ». */
|
||||
async function tabWalk(page: Page, count: number): Promise<string[]> {
|
||||
const steps: string[] = []
|
||||
|
||||
Reference in new issue
Block a user