Skip to content

API Reference / @gtkx/testing / captureAndSaveScreenshot

Variable: captureAndSaveScreenshot

const captureAndSaveScreenshot: (selector?, options?) => Promise<ScreenshotResult>

Defined in: screenshot.d.ts:26

Captures a screenshot of a toplevel window, writes it to a temporary file, logs its path, and returns the image data.

Parameters

selector?

WindowSelector

Chooses the window by index, title substring, or regular expression; defaults to the first toplevel.

options?

ScreenshotOptions

Optional scale, timeout, and retry interval.

Returns

Promise<ScreenshotResult>

The base64-encoded PNG data along with its mime type and dimensions.

Released under the MPL-2.0 License.