mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-05-05 09:20:26 +02:00
* shared admin level test dependency * change to on - push (recommended by chromatic) * change playwright reporter to list, name test jobs * use test tags ... much cleaner * test vs prod * try copying templates * run with localhost? * revert to dev * new tests and a bit of refactoring * add additional checks so that page snapshots reflect loaded state * more admin tests * User Management tests * remaining admin pages * test search and chat * await fix and exclude UI that changes with dates.
25 lines
696 B
TypeScript
25 lines
696 B
TypeScript
// dependency for all admin user tests
|
|
|
|
import { test as setup, expect } from "@playwright/test";
|
|
import { TEST_CREDENTIALS } from "./constants";
|
|
|
|
setup("authenticate", async ({ page }) => {
|
|
const { email, password } = TEST_CREDENTIALS;
|
|
|
|
await page.goto("http://localhost:3000/search");
|
|
|
|
await page.waitForURL("http://localhost:3000/auth/login?next=%2Fsearch");
|
|
|
|
await expect(page).toHaveTitle("Danswer");
|
|
|
|
await page.fill("#email", email);
|
|
await page.fill("#password", password);
|
|
|
|
// Click the login button
|
|
await page.click('button[type="submit"]');
|
|
|
|
await page.waitForURL("http://localhost:3000/search");
|
|
|
|
await page.context().storageState({ path: "admin_auth.json" });
|
|
});
|