@@ -17,15 +17,13 @@ import '../../test_infra/matchers/matchers.dart';
17
17
const inspectorChangeSettleTime = Duration (seconds: 2 );
18
18
19
19
void main () {
20
+ const windowSize = Size (2600.0 , 1200.0 );
20
21
// We need to use real async in this test so we need to use this binding.
21
22
initializeLiveTestWidgetsFlutterBindingWithAssets ();
22
- const windowSize = Size (2600.0 , 1200.0 );
23
23
24
- final env = FlutterTestEnvironment (
25
- const FlutterRunConfiguration (withDebugger: true ),
26
- );
24
+ late FlutterTestEnvironment env;
27
25
28
- env.afterEverySetup = () async {
26
+ Future < void > resetInspectorSelection () async {
29
27
final service = serviceConnection.inspectorService;
30
28
if (env.reuseTestEnvironment) {
31
29
// Ensure the previous test did not set the selection on the device.
@@ -37,19 +35,26 @@ void main() {
37
35
isAlive: null ,
38
36
);
39
37
}
40
- };
38
+ }
41
39
42
- setUp (() async {
43
- await env.setupEnvironment ();
44
- // Ensure the legacy inspector is enabled:
45
- preferences.inspector.setLegacyInspectorEnabled (true );
46
- });
40
+ group ('screenshot tests' , () {
41
+ setUpAll (() {
42
+ env = FlutterTestEnvironment (
43
+ const FlutterRunConfiguration (withDebugger: true ),
44
+ );
45
+ env.afterEverySetup = resetInspectorSelection;
46
+ });
47
47
48
- tearDownAll (() async {
49
- await env.tearDownEnvironment (force: true );
50
- });
48
+ setUp (() async {
49
+ await env.setupEnvironment ();
50
+ // Ensure the legacy inspector is enabled:
51
+ preferences.inspector.setLegacyInspectorEnabled (true );
52
+ });
53
+
54
+ tearDownAll (() async {
55
+ await env.tearDownEnvironment (force: true );
56
+ });
51
57
52
- group ('screenshot tests' , () {
53
58
testWidgetsWithWindowSize ('navigation' , windowSize, (
54
59
WidgetTester tester,
55
60
) async {
@@ -99,6 +104,9 @@ void main() {
99
104
matchesDevToolsGolden (
100
105
'../../test_infra/goldens/integration_inspector_select_center_details_tree.png' ,
101
106
),
107
+ // Implementation widgets from Flutter framework are not guaranteed to
108
+ // be stable.
109
+ skip: 'https://github.com/flutter/flutter/issues/172037' ,
102
110
);
103
111
104
112
// Select the RichText row.
@@ -109,6 +117,9 @@ void main() {
109
117
matchesDevToolsGolden (
110
118
'../../test_infra/goldens/integration_inspector_richtext_selected.png' ,
111
119
),
120
+ // Implementation widgets from Flutter framework are not guaranteed to
121
+ // be stable.
122
+ skip: 'https://github.com/flutter/flutter/issues/172037' ,
112
123
);
113
124
114
125
// Test hovering over the icon shown when a property has its default
@@ -131,6 +142,9 @@ void main() {
131
142
matchesDevToolsGolden (
132
143
'../../test_infra/goldens/integration_inspector_scaffold_selected.png' ,
133
144
),
145
+ // Implementation widgets from Flutter framework are not guaranteed to
146
+ // be stable.
147
+ skip: 'https://github.com/flutter/flutter/issues/172037' ,
134
148
);
135
149
136
150
// The important thing about this is that the details tree should scroll
@@ -143,6 +157,9 @@ void main() {
143
157
matchesDevToolsGolden (
144
158
'../../test_infra/goldens/integration_animated_physical_model_selected.png' ,
145
159
),
160
+ // Implementation widgets from Flutter framework are not guaranteed to
161
+ // be stable.
162
+ skip: 'https://github.com/flutter/flutter/issues/172037' ,
146
163
);
147
164
148
165
await env.tearDownEnvironment ();
@@ -401,15 +418,25 @@ void main() {
401
418
});
402
419
403
420
group ('widget errors' , () {
404
- testWidgetsWithWindowSize ('show navigator and error labels' , windowSize, (
405
- WidgetTester tester,
406
- ) async {
421
+ setUpAll (() async {
422
+ env = FlutterTestEnvironment (
423
+ testAppDirectory: 'test/test_infra/fixtures/inspector_app' ,
424
+ const FlutterRunConfiguration (withDebugger: true ),
425
+ );
407
426
await env.setupEnvironment (
408
427
config: const FlutterRunConfiguration (
409
428
withDebugger: true ,
410
429
entryScript: 'lib/overflow_errors.dart' ,
411
430
),
412
431
);
432
+ env.afterEverySetup = resetInspectorSelection;
433
+ // Enable the legacy inspector.
434
+ preferences.inspector.setLegacyInspectorEnabled (true );
435
+ });
436
+
437
+ testWidgetsWithWindowSize ('show navigator and error labels' , windowSize, (
438
+ WidgetTester tester,
439
+ ) async {
413
440
expect (serviceConnection.serviceManager.service, equals (env.service));
414
441
expect (serviceConnection.serviceManager.isolateManager, isNotNull);
415
442
0 commit comments