NoctermTester class

Main testing interface for TUI applications. Provides methods for rendering frames, simulating input, and inspecting state.

Properties

debugPrintAfterPump bool
Enable or disable debug printing after pump
no getter
frameCount int
Get the number of frames that have been rendered
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
terminalState TerminalState
Get the current terminal state
no setter

Methods

dispose() → void
Clean up resources
enterText(String text) Future<void>
Simulate typing text
findAllComponents<T extends Component>() List<T>
Find all components of a specific type
findComponent<T extends Component>() → T?
Find a component in the tree by type
findState<T extends State<StatefulComponent>>() → T
Find a state of a specific type in the component tree
hover(int x, int y) Future<void>
Simulate mouse hover at the given position
mouseMove(int startX, int startY, int endX, int endY) Future<void>
Simulate mouse movement from one position to another
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
press(int x, int y) Future<void>
Simulate a mouse press at the given position (without releasing)
pump([Duration? duration]) Future<void>
Pump a single frame
pumpAndSettle([Duration duration = const Duration(milliseconds: 100), int maxIterations = 20]) Future<void>
Pump frames until no more frames are scheduled
pumpComponent(Component component, [Duration? duration]) Future<void>
Pump a component as the root of the tree
release(int x, int y) Future<void>
Simulate a mouse release at the given position
renderToString({bool showBorders = true}) String
Render the current state as a string for debugging
sendArrowDown() Future<void>
sendArrowLeft() Future<void>
sendArrowRight() Future<void>
sendArrowUp() Future<void>
sendBackspace() Future<void>
sendDelete() Future<void>
sendEnter() Future<void>
Send common key combinations
sendEscape() Future<void>
sendKey(LogicalKey key) Future<void>
Send a key press by logical key
sendKeyEvent(KeyboardEvent event) Future<void>
Send a keyboard event
sendMouseEvent(MouseEvent event) Future<void>
Send a mouse event
sendTab() Future<void>
tap(int x, int y) Future<void>
Simulate a mouse tap at the given position
toSnapshot() String
Get a snapshot string for comparison
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

create({Size size = const Size(80, 24), bool debugPrintAfterPump = false}) Future<NoctermTester>
Create a new TUI tester with optional size configuration