mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-19 16:02:14 +00:00
9883eae2e7
* cypress * all * global setup * global setup * setup node * setup node * setup node
20 lines
758 B
TypeScript
20 lines
758 B
TypeScript
import { chromium, FullConfig } from '@playwright/test'
|
|
|
|
async function globalSetup(config: FullConfig) {
|
|
console.log('start global setup!')
|
|
const browser = await chromium.launch()
|
|
const page = await browser.newPage()
|
|
await page.goto('http://localhost:8000/user/login')
|
|
await page.locator('text=login without third-party').click()
|
|
await page.locator('#email').fill('admin@windmill.dev')
|
|
await page.locator('input[type="password"]').fill('changeme')
|
|
await page.locator('text="Login"').click()
|
|
await page.waitForResponse('http://localhost:8000/api/auth/login')
|
|
await page.context().storageState({ path: 'storageState.json' })
|
|
await browser.close()
|
|
console.log('end global setup!')
|
|
|
|
}
|
|
|
|
export default globalSetup
|