AppTest class abstract

This class allow for a simpler API to write widget test.

void main() {
  testApp('Test example', CheckoutTest());
}

class CheckoutTest extends AppTest {
  @override
  Future<void> run() async {
    await pumpWidget(MyApp());
    await screenshot();

    await tap(ElevatedButton);
    await screenshot();

    await enterText(TextField, 'Name');
    await screenshot();
  }
}

Constructors

AppTest()

Properties

autoScreenshot bool
getter/setter pair
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
no setter

Methods

call(WidgetTester tester) Future<void>
dragUntilVisible(dynamic target, dynamic scrollview, {Offset? moveStep}) Future<void>
ensureVisible(dynamic target, {Screenshot? screenshot}) Future<void>
enterText(dynamic target, String text, {bool pumpFrames = true, Screenshot? screenshot}) Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pump([Duration? duration, EnginePhase phase = EnginePhase.sendSemanticsUpdate]) Future<void>
pumpAndSettle() Future<void>
pumpWidget(Widget widget, {bool pumpFrames = true, Screenshot? screenshot}) Future<void>
run() Future<void>
screenshot({String? name, List<String>? tags}) Future<void>
Takes a screenshot of the current widget and display it in the Flutterware visualizer
setUp() Future<void>
This function is run before each test and allows to setup the test environment
splitTest(Map<String, Future<void> Function()> paths) Future<void>
tap(dynamic target, {bool pumpFrames = true, bool warnIfMissed = true, Screenshot? screenshot}) Future<void>
targetToFinder(dynamic target, {bool skipOffStage = true}) Finder
tearDown() Future<void>
This function is run after each test and allows to clean the test environment
toString() String
A string representation of this object.
inherited

Operators

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