Skip to content

FletTestApp

FletTestApp #

page #

page: Page

Returns an instance of Flet's app Page.

tester #

tester: Tester

Returns an instance of Tester class that programmatically interacts with page controls and the test environment.

assert_control_screenshot #

assert_control_screenshot(name: str, control: Control)

Adds control to a clean page, takes a screenshot and compares it with a golden copy or takes golden screenshot if FLET_TEST_GOLDEN=1 environment variable is set.

PARAMETER DESCRIPTION
name

Screenshot name - will be used as a base for a screenshot filename.

TYPE: str

control

Control to take a screenshot of.

TYPE: Control

assert_screenshot #

assert_screenshot(name: str, screenshot: bytes)

Compares provided screenshot with a golden copy or takes golden screenshot if FLET_TEST_GOLDEN=1 environment variable is set.

PARAMETER DESCRIPTION
name

Screenshot name - will be used as a base for a screenshot filename.

TYPE: str

screenshot

Screenshot contents in PNG format.

TYPE: bytes

start #

start()

Starts Flet app and Flutter integration test process.

teardown #

teardown()

Teardown Flutter integration test process.