Tester
Tester
#
Bases: Service
Class that programmatically interacts with page controls and the test environment.
page
#
The page (of type Page
or PageView
) to which this control belongs to.
parent
#
parent: BaseControl | None
The direct ancestor(parent) of this control.
It defaults to None
and will only have a value when this control is mounted (added to the page tree).
The Page
control (which is the root of the tree) is an exception - it always has parent=None
.
before_update
#
This method is called every time when this control is being updated.
Note
Make sure not to call/request an update()
here.
enter_text
#
find_by_icon
#
Finds controls by an icon.
PARAMETER | DESCRIPTION |
---|---|
icon
|
The Icon to search by.
TYPE:
|
find_by_key
#
find_by_text
#
Finds controls containing string equal to the text
argument.
PARAMETER | DESCRIPTION |
---|---|
text
|
The exact text value to search control by.
TYPE:
|
find_by_text_containing
#
Finds controls containing specified text pattern.
PARAMETER | DESCRIPTION |
---|---|
pattern
|
Regular expression pattern.
TYPE:
|
mouse_hover
#
mouse_hover(finder: Finder)
Dispatch a pointer hover event at the center of the given control.
PARAMETER | DESCRIPTION |
---|---|
finder
|
Finder to search for a control.
TYPE:
|
pump
#
pump(duration: Duration | None = None)
Triggers a frame after duration amount of time.
PARAMETER | DESCRIPTION |
---|---|
duration
|
A duration after which to trigger a frame.
TYPE:
|
pump_and_settle
#
Repeatedly calls pump until there are no longer any frames scheduled.
This will call pump
at least once, even if no frames are scheduled when
the function is called, to flush any pending microtasks which may
themselves schedule a frame.
This essentially waits for all animations to have completed.