Skip to main content

Module test

Module test 

Source
Expand description

Headless UI integration testing helpers for GPUI Material components and applications.

Enable test-support under [dev-dependencies] so production builds carry zero observation overhead. Render views inside a headless window opened via crate::MaterialRoot::open_window, drive interactions through TestWindowExt / TestEventExt / TestInput, and assert both native accessibility ElementSnapshot properties and application state.

ElementSnapshot values are immutable. Call TestWindowExt::render_frame after external state changes, or use TestAppContextExt::wait_for outside update_window for asynchronous and deferred updates.

Structs§

ClickOptions
Configuration for TestWindowExt::click_with_options.
ElementSnapshot
Owned facts from the last paint of an observed element.
ScopedWindow
A borrowed GPUI ElementId scope returned by TestWindowExt::within.
TestInput
Bridges an explicit GPUI InputHandler to a test window so tests can exercise UTF-16 composition (replace_and_mark_text_in_range), preedit cancellation, and text commits without relying on an OS IME.
TextSnapshot
Text that a text component painted in the window’s last drawn frame.

Traits§

TestAppContextExt
Executor-aware asynchronous helpers on TestAppContext that run outside a borrowed window update.
TestEventExt
Step-level pointer, modifier, and keyboard dispatch helpers for tests that inspect intermediate gesture state.
TestQueryExt
Accessibility-oriented observation queries over a Window or ScopedWindow.
TestSupportExt
Registers an existing element for UI queries. Its native accessibility properties are read automatically; there are no test-only property setters.
TestWindowExt
High-level query and native event dispatch operations on a GPUI Window.

Functions§

painted_quads
Returns painted quads from the last frame with split border/background slices sharing identical bounds and paint properties merged back together.