mirror of https://github.com/vuejs/vitepress
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
540 B
22 lines
540 B
import { chromium, type Browser } from 'playwright-chromium'
|
|
|
|
let browser: Browser
|
|
|
|
beforeAll(async () => {
|
|
browser = await chromium.connect(process.env['WS_ENDPOINT']!)
|
|
globalThis.page = await browser.newPage()
|
|
globalThis.goto = async (path: string) => {
|
|
await page.goto(`http://localhost:${process.env['PORT']}${path}`)
|
|
await page.waitForSelector('#app .Layout')
|
|
}
|
|
})
|
|
|
|
afterAll(async () => {
|
|
await page.close()
|
|
await browser.close()
|
|
// @ts-ignore
|
|
delete globalThis.page
|
|
// @ts-ignore
|
|
delete globalThis.goto
|
|
})
|