2026-04-06 19:15:22 +03:00
|
|
|
/**
|
|
|
|
|
* System page tests -- MEDIUM tier.
|
2026-04-06 19:54:09 +03:00
|
|
|
*
|
2026-04-07 00:39:11 +03:00
|
|
|
* Tests system page rendering with tabs and tab switching.
|
|
|
|
|
* Navigates to /system#general explicitly so useHashState resolves
|
|
|
|
|
* the tab state deterministically.
|
2026-04-06 19:15:22 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { test, expect } from "../fixtures/frigate-test";
|
|
|
|
|
|
|
|
|
|
test.describe("System Page @medium", () => {
|
2026-04-07 00:39:11 +03:00
|
|
|
test("system page renders with tab buttons", async ({ frigateApp }) => {
|
|
|
|
|
await frigateApp.goto("/system#general");
|
|
|
|
|
await expect(frigateApp.page.getByLabel("Select general")).toHaveAttribute(
|
|
|
|
|
"data-state",
|
|
|
|
|
"on",
|
|
|
|
|
{ timeout: 15_000 },
|
|
|
|
|
);
|
2026-04-06 19:54:09 +03:00
|
|
|
await expect(frigateApp.page.getByLabel("Select storage")).toBeVisible();
|
|
|
|
|
await expect(frigateApp.page.getByLabel("Select cameras")).toBeVisible();
|
2026-04-06 19:15:22 +03:00
|
|
|
});
|
|
|
|
|
|
2026-04-07 00:39:11 +03:00
|
|
|
test("general tab is active when navigated via hash", async ({
|
2026-04-06 19:54:09 +03:00
|
|
|
frigateApp,
|
|
|
|
|
}) => {
|
2026-04-07 00:39:11 +03:00
|
|
|
await frigateApp.goto("/system#general");
|
|
|
|
|
await expect(frigateApp.page.getByLabel("Select general")).toHaveAttribute(
|
|
|
|
|
"data-state",
|
|
|
|
|
"on",
|
|
|
|
|
{ timeout: 15_000 },
|
|
|
|
|
);
|
2026-04-06 19:15:22 +03:00
|
|
|
});
|
|
|
|
|
|
2026-04-07 00:39:11 +03:00
|
|
|
test("clicking Storage tab activates it and deactivates General", async ({
|
|
|
|
|
frigateApp,
|
|
|
|
|
}) => {
|
|
|
|
|
await frigateApp.goto("/system#general");
|
|
|
|
|
await expect(frigateApp.page.getByLabel("Select general")).toHaveAttribute(
|
|
|
|
|
"data-state",
|
|
|
|
|
"on",
|
|
|
|
|
{ timeout: 15_000 },
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
await frigateApp.page.getByLabel("Select storage").click();
|
|
|
|
|
await expect(frigateApp.page.getByLabel("Select storage")).toHaveAttribute(
|
|
|
|
|
"data-state",
|
|
|
|
|
"on",
|
|
|
|
|
{ timeout: 5_000 },
|
|
|
|
|
);
|
|
|
|
|
await expect(frigateApp.page.getByLabel("Select general")).toHaveAttribute(
|
|
|
|
|
"data-state",
|
|
|
|
|
"off",
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
test("clicking Cameras tab activates it and deactivates General", async ({
|
|
|
|
|
frigateApp,
|
|
|
|
|
}) => {
|
|
|
|
|
await frigateApp.goto("/system#general");
|
|
|
|
|
await expect(frigateApp.page.getByLabel("Select general")).toHaveAttribute(
|
|
|
|
|
"data-state",
|
|
|
|
|
"on",
|
|
|
|
|
{ timeout: 15_000 },
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
await frigateApp.page.getByLabel("Select cameras").click();
|
|
|
|
|
await expect(frigateApp.page.getByLabel("Select cameras")).toHaveAttribute(
|
|
|
|
|
"data-state",
|
|
|
|
|
"on",
|
|
|
|
|
{ timeout: 5_000 },
|
|
|
|
|
);
|
|
|
|
|
await expect(frigateApp.page.getByLabel("Select general")).toHaveAttribute(
|
|
|
|
|
"data-state",
|
|
|
|
|
"off",
|
|
|
|
|
);
|
2026-04-06 19:54:09 +03:00
|
|
|
});
|
|
|
|
|
|
2026-04-07 00:39:11 +03:00
|
|
|
test("system page shows version and last refreshed", async ({
|
|
|
|
|
frigateApp,
|
|
|
|
|
}) => {
|
|
|
|
|
await frigateApp.goto("/system#general");
|
|
|
|
|
await expect(frigateApp.page.getByLabel("Select general")).toHaveAttribute(
|
|
|
|
|
"data-state",
|
|
|
|
|
"on",
|
|
|
|
|
{ timeout: 15_000 },
|
|
|
|
|
);
|
|
|
|
|
await expect(frigateApp.page.getByText("0.15.0-test")).toBeVisible();
|
|
|
|
|
await expect(frigateApp.page.getByText(/Last refreshed/)).toBeVisible();
|
2026-04-06 19:15:22 +03:00
|
|
|
});
|
|
|
|
|
});
|