Files
windmill/frontend/tests/global-setup.ts
T
Ruben Fiszel 9883eae2e7 Replace cypress with playwright (#170)
* cypress

* all

* global setup

* global setup

* setup node

* setup node

* setup node
2022-07-05 01:46:43 +02:00

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