mirror of
https://github.com/multica-ai/multica.git
synced 2026-06-16 19:29:26 +02:00
44 lines
1.7 KiB
TypeScript
44 lines
1.7 KiB
TypeScript
import { test, expect } from "@playwright/test";
|
|
import { loginAsDefault, waitForPageText } from "./helpers";
|
|
|
|
const ROUTE_CHANGE_TIMEOUT = 30000;
|
|
|
|
test.describe("Navigation", () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await loginAsDefault(page);
|
|
await page.waitForLoadState("networkidle");
|
|
});
|
|
|
|
test("sidebar navigation works", async ({ page }) => {
|
|
await page.getByRole("link", { name: "Inbox" }).click();
|
|
await expect(page).toHaveURL(/\/inbox/, { timeout: ROUTE_CHANGE_TIMEOUT });
|
|
await waitForPageText(page, "Inbox");
|
|
|
|
await page.getByRole("link", { name: "Agents" }).click();
|
|
await expect(page).toHaveURL(/\/agents/, { timeout: ROUTE_CHANGE_TIMEOUT });
|
|
await waitForPageText(page, "Agents");
|
|
|
|
await page.getByRole("link", { name: "Issues", exact: true }).click();
|
|
await expect(page).toHaveURL(/\/issues/, { timeout: ROUTE_CHANGE_TIMEOUT });
|
|
await waitForPageText(page, "Issues");
|
|
});
|
|
|
|
test("settings page loads via sidebar", async ({ page }) => {
|
|
await page.getByRole("link", { name: "Settings", exact: true }).click();
|
|
await expect(page).toHaveURL(/\/settings/, { timeout: ROUTE_CHANGE_TIMEOUT });
|
|
await waitForPageText(page, "Settings");
|
|
|
|
await expect(page.getByRole("tab", { name: "General" })).toBeVisible();
|
|
await expect(page.getByRole("tab", { name: "Members" })).toBeVisible();
|
|
});
|
|
|
|
test("agents page shows agent list", async ({ page }) => {
|
|
await page.getByRole("link", { name: "Agents" }).click();
|
|
await expect(page).toHaveURL(/\/agents/, { timeout: ROUTE_CHANGE_TIMEOUT });
|
|
await waitForPageText(page, "Agents");
|
|
|
|
// Should show "Agents" heading
|
|
await expect(page.locator("text=Agents").first()).toBeVisible();
|
|
});
|
|
});
|