NyTesterClock class
A PlaybookClock for widget tests: it pumps the tester instead of sleeping, so a playbook at natural speed finishes in about a second.
testWidgets('signs up', (tester) async {
await tester.pumpWidget(const MyApp());
final report = await SignUpPlaybook().run(clock: NyTesterClock(tester));
expectPlaybookPassed(report);
});
- Inheritance
-
- Object
- PlaybookClock
- NyTesterClock
Constructors
- NyTesterClock(WidgetTester tester)
-
Creates a clock that pumps
tester.
Properties
- elapsed → Duration
-
How much time has passed on this clock since it was created.
no 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
-
The tester whose frames this clock pumps.
final
Methods
-
frame(
) → Future< void> -
Waits until the next frame has been drawn.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
wait(
Duration duration) → Future< void> -
Waits for
duration, letting frames render meanwhile.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited