mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
18 lines
752 B
TypeScript
18 lines
752 B
TypeScript
import { chromium } from "@playwright/test";
|
|
import { users } from "./fixtures/users";
|
|
import { Role } from "./fixtures/roles";
|
|
|
|
async function globalSetup() {
|
|
const browser = await chromium.launch();
|
|
const page = await browser.newPage();
|
|
await page.goto("http://localhost:4000/ui/login");
|
|
await page.getByPlaceholder("Enter your username").fill(users[Role.ProxyAdmin].email);
|
|
await page.getByPlaceholder("Enter your password").fill(users[Role.ProxyAdmin].password);
|
|
const loginButton = page.getByRole("button", { name: "Login" });
|
|
await loginButton.click();
|
|
await page.waitForSelector("text=AI Gateway");
|
|
await page.context().storageState({ path: "admin.storageState.json" });
|
|
await browser.close();
|
|
}
|
|
|
|
export default globalSetup;
|