danswer/web/tests/e2e/admin_token_rate_limits.spec.ts
rkuo-danswer 70207b4b39
improve web testing (#3162)
* 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.
2024-11-21 04:01:15 +00:00

23 lines
735 B
TypeScript

import { test, expect } from "@chromatic-com/playwright";
test(
"Admin - User Management - Token Rate Limits",
{
tag: "@admin",
},
async ({ page }, testInfo) => {
// Test simple loading
await page.goto("http://localhost:3000/admin/token-rate-limits");
await expect(page.locator("h1.text-3xl")).toHaveText("Token Rate Limits");
await expect(page.locator("p.text-sm").nth(0)).toHaveText(
/^Token rate limits enable you control how many tokens can be spent in a given time period./
);
await expect(
page.getByRole("button", { name: "Create a Token Rate Limit" })
).toHaveCount(1);
await expect(page.locator("h1.text-lg")).toHaveText(
"Global Token Rate Limits"
);
}
);