mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-11 17:05:43 +00:00
19 lines
752 B
TypeScript
19 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;
|