Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

widget_test.dart 1.0 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  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. import 'package:flutter/material.dart';
  8. import 'package:flutter_test/flutter_test.dart';
  9. import 'package:wifi_data/main.dart';
  10. void main() {
  11. testWidgets('Counter increments smoke test', (WidgetTester tester) async {
  12. // Build our app and trigger a frame.
  13. await tester.pumpWidget(MyApp());
  14. // Verify that our counter starts at 0.
  15. expect(find.text('0'), findsOneWidget);
  16. expect(find.text('1'), findsNothing);
  17. // Tap the '+' icon and trigger a frame.
  18. await tester.tap(find.byIcon(Icons.add));
  19. await tester.pump();
  20. // Verify that our counter has incremented.
  21. expect(find.text('0'), findsNothing);
  22. expect(find.text('1'), findsOneWidget);
  23. });
  24. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...