mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-05-03 12:07:40 +03:00
Some checks are pending
CI / AMD64 Build (push) Waiting to run
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions
* add mock data * add helpers * page objects * updated specs * remove PENDING_REWARITE * formatting
26 lines
885 B
TypeScript
26 lines
885 B
TypeScript
/**
|
|
* Clipboard read helper for e2e tests.
|
|
*
|
|
* Clipboard API requires a browser permission in headless mode.
|
|
* grantClipboardPermissions() must be called before any readClipboard()
|
|
* attempt. Used by logs.spec.ts (Copy button) and config-editor.spec.ts
|
|
* (Copy button).
|
|
*/
|
|
|
|
import type { BrowserContext, Page } from "@playwright/test";
|
|
|
|
/**
|
|
* Grant clipboard-read + clipboard-write permissions on the context.
|
|
* Call in beforeEach or at the top of a test before the Copy action.
|
|
*/
|
|
export async function grantClipboardPermissions(
|
|
context: BrowserContext,
|
|
): Promise<void> {
|
|
await context.grantPermissions(["clipboard-read", "clipboard-write"]);
|
|
}
|
|
|
|
/** Read the current clipboard contents via the page's navigator.clipboard. */
|
|
export async function readClipboard(page: Page): Promise<string> {
|
|
return page.evaluate(async () => await navigator.clipboard.readText());
|
|
}
|