CaptureObsidianScreenshotOptions
Options for captureObsidianScreenshot.
Import:
import type { CaptureObsidianScreenshotOptions } from 'obsidian-integration-testing';Signature:
export interface CaptureObsidianScreenshotOptionsProperties
| Property | Type | Description |
|---|---|---|
| heightInPixels? | number | The exact height in pixels the captured image should have. Desktop only, and only meaningful together with widthInPixels. Ignored on mobile, where the image is always the device's native framebuffer — size those by choosing an AVD with the wanted screen geometry. |
| shouldHideCaret? | boolean | Whether to hide the focused element's caret while capturing, so the frame does not depend on which phase of its blink the capture caught. The caret is made transparent, not blurred: the focus, its ring and anything open because of it — a suggester under an input — all stay as the test built them, and the caret is put back once the frame is taken. Turn it off only to photograph the caret itself, and expect such a frame to differ between runs. |
| shouldHideVaultName? | boolean | Whether to hide the vault's name before capturing, so the frame does not depend on the random suffix of the harness's temporary vault. A default rather than a knob: reproducibility is what a checked-in screenshot is for, and the row it collapses sits under the caption band, so nothing a reader sees moves. Turn it off only to photograph the vault switcher itself. |
| shouldPinWindowFocus? | boolean | Whether to draw the window as focused while capturing, so the frame does not depend on whether the operating system gave the window foreground focus that run. Obsidian darkens the title bar of an unfocused window, and a freshly launched one is routinely refused the foreground. The is-focused class is added for the capture and handed back to Obsidian afterwards; the window's real focus is never touched. Turn it off only to photograph the unfocused chrome itself, and expect such a frame to differ between runs. |
| shouldVerifyTheme? | boolean | Whether to refuse the frame when the body is no longer in the theme applyObsidianTheme last applied.A theme lost after it was applied fails nothing on its own: the frame is simply shot in the other theme and written over the committed one. Refusing turns that into a named error. Nothing is checked when no theme was applied through applyObsidianTheme. Turn it off only for a frame that changes the theme on purpose. |
| transport? | ObsidianTransport | Override the transport. When omitted, the transport the current test context is driving is used. |
| vaultPath? | string | The vault path to capture. When omitted, the current test context's vault is used. |
| widthInPixels? | number | The exact width in pixels the captured image should have. See heightInPixels — the two are set together or not at all. |
Links to this page: