|
5 | 5 | // gestures. You can also use WidgetTester to find child widgets in the widget |
6 | 6 | // tree, read text, and verify that the values of widget properties are correct. |
7 | 7 |
|
8 | | -import 'package:flutter/material.dart'; |
9 | | -import 'package:flutter_test/flutter_test.dart'; |
10 | | - |
11 | | -import 'package:demo_app/main.dart'; |
12 | | - |
13 | | -void main() { |
14 | | - testWidgets('Counter increments smoke test', (WidgetTester tester) async { |
15 | | - // Build our app and trigger a frame. |
16 | | - await tester.pumpWidget(MyApp()); |
17 | | - |
18 | | - // Verify that our counter starts at 0. |
19 | | - expect(find.text('0'), findsOneWidget); |
20 | | - expect(find.text('1'), findsNothing); |
21 | | - |
22 | | - // Tap the '+' icon and trigger a frame. |
23 | | - await tester.tap(find.byIcon(Icons.add)); |
24 | | - await tester.pump(); |
25 | | - |
26 | | - // Verify that our counter has incremented. |
27 | | - expect(find.text('0'), findsNothing); |
28 | | - expect(find.text('1'), findsOneWidget); |
29 | | - }); |
30 | | -} |
| 8 | +//import 'package:flutter/material.dart'; |
| 9 | +//import 'package:flutter_test/flutter_test.dart'; |
| 10 | +// |
| 11 | +//import 'package:demo_app/main.dart'; |
| 12 | +// |
| 13 | +//void main() { |
| 14 | +// testWidgets('Counter increments smoke test', (WidgetTester tester) async { |
| 15 | +// // Build our app and trigger a frame. |
| 16 | +// await tester.pumpWidget(MyApp()); |
| 17 | +// |
| 18 | +// // Verify that our counter starts at 0. |
| 19 | +// expect(find.text('0'), findsOneWidget); |
| 20 | +// expect(find.text('1'), findsNothing); |
| 21 | +// |
| 22 | +// // Tap the '+' icon and trigger a frame. |
| 23 | +// await tester.tap(find.byIcon(Icons.add)); |
| 24 | +// await tester.pump(); |
| 25 | +// |
| 26 | +// // Verify that our counter has incremented. |
| 27 | +// expect(find.text('0'), findsNothing); |
| 28 | +// expect(find.text('1'), findsOneWidget); |
| 29 | +// }); |
| 30 | +//} |
0 commit comments