class to subclass for any test that takes a WidgetTester
See ScreenTestHarness for setup of widgets with mixins
use UnitTestHarnessSetup to create a harness then pass it into the body of a test
testWidgets('myTest', uiHarness((given,when,then) async {}))
final uiHarness = HarnessSetup.setupWidgetHarness(MyHarness.new);
class MyHarness extends WidgetTestHarness {
}
- Inheritance
-
- Object
- FlutterTestHarness
- WidgetTestHarness
- Implementers
Constructors
- WidgetTestHarness(WidgetTester tester)
Properties
- commonTestHelper → CommonTester
-
abstraction so mixins can be written to support dart tests and widget tests
uses
pump,pumpAndSettle, andidlein widget tests. Uses Future.value and Future.microtask for unit testsno setteroverride - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tester → WidgetTester
-
WidgetTester that is passed into harness when the test is created.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setup(
) → Future< void> -
Used so mixins can setup testing infrastructure see SemanticTesterMixin for example
inherited
-
setupWidgetTree(
Widget child) → Widget -
Allows mixins to add appropriate widgets if needed.
inherited
-
setupZones(
Future< void> child()) → Future<void> -
used to wrap callback with runZoned or other test helpers that take a function.
see NetworkImageMixin for example of setup.
inherited
-
teardown(
) → Future< void> -
Used so mixins can teardown testing infrastructure see SemanticTesterMixin for example
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited