Files
frigate/web/e2e/pages/live.page.ts
T
Josh HawkinsandGitHub 0977fa5e15 Improve camera group live view grids (#24461)
* rework live dashboard grid layout and add natural mode

* hide natural aspect and layout import on phones

* fix merge conflict

* add confirmation dialog for clearing groups and streaming settings

* add confirmation dialog for natural aspect switch

* clean up

* remove note

* wording tweak

* remove unused

* fixes
2026-09-27 17:09:31 -06:00

61 lines
2.0 KiB
TypeScript

/**
* Live dashboard + single-camera page object.
*
* Encapsulates selectors and viewport-conditional openers for the
* Live route. Does NOT own assertions — specs call expect on the
* locators returned from these getters.
*/
import type { Locator, Page } from "@playwright/test";
import { BasePage } from "./base.page";
export class LivePage extends BasePage {
constructor(page: Page, isDesktop: boolean) {
super(page, isDesktop);
}
/** The camera card wrapper on the dashboard, keyed by camera name. */
cameraCard(name: string): Locator {
return this.page.locator(`[data-camera='${name}']`);
}
/** Back button on the single-camera view header (desktop text). */
get backButton(): Locator {
return this.page.getByText("Back", { exact: true });
}
/** History button on the single-camera view header (desktop text). */
get historyButton(): Locator {
return this.page.getByText("History", { exact: true });
}
/** All CameraFeatureToggle elements (active + inactive). */
get featureToggles(): Locator {
// Use div selector to exclude NavItem anchor elements that share the same classes.
return this.page.locator(
"div.flex.flex-col.items-center.justify-center.bg-selected, div.flex.flex-col.items-center.justify-center.bg-secondary",
);
}
/** Only the active (bg-selected) feature toggles. */
get activeFeatureToggles(): Locator {
// Use div selector to exclude NavItem anchor elements that share the same classes.
return this.page.locator(
"div.flex.flex-col.items-center.justify-center.bg-selected",
);
}
/** Edit-layout toggle on the draggable grid (desktop, custom groups). */
get editLayoutButton(): Locator {
return this.page.getByTestId("toggle-edit-layout");
}
/** Open the right-click context menu on a camera card (desktop only). */
async openContextMenuOn(cameraName: string): Promise<Locator> {
await this.cameraCard(cameraName).first().click({ button: "right" });
return this.page
.locator('[role="menu"], [data-radix-menu-content]')
.first();
}
}