File tree Expand file tree Collapse file tree 3 files changed +37
-32
lines changed
packages/e2e/example/test_driver Expand file tree Collapse file tree 3 files changed +37
-32
lines changed Original file line number Diff line number Diff line change @@ -10,25 +10,11 @@ import 'package:flutter/material.dart';
1010import 'package:flutter_test/flutter_test.dart' ;
1111import 'package:e2e/e2e.dart' ;
1212
13+ import 'example_e2e_io.dart' if (dart.library.html) 'example_e2e_web.dart' as tests;
14+
1315import 'package:e2e_example/main.dart' as app;
1416
1517void main () {
1618 E2EWidgetsFlutterBinding .ensureInitialized ();
17- testWidgets ('verify text' , (WidgetTester tester) async {
18- // Build our app and trigger a frame.
19- app.main ();
20-
21- // Trigger a frame.
22- await tester.pumpAndSettle ();
23-
24- // Verify that platform version is retrieved.
25- expect (
26- find.byWidgetPredicate (
27- (Widget widget) =>
28- widget is Text &&
29- widget.data.startsWith ('Platform: ${Platform .operatingSystem }' ),
30- ),
31- findsOneWidget,
32- );
33- });
19+ tests.main ();
3420}
Original file line number Diff line number Diff line change 1+ // This is a basic Flutter widget test.
2+ //
3+ // To perform an interaction with a widget in your test, use the WidgetTester
4+ // utility that Flutter provides. For example, you can send tap and scroll
5+ // gestures. You can also use WidgetTester to find child widgets in the widget
6+ // tree, read text, and verify that the values of widget properties are correct.
7+
8+ import 'dart:io' show Platform;
9+ import 'package:flutter/material.dart' ;
10+ import 'package:flutter_test/flutter_test.dart' ;
11+ import 'package:e2e/e2e.dart' ;
12+
13+ import 'package:e2e_example/main.dart' as app;
14+
15+ void main () {
16+ E2EWidgetsFlutterBinding .ensureInitialized ();
17+ testWidgets ('verify text' , (WidgetTester tester) async {
18+ // Build our app and trigger a frame.
19+ app.main ();
20+
21+ // Trigger a frame.
22+ await tester.pumpAndSettle ();
23+
24+ // Verify that platform version is retrieved.
25+ expect (
26+ find.byWidgetPredicate (
27+ (Widget widget) =>
28+ widget is Text &&
29+ widget.data.startsWith ('Platform: ${Platform .operatingSystem }' ),
30+ ),
31+ findsOneWidget,
32+ );
33+ });
34+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments