Skip to content

Tester

Tester #

Bases: Service

Class that programmatically interacts with page controls and the test environment.

enter_text #

enter_text(finder: Finder, text: str)

Give the text input control specified by finder the focus and replace its content with text, as if it had been provided by the onscreen keyboard.

PARAMETER DESCRIPTION
finder

Finder to search for a control.

TYPE: Finder

text

The text to enter.

TYPE: str

find_by_icon #

find_by_icon(icon: IconData) -> Finder

Finds controls by an icon.

PARAMETER DESCRIPTION
icon

The Icon to search by.

TYPE: IconData

find_by_key #

find_by_key(key: KeyValue) -> Finder

Finds controls by a Key instance or key name.

PARAMETER DESCRIPTION
key

A key instance or its name.

TYPE: KeyValue

find_by_text #

find_by_text(text: str) -> Finder

Finds controls containing string equal to the text argument.

PARAMETER DESCRIPTION
text

The exact text value to search control by.

TYPE: str

find_by_text_containing #

find_by_text_containing(pattern: str) -> Finder

Finds controls containing specified text pattern.

PARAMETER DESCRIPTION
pattern

Regular expression pattern.

TYPE: str

find_by_tooltip #

find_by_tooltip(value: str) -> Finder

Finds controls by a tooltip.

PARAMETER DESCRIPTION
value

Tooltip value.

TYPE: str

long_press #

long_press(finder: Finder)

Dispatch a pointer down / pointer up sequence (with a delay of 600 ms between the two events) at the center of the given control, assuming it is exposed.

PARAMETER DESCRIPTION
finder

Finder to search for a control.

TYPE: Finder

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: Finder

pump #

pump(duration: DurationValue | None = None)

Triggers a frame after duration amount of time.

PARAMETER DESCRIPTION
duration

A duration after which to trigger a frame.

TYPE: DurationValue | None DEFAULT: None

pump_and_settle #

pump_and_settle(duration: DurationValue | None = None)

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.

PARAMETER DESCRIPTION
duration

A duration after which to trigger a frame.

TYPE: DurationValue | None DEFAULT: None

take_screenshot #

take_screenshot(name: str) -> bytes

Takes a screenshot of the entire application window. This method works when testing on iOS and Android only.

PARAMETER DESCRIPTION
name

The name of the screenshot.

TYPE: str

RETURNS DESCRIPTION
bytes

Screenshot in PNG format.

tap #

tap(finder: Finder)

Dispatch a pointer down / pointer up sequence at the center of the given control, assuming it is exposed.

PARAMETER DESCRIPTION
finder

Finder to search for a control.

TYPE: Finder

teardown #

teardown()

Teardown Flutter integration test and exit Flutter process.