@@ -26,10 +26,14 @@ class E2EWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding {
26
26
// `plugins.flutter.io/e2e`. Mark the tests as complete before invoking
27
27
// the channel.
28
28
if (kIsWeb) {
29
- if (! _allTestsPassed.isCompleted) _allTestsPassed.complete (true );
29
+ if (! _allTestsPassed.isCompleted) {
30
+ _allTestsPassed.complete (true );
31
+ }
30
32
}
31
33
await _channel.invokeMethod <void >(
32
- 'allTestsFinished' , < String , dynamic > {'results' : _results});
34
+ 'allTestsFinished' ,
35
+ < String , dynamic > {'results' : _results},
36
+ );
33
37
} on MissingPluginException {
34
38
print ('Warning: E2E test plugin was not detected.' );
35
39
}
@@ -110,20 +114,30 @@ class E2EWidgetsFlutterBinding extends LiveTestWidgetsFlutterBinding {
110
114
}
111
115
112
116
@override
113
- Future <void > runTest (Future <void > testBody (), VoidCallback invariantTester,
114
- {String description = '' , Duration timeout}) async {
117
+ Future <void > runTest (
118
+ Future <void > testBody (),
119
+ VoidCallback invariantTester, {
120
+ String description = '' ,
121
+ Duration timeout,
122
+ }) async {
115
123
// TODO(jackson): Report the results individually instead of all at once
116
124
// See https://github.com/flutter/flutter/issues/38985
117
- final TestExceptionReporter valueBeforeTest = reportTestException;
125
+ final TestExceptionReporter oldTestExceptionReporter = reportTestException;
118
126
reportTestException =
119
127
(FlutterErrorDetails details, String testDescription) {
120
128
_results[description] = 'failed' ;
121
129
_failureMethodsDetails.add (Failure (testDescription, details.toString ()));
122
- if (! _allTestsPassed.isCompleted) _allTestsPassed.complete (false );
123
- valueBeforeTest (details, testDescription);
130
+ if (! _allTestsPassed.isCompleted) {
131
+ _allTestsPassed.complete (false );
132
+ }
133
+ oldTestExceptionReporter (details, testDescription);
124
134
};
125
- await super .runTest (testBody, invariantTester,
126
- description: description, timeout: timeout);
135
+ await super .runTest (
136
+ testBody,
137
+ invariantTester,
138
+ description: description,
139
+ timeout: timeout,
140
+ );
127
141
_results[description] ?? = 'success' ;
128
142
}
129
143
}
0 commit comments