test(editor): V1-2.6 browser journeys on the sandbox, touch drag and findings fixes
This commit is contained in:
1 parent
7bbd096a16
commit
5097fd7484
18 files changed
+3010
-8
No files matched your search
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Global setup of the shell suite (V1-2.6): the Vite dev server discovers some
|
||||
* dependencies only when a route first loads them and answers with a full page
|
||||
* reload, which wiped a form a test had begun to fill. One throwaway session
|
||||
* visits the editor routes and every tab once before the tests start, so the
|
||||
* reload happens here and not in a test.
|
||||
*/
|
||||
import { chromium, type FullConfig } from '@playwright/test'
|
||||
import { fr } from '@/i18n/fr'
|
||||
import { stepUpAdmin } from './admin'
|
||||
import { draftPath, editorActor, seedDraft, standardShape } from './editor'
|
||||
import { routeToSandbox } from './sandbox'
|
||||
import { signIn } from './shell'
|
||||
|
||||
const TABS = [
|
||||
'general',
|
||||
'views',
|
||||
'annotations',
|
||||
'findings',
|
||||
'references',
|
||||
'vertebrae',
|
||||
'verification',
|
||||
] as const
|
||||
|
||||
export default async function warmUp(config: FullConfig): Promise<void> {
|
||||
const baseURL = config.projects[0].use.baseURL ?? ''
|
||||
const actor = await editorActor('fr')
|
||||
const seed = await seedDraft(actor, { shape: standardShape })
|
||||
const browser = await chromium.launch()
|
||||
const context = await browser.newContext({ baseURL, locale: 'fr-FR' })
|
||||
await routeToSandbox(context)
|
||||
const page = await context.newPage()
|
||||
await signIn(page, actor.account, fr)
|
||||
await page.goto('/app/admin')
|
||||
await stepUpAdmin(page, fr, actor.secret)
|
||||
for (const path of ['/app/admin/sheets/new', draftPath(seed.sheetId)]) {
|
||||
await page.goto(path)
|
||||
await page.waitForLoadState('networkidle')
|
||||
}
|
||||
for (const tab of TABS) {
|
||||
await page
|
||||
.getByRole('tab', { name: fr[`editor.tab.${tab}`], exact: true })
|
||||
.click()
|
||||
await page.waitForLoadState('networkidle')
|
||||
}
|
||||
await page.goto('/app/admin/sheets/new')
|
||||
await page.waitForLoadState('networkidle')
|
||||
await browser.close()
|
||||
}
|
||||
Reference in new issue
Block a user