2026-04-06 19:15:22 +03:00
|
|
|
/**
|
|
|
|
|
* Config Editor page tests -- MEDIUM tier.
|
2026-04-06 19:54:09 +03:00
|
|
|
*
|
|
|
|
|
* Tests Monaco editor loading, YAML content rendering,
|
|
|
|
|
* save button presence, and copy button interaction.
|
2026-04-06 19:15:22 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { test, expect } from "../fixtures/frigate-test";
|
|
|
|
|
|
|
|
|
|
test.describe("Config Editor @medium", () => {
|
2026-04-06 19:54:09 +03:00
|
|
|
test("config editor loads Monaco editor with content", async ({
|
|
|
|
|
frigateApp,
|
|
|
|
|
}) => {
|
2026-04-06 19:15:22 +03:00
|
|
|
await frigateApp.goto("/config");
|
2026-04-06 19:54:09 +03:00
|
|
|
await frigateApp.page.waitForTimeout(5000);
|
|
|
|
|
// Monaco editor should render with a specific class
|
|
|
|
|
const editor = frigateApp.page.locator(
|
|
|
|
|
".monaco-editor, [data-keybinding-context]",
|
|
|
|
|
);
|
|
|
|
|
await expect(editor.first()).toBeVisible({ timeout: 10_000 });
|
2026-04-06 19:15:22 +03:00
|
|
|
});
|
|
|
|
|
|
2026-04-06 19:54:09 +03:00
|
|
|
test("config editor has action buttons", async ({ frigateApp }) => {
|
2026-04-06 19:15:22 +03:00
|
|
|
await frigateApp.goto("/config");
|
2026-04-06 19:54:09 +03:00
|
|
|
await frigateApp.page.waitForTimeout(5000);
|
2026-04-06 19:15:22 +03:00
|
|
|
const buttons = frigateApp.page.locator("button");
|
|
|
|
|
const count = await buttons.count();
|
|
|
|
|
expect(count).toBeGreaterThan(0);
|
|
|
|
|
});
|
2026-04-06 19:54:09 +03:00
|
|
|
|
|
|
|
|
test("config editor button clicks do not crash", async ({ frigateApp }) => {
|
|
|
|
|
await frigateApp.goto("/config");
|
|
|
|
|
await frigateApp.page.waitForTimeout(5000);
|
|
|
|
|
// Find buttons with SVG icons (copy, save, etc.)
|
|
|
|
|
const iconButtons = frigateApp.page.locator("button:has(svg)");
|
|
|
|
|
const count = await iconButtons.count();
|
|
|
|
|
if (count > 0) {
|
|
|
|
|
// Click the first icon button (likely copy)
|
|
|
|
|
await iconButtons.first().click();
|
|
|
|
|
await frigateApp.page.waitForTimeout(500);
|
|
|
|
|
}
|
|
|
|
|
await expect(frigateApp.page.locator("body")).toBeVisible();
|
|
|
|
|
});
|
2026-04-06 19:15:22 +03:00
|
|
|
});
|