FlutterTestConfiguration class

Constructors

FlutterTestConfiguration()

Properties

build bool
If the application should be built prior to running the tests Defaults to true
getter/setter pair
buildFlavor String
The build flavor to run the tests against (optional) Defaults to empty
getter/setter pair
buildMode BuildMode
The default build mode used for running tests is --debug. We are exposing the option to run the tests also in --profile mode
getter/setter pair
createWorld ↔ CreateWorld?
An optional function to create a world object for each scenario.
getter/setter pairinherited
customStepParameterDefinitions Iterable<CustomParameter>?
Any user defined step parameters
getter/setter pairinherited
dartDefineArgs List<String>
--dart-define args to pass into the build parameters. Include the name and value for each. For example, --dart-define=MY_VAR="true" becomes ['MY_VAR="true"']
getter/setter pair
defaultTimeout Duration
The default step timeout - this can be override when definition a step definition
getter/setter pairinherited
featureDefaultLanguage String
The default feature language
getter/setter pairinherited
featureFileMatcher ↔ FeatureFileMatcher
getter/setter pairinherited
featureFileReader ↔ FeatureFileReader
getter/setter pairinherited
features Iterable<Pattern>
The path(s) to all the features. All three Patterns are supported: RegExp, String, Glob.
getter/setter pairinherited
flutterBuildTimeout Duration
Duration to wait for Flutter to build and start the app on the target device Slower machine may take longer to build and run a large app Defaults to 90 seconds
getter/setter pair
flutterDriverMaxConnectionAttempts int
The maximum times the flutter driver can try and connect to the running app Defaults to 3
getter/setter pair
flutterDriverReconnectionDelay Duration
Duration to wait before reconnecting the Flutter driver to the app. On slower machines the app might not be in a state where the driver can successfully connect immediately Defaults to 2 seconds
getter/setter pair
getAttachmentManager ↔ CreateAttachmentManager
used to get a new instance of an attachment manager class that is passed to the World context
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
hooks Iterable<Hook>?
Hooks that are run at certain points in the execution cycle
getter/setter pairinherited
keepAppRunningAfterTests bool
Will keep the Flutter application running when done testing Defaults to false
getter/setter pair
logFlutterProcessOutput bool
Logs Flutter process output to stdout The Flutter process is use to start and driver the app under test. The output may contain build and run information Defaults to false
getter/setter pair
onAfterFlutterDriverConnect ↔ (Future<void> Function(FlutterDriver driver)?)
Called after the successful connection of Flutter driver to the running application. Depending on your configuration this method will be called on each new connection usually before each scenario is run.
getter/setter pair
onBeforeFlutterDriverConnect ↔ (Future<void> Function()?)
Called before any attempt to connect Flutter driver to the running application, Depending on your configuration this method will be called before each scenario is run.
getter/setter pair
order ↔ ExecutionOrder
The execution order of features - this default to random to avoid any inter-test dependencies
getter/setter pairinherited
reporters Iterable<Reporter>?
a list of reporters to use. Built-in reporters:
getter/setter pairinherited
restartAppBetweenScenarios bool
restarts the application under test between each scenario. Defaults to true to avoid the application being in an invalid state before each test
getter/setter pair
runningAppProtocolEndpointUri String?
An observatory url that the test runner can connect to instead of creating a new running instance of the target application Url takes the form of http://127.0.0.1:51540/EM72VtRsUV0=/ and usually printed to stdout in the form Connecting to service protocol: http://127.0.0.1:51540/EM72VtRsUV0=/ You will have to add the --verbose flag to the command to start your flutter app to see this output and ensure enableFlutterDriverExtension() is called by the running app
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stepDefinitions Iterable<StepDefinitionGeneric<World>>?
The user defined step definitions that are matched with written steps in the features
getter/setter pairinherited
stopAfterTestFailed bool
the program will stop after any test failed
getter/setter pairinherited
tagExpression String?
a filter to limit the features that are run based on tags see https://docs.cucumber.io/cucumber/tag-expressions/ for expression syntax
getter/setter pairinherited
targetAppPath String
The target app to run the tests against Defaults to "lib/test_driver/app.dart"
getter/setter pair
targetAppWorkingDirectory String?
Option to define the working directory for the process that runs the app under test (optional) Handy if your app is separated from your tests as flutter needs to be able to find a pubspec file
getter/setter pair
targetDeviceId String
The target device id to run the tests against when multiple devices detected Defaults to empty
getter/setter pair
verboseFlutterProcessLogs bool
Sets the --verbose flag on the flutter process Defaults to false
getter/setter pair

Methods

createFlutterDriver([String? dartVmServiceUrl]) Future<FlutterDriver>
createFlutterWorld(TestConfiguration config, FlutterWorld? world) Future<FlutterWorld>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepare() → void
used to allow for custom configuration to ensure framework specific configuration is in place
setObservatoryDebuggerUri(String uri) → void
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

DEFAULT(Iterable<StepDefinitionGeneric<World>> steps, {String featurePath = 'features/*.*.feature', String targetAppPath = 'test_driver/app.dart'}) FlutterTestConfiguration
Provide a configuration object with default settings such as the reports and feature file location Additional setting on the configuration object can be set on the returned instance.