Skip to main content

@gtkx/testing

Functions

FunctionDescription
cleanupCleans up the rendered component tree.
configureConfigures the testing library behavior.
findAllByLabelTextFinds all elements matching label or text content.
findAllByRoleFinds all elements matching an accessible role.
findAllByTestIdFinds all elements matching a test ID pattern.
findAllByTextFinds all elements matching visible text content.
findByLabelTextFinds a single element by its label or text content.
findByRoleFinds a single element by accessible role.
findByTestIdFinds a single element by test ID (widget name).
findByTextFinds a single element by visible text content.
fireEventEmits a GTK signal on a widget or event controller.
getConfigReturns the current testing library configuration.
getRolesCollects all accessible roles and their widgets from a container.
logRolesLogs all accessible roles in a container to the console.
prettyRolesFormats roles into a readable string for error messages.
prettyWidgetFormats a widget tree as a readable string for debugging.
queryAllByLabelTextFinds all elements matching label text without throwing.
queryAllByRoleFinds all elements matching a role without throwing.
queryAllByTestIdFinds all elements matching a test ID without throwing.
queryAllByTextFinds all elements matching text content without throwing.
queryByLabelTextFinds a single element matching label text without throwing.
queryByRoleFinds a single element matching a role without throwing.
queryByTestIdFinds a single element matching a test ID without throwing.
queryByTextFinds a single element matching text content without throwing.
renderRenders a React element for testing.
screenshotCaptures a screenshot of a GTK widget as a PNG image.
tickYields to the event loop, allowing pending GTK events to process.
waitForWaits for a callback to succeed.
waitForElementToBeRemovedWaits for an element to be removed from the widget tree.
withinCreates scoped query methods for a container widget.

Variables

VariableDescription
screenGlobal query object for accessing rendered components.
userEventUser interaction utilities for testing.

Type Aliases

Type AliasDescription
BoundQueriesQuery methods bound to a container.
ByRoleOptionsOptions for role-based queries.
ConfigConfiguration options for the testing library.
NormalizerOptionsOptions for text normalization before matching.
PointerInputPointer input actions for simulating mouse interactions.
PrettyWidgetOptionsOptions for prettyWidget.
RenderOptionsOptions for render.
RenderResultResult returned by render.
RoleInfoInformation about a widget and its accessible name.
ScreenshotOptions-
ScreenshotResultResult returned by screenshot and screen.screenshot.
TabOptionsOptions for tab navigation.
TextMatchText matching pattern.
TextMatchFunctionCustom function for matching text content.
TextMatchOptionsOptions for text-based queries.
WaitForOptionsOptions for waitFor and waitForElementToBeRemoved.