Documentation
On this page

Interface · Testing

DesktopTestDriver

Headless driver for locating and interacting with controls by their key.

@sharpts/gui 0.0.0-local · SharpTS 7c6010104a43

Members

afterRender

afterRender(callback: () => void): void

Runs a callback after pending async event, reactive render, and native commit work completes.

cancelPointer

cancelPointer(key: string): void

Cancels an active captured primary mouse pointer on its keyed control.

click

click(key: string): void

Activates the keyed control.

clickMenuItem

clickMenuItem(key: string): void

Invokes a keyed menu item through the native routed-click path.

dragPointer

dragPointer(key: string, points: readonly { x: number; y: number }[]): void

Drags the primary mouse pointer through local x/y coordinate pairs on a keyed control.

dropText

dropText(key: string, value: string): string

Simulates dropping text on a keyed control.

getProperty

getProperty(key: string, property: DesktopTestProperty): string

Reads a supported native property from the keyed control.

getText

getText(key: string): string

Reads the keyed control's text content.

movePointer

movePointer(key: string, point: { x: number; y: number }): void

Moves an active primary mouse pointer to local coordinates on its keyed control.

pressKey

pressKey(key: string): void

Sends a normalized key press to the keyed control.

pressPointer

pressPointer(key: string, point: { x: number; y: number }): void

Presses the primary mouse pointer at local coordinates on a keyed control.

queueFolderDialogResult

queueFolderDialogResult(path: string | null): void

Queues a local path, or null cancellation, for the next native folder dialog.

queueMessageDialogResult

queueMessageDialogResult(result: "ok" | "cancel" | "yes" | "no"): void

Queues the result consumed by the next native message dialog.

queueOpenFileDialogResult

queueOpenFileDialogResult(paths: readonly string[]): void

Queues local paths returned by the next native open-file dialog.

queueSaveFileDialogResult

queueSaveFileDialogResult(path: string | null): void

Queues a local path, or null cancellation, for the next native save-file dialog.

releasePointer

releasePointer(key: string, point: { x: number; y: number }): void

Releases an active primary mouse pointer at local coordinates on its keyed control.

setCheckBoxValue

setCheckBoxValue(key: string, value: boolean): void

Replaces the checked state of a keyed CheckBox.

setComboBoxIndex

setComboBoxIndex(key: string, value: number): void

Selects an item in a keyed ComboBox.

setSliderValue

setSliderValue(key: string, value: number): void

Replaces the numeric value of a keyed Slider.

setTextBoxValue

setTextBoxValue(key: string, value: string): void

Replaces the value of a keyed TextBox.

setWindowClientSize

setWindowClientSize(width: number, height: number): void

Replaces the headless window client size in device-independent pixels.

Source

SharpTS.Gui.Sdk/GuiPackage/testing.ts:9 at SharpTS revision 7c6010104a43c34d80e9d44704cf179bc4f5b8e0.