flutter_gherkin icon indicating copy to clipboard operation
flutter_gherkin copied to clipboard

Test finishing timeout if the last screen of the app contains animation

Open SashaKryzh opened this issue 3 years ago • 1 comments

I have a test where the last screen is a ListView with a loading indicator at the bottom (pagination). In this situation, the pumpAndSettle will result in infinite loop failing the test to finish.

https://github.com/jonsamwell/flutter_gherkin/blob/eff82509c71c457714d2fbc2a54334d33b397c03/lib/src/flutter/runners/gherkin_integration_test_runner.dart#L532-L541

SashaKryzh avatar Aug 08 '22 12:08 SashaKryzh

Here is my current workaround:

executeTestSuite(
    appMainFunction: appInitializationFn,
    configuration: gherkinTestConfiguration(reporter),
    // Fixes: https://github.com/jonsamwell/flutter_gherkin/issues/259
    appLifecyclePumpHandler: (phase, tester) =>
        tester.pump(const Duration(seconds: 5)),
  );

SashaKryzh avatar Aug 08 '22 12:08 SashaKryzh

@SashaKryzh that is the correct idea. The tester pumps after steps so if an animation is running endlessly the pump call with never finish

jonsamwell avatar Oct 17 '22 08:10 jonsamwell