-
Notifications
You must be signed in to change notification settings - Fork 0
/
widget_test.dart
74 lines (55 loc) · 1.83 KB
/
widget_test.dart
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
///
import 'src/view.dart';
void main() {
/// Define a test. The TestWidgets function also provides a WidgetTester
/// to work with. The WidgetTester allows you to build and interact
/// with widgets in the test environment.
testWidgets('app_template testing', (WidgetTester tester) async {
//
await tester.pumpWidget(TemplateApp());
/// Flutter won’t automatically rebuild your widget in the test environment.
/// Use pump() or pumpAndSettle() to ask Flutter to rebuild the widget.
/// pumpAndSettle() waits for all animations to complete.
await tester.pumpAndSettle();
final con = TemplateController();
// for (var interface = 1; interface <= 2; interface++) {
//
int cnt = 1;
while (cnt <= 3) {
switch (con.application) {
case 'Counter':
/// Counter app testing
await counterTest(tester);
break;
case 'Word Pairs':
/// Random Word Pairs app
await wordsTest(tester);
break;
case 'Contacts':
/// Contacts app
await contactsTest(tester);
break;
}
/// Switch the app programmatically.
// con.changeApp();
/// Switch the app through the popupmenu
await openApplicationMenu(tester);
/// Wait for the transition in the Interface
await tester.pumpAndSettle();
cnt++;
}
/// Open the Locale window
await openLocaleMenu(tester);
/// Open About menu
await openAboutMenu(tester);
/// Switch the Interface
await openInterfaceMenu(tester);
// }
/// Unit testing does not involve integration or widget testing.
/// WordPairs App Model Unit Testing
await wordPairsModelTest(tester);
/// Unit testing the App's controller object
await testTemplateController(tester);
reportTestErrors();
});
}