test: add Playwright E2E test suite (30 tests)
Add browser-level end-to-end tests covering public pages, Keycloak OAuth authentication flow, dashboard interactions, providers config, developer section, organization pages, and sidebar navigation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
55
e2e/providers.spec.ts
Normal file
55
e2e/providers.spec.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
|
||||
test.describe("Providers page", () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto("/providers");
|
||||
await page.waitForSelector(".providers-page", { timeout: 15_000 });
|
||||
});
|
||||
|
||||
test("providers page loads with header", async ({ page }) => {
|
||||
await expect(page.locator(".page-header")).toContainText("Providers");
|
||||
});
|
||||
|
||||
test("provider dropdown has Ollama selected by default", async ({
|
||||
page,
|
||||
}) => {
|
||||
const providerSelect = page
|
||||
.locator(".form-group")
|
||||
.filter({ hasText: "Provider" })
|
||||
.locator("select");
|
||||
|
||||
await expect(providerSelect).toHaveValue(/ollama/i);
|
||||
});
|
||||
|
||||
test("changing provider updates the model dropdown", async ({ page }) => {
|
||||
const providerSelect = page
|
||||
.locator(".form-group")
|
||||
.filter({ hasText: "Provider" })
|
||||
.locator("select");
|
||||
|
||||
// Get current model options
|
||||
const modelSelect = page
|
||||
.locator(".form-group")
|
||||
.filter({ hasText: /^Model/ })
|
||||
.locator("select");
|
||||
const initialOptions = await modelSelect.locator("option").allTextContents();
|
||||
|
||||
// Change to a different provider
|
||||
await providerSelect.selectOption({ label: "OpenAI" });
|
||||
|
||||
// Wait for model list to update
|
||||
await page.waitForTimeout(500);
|
||||
const updatedOptions = await modelSelect.locator("option").allTextContents();
|
||||
|
||||
// Model options should differ between providers
|
||||
expect(updatedOptions).not.toEqual(initialOptions);
|
||||
});
|
||||
|
||||
test("save button shows confirmation feedback", async ({ page }) => {
|
||||
const saveBtn = page.locator("button", { hasText: "Save Configuration" });
|
||||
await saveBtn.click();
|
||||
|
||||
await expect(page.locator(".form-success")).toBeVisible({ timeout: 5_000 });
|
||||
await expect(page.locator(".form-success")).toContainText("saved");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user