TestStepRegistry class

Registry that allows for the binding of custom test steps. There exists a default instance that will always be used when a custom instance is not available.

More often than not, applications will simply want to add the custom steps to the default instance, but if an application needs different steps for different modes of the application, then this provides that capability by allowing an application to register the custom steps to a specific instance and then provide that instance using the Provider.value.

Constructors

TestStepRegistry({String? debugLabel, List<TestStepBuilder>? steps})

Properties

availableSteps List<AvailableTestStep>
Returns the complete list of available tests. This will first get the list of built in steps, then overlay on the custom steps assigned by the application.
no setter
debugLabel String?
Label that can be used to assist with debugging
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getAvailableTestStep(String id) AvailableTestStep?
Returns the test step that matches the given id. This will first look in the registered custom steps and then if no custom step with the given id exists, this will look in the built in steps. If no step for the given id can be found, this will return null.
getBuilder(String id) TestStepBuilder?
Returns the builder for the given id. This will first look in the registered custom steps and then if no custom step with the given id exists, this will look in the built in steps. If no step for the given id can be found, this will return null.
getRunnerStep({required String id, required dynamic values}) TestRunnerStep?
Returns a TestRunnerStep for the given id and given set of values. This will first look in the registered custom steps and then fall back to the built in steps. If no step can be located for the given id then this will return null.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerCustomStep(TestStepBuilder step) → void
Registers a custom step with the registry. If a custom step is already registered with the same ultimate id then it will be replaced with this. If a built in step is registered with the same ultimate id then this will shadow the built in step such that this step will now be used in place of the built in step.
registerCustomSteps(List<TestStepBuilder>? steps) → void
Simple convenience method that calls registerCustomStep for every entity in the given list.
toString() String
Returns a string name for the registry for debugging.
override

Operators

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

Static Properties

instance TestStepRegistry
Default instance that will be provided unless otherwise specified.
final

Static Methods

of(BuildContext context) TestStepRegistry
Returns the registery bound to the widget tree. If no registry is bound to the widget tree, this will return the default instance.