flutter_driver library

Provides API to test Flutter applications that run on real devices and emulators.

The application runs in a separate process from the test itself.

This is Flutter's version of Selenium WebDriver (generic web), Protractor (Angular), Espresso (Android) or Earl Gray (iOS).

Classes

Ancestor
A Flutter Driver finder that finds an ancestor of of that matches matching. [...]
BySemanticsLabel
A Flutter Driver finder that finds widgets by semantic label. [...]
ByText
A Flutter Driver finder that finds widgets by text inside a Text or EditableText widget.
ByTooltipMessage
A Flutter Driver finder that finds widgets by tooltip text.
ByType
A Flutter Driver finder that finds widgets by their runtimeType.
ByValueKey
A Flutter Driver finder that finds widgets by ValueKey.
CombinedCondition
A combined condition that waits until all the given conditions are met.
Command
An object sent from the Flutter Driver to a Flutter application to instruct the application to perform a task.
CommandWithTarget
A Flutter Driver command aimed at an object to be located by finder. [...]
CommonFinders
Provides convenient accessors to frequently used finders.
Descendant
A Flutter Driver finder that finds a descendant of of that matches matching. [...]
DiagnosticsTreeResult
The result of a GetDiagnosticsTree command.
DriverOffset
An immutable 2D floating-point offset used by Flutter Driver.
EnterText
A Flutter Driver command that enters text into the currently focused widget.
EnterTextResult
The result of the EnterText command.
EnumIndex<E>
Indexes a list of enum values by simple name. [...]
FirstFrameRasterized
A condition that waits until the Flutter engine has rasterized the first frame.
FlutterDriver
Drives a Flutter Application running in another process.
FlutterWebConnection
Encapsulates connection information to an instance of a Flutter Web application.
FuchsiaCompat
Utility class for creating connections to the Fuchsia Device. [...]
GetDiagnosticsTree
A Flutter Driver command to retrieve the JSON-serialized DiagnosticsNode tree of the object identified by finder. [...]
GetHealth
A Flutter Driver command that requests an application health check.
GetOffset
A Flutter Driver command that returns the offsetType from the RenderObject identified by finder. [...]
GetOffsetResult
The result of the GetOffset command. [...]
GetRenderTree
A Flutter Driver command that requests a string representation of the render tree.
GetSemanticsId
A Flutter driver command that retrieves a semantics id using a specified finder. [...]
GetSemanticsIdResult
The result of a GetSemanticsId command.
GetText
A Flutter Driver command that reads the text from a given element.
GetTextResult
The result of the GetText command.
Health
A description of the application state, as provided in response to a FlutterDriver.checkHealth test.
NoPendingFrame
A condition that waits until no pending frame is scheduled.
NoPendingPlatformMessages
A condition that waits until there are no pending platform messages.
NoTransientCallbacks
A condition that waits until no transient callbacks are scheduled.
PageBack
A Flutter Driver finder that finds the back button on the page's Material or Cupertino scaffold. [...]
RenderTree
A string representation of the render tree, the result of a FlutterDriver.getRenderTree method.
RequestData
A Flutter Driver command that sends a string to the application and expects a string response.
RequestDataResult
The result of the RequestData command.
Result
An object sent from a Flutter application back to the Flutter Driver in response to a command.
Scroll
A Flutter Driver command that commands the driver to perform a scrolling action.
ScrollIntoView
A Flutter Driver command that commands the driver to ensure that the element represented by finder has been scrolled completely into view.
ScrollResult
The result of a Scroll command.
SerializableFinder
Base class for Flutter Driver finders, objects that describe how the driver should search for elements.
SerializableWaitCondition
Base class for Flutter Driver wait conditions, objects that describe conditions the driver can wait for. [...]
SetFrameSync
A Flutter Driver command that enables or disables the FrameSync mechanism.
SetFrameSyncResult
The result of a SetFrameSync command.
SetSemantics
A Flutter Driver command that enables or disables semantics.
SetSemanticsResult
The result of a SetSemantics command.
SetTextEntryEmulation
A Flutter Driver command that enables and disables text entry emulation.
SetTextEntryEmulationResult
The result of the SetTextEntryEmulation command.
Tap
A Flutter Driver command that taps on a target widget located by finder.
TapResult
The result of a Tap command.
Timeline
Timeline data recorded by the Flutter runtime.
TimelineEvent
A single timeline event.
TimelineSummary
Extracts statistics from a Timeline.
VMServiceClientConnection
Encapsulates connection information to an instance of a Flutter application.
VMServiceFlutterDriver
An implementation of the Flutter Driver over the vmservice protocol.
WaitFor
A Flutter Driver command that waits until finder can locate the target.
WaitForAbsent
A Flutter Driver command that waits until finder can no longer locate the target.
WaitForAbsentResult
The result of a WaitForAbsent command.
WaitForCondition
A Flutter Driver command that waits until a given condition is satisfied.
WaitForResult
The result of a WaitFor command.
WaitUntilFirstFrameRasterized
A Flutter Driver command that waits until the Flutter engine rasterizes the first frame. [...]
WaitUntilNoPendingFrame
A Flutter Driver command that waits until the frame is synced. [...]
WaitUntilNoTransientCallbacks
A Flutter Driver command that waits until there are no more transient callbacks in the queue. [...]
WebFlutterDriver
An implementation of the Flutter Driver using the WebDriver. [...]

Mixins

DeserializeCommandFactory
A factory for deserializing Commands.
DeserializeFinderFactory
A factory for deserializing Finders.

Constants

find → const CommonFinders
A convenient accessor to frequently used finders. [...]
CommonFinders._()
kBuildBudget → const Duration
The maximum amount of time considered safe to spend for a frame's build phase. Anything past that is in the danger of missing the frame as 60FPS.
Duration(milliseconds: 16)
kBuildFrameEventName → const String
The name of the framework frame build events we need to filter or extract.
'Frame'
kRasterizeFrameEventName → const String
The name of the engine frame rasterization events we need to filter or extract.
'GPURasterizer::Draw'
kUnusuallyLongTimeout → const Duration
How long to wait before showing a message saying that things seem to be taking a long time.
Duration(seconds: 5)

Properties

driverLog DriverLogCallback
Print the given message to the console. [...]
read / write
fs FileSystem
The file system implementation used by this library. [...]
read / write
testOutputsDirectory String
Flutter Driver test output directory. [...]
read-only
vmServiceConnectFunction VMServiceConnectFunction
The connection function used by FlutterDriver.connect. [...]
read / write

Functions

restoreFileSystem() → void
Restores the file system to the default local file system implementation.
restoreVmServiceConnectFunction() → void
Restores vmServiceConnectFunction to its default value.
useMemoryFileSystemForTesting() → void
Overrides the file system so it can be tested without hitting the hard drive.
waitUntilExtensionInstalled(WebDriver driver, Duration timeout) Future<void>
Waits until extension is installed.

Enums

DiagnosticsType
DiagnosticsNode tree types that can be requested by GetDiagnosticsTree.
HealthStatus
A description of application state.
OffsetType
Offset types that can be requested by GetOffset.
TimelineStream
Timeline stream identifier.

Typedefs

DriverLogCallback(String source, String message) → void
Signature for driverLog. [...]
EvaluatorFunction() → dynamic
Computes a value. [...]
VMServiceConnectFunction(String url, {Map<String, dynamic> headers}) Future<VMServiceClientConnection>
A function that connects to a Dart VM service with headers given the url.

Exceptions / Errors

DriverError
Standard error thrown by Flutter Driver API.
SerializationException
Thrown to indicate a serialization error.