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§
- Click
Options - Configuration for
TestWindowExt::click_with_options. - Element
Snapshot - Owned facts from the last paint of an observed element.
- Scoped
Window - A borrowed GPUI
ElementIdscope returned byTestWindowExt::within. - Test
Input - Bridges an explicit GPUI
InputHandlerto 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. - Text
Snapshot - Text that a text component painted in the window’s last drawn frame.
Traits§
- Test
AppContext Ext - Executor-aware asynchronous helpers on
TestAppContextthat run outside a borrowed window update. - Test
Event Ext - Step-level pointer, modifier, and keyboard dispatch helpers for tests that inspect intermediate gesture state.
- Test
Query Ext - Accessibility-oriented observation queries over a
WindoworScopedWindow. - Test
Support Ext - Registers an existing element for UI queries. Its native accessibility properties are read automatically; there are no test-only property setters.
- Test
Window Ext - 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.