0

I have made an integration test for my flutter project based on this documentation which looks like this:

void main() {
  IntegrationTestWidgetsFlutterBinding.ensureInitialized();

  group('end-to-end test', () {
    testWidgets('tap on the floating action button, verify counter', (tester) async {
      app.main();
      await tester.pumpAndSettle();

      // Verify the counter starts at 0.
      expect(find.byKey(Key('settingsButton')), findsOneWidget);
    });
  });
}

The key is on an IconButton:

IconButton(key: Key('settingsButton'),
                iconSize:...

Unfortunately the test just hangs in 06:05 +0: loading /Users/... and only quits after 12! minutes with the following message: 12:00 +0 -1: Some tests failed.

  1. Is there any way to quit a running integration test?
  2. Is there any way to see why it hangs and why it failed?

I am using Android Studio.

Niels
  • 1,366
  • 15
  • 21

1 Answers1

1

Is there any way to quit a running integration test?

If you're running your tests with flutter test integration_test, then you should be able to simultaneously press "CTRL" and "C" to cancel execution.

Is there any way to see why it hangs and why it failed?

It's hard to tell without being able to reproduce your issue. Try running flutter test --verbose integration_test – it may contain some clues.

Bartek Pacia
  • 1,085
  • 3
  • 15
  • 37