🔧 Update Playwright config and tests to use env variables (#1266)

This commit is contained in:
Alejandra
2024-07-23 14:59:39 -05:00
committed by GitHub
parent aff2146d7e
commit 06a2ec8a2b
7 changed files with 54 additions and 9 deletions

View File

@@ -1,11 +1,13 @@
import { test as setup } from "@playwright/test"
import { firstSuperuser, firstSuperuserPassword } from "./config.ts"
const authFile = "playwright/.auth/user.json"
setup("authenticate", async ({ page }) => {
await page.goto("/login")
await page.getByPlaceholder("Email").fill("admin@example.com")
await page.getByPlaceholder("Password").fill("changethis")
await page.getByPlaceholder("Email").fill(firstSuperuser)
await page.getByPlaceholder("Password").fill(firstSuperuserPassword)
await page.getByRole("button", { name: "Log In" }).click()
await page.waitForURL("/")
await page.context().storageState({ path: authFile })