patrol icon indicating copy to clipboard operation
patrol copied to clipboard

Unexpected null result from Navigator.pop in patrolTest after upgrading to 3.19.0

Open mozhaiskyi opened this issue 2 months ago • 1 comments

Hi Patrol team,

First of all, thank you for creating such an amazing tool!

I’ve encountered an issue after upgrading Patrol from version 3.13.1 to 3.19.0. In one of my test cases, I open a screen and expect a result from the Navigator.pop method. However, in the Patrol test, the result is null, whereas everything works as expected when running the app normally.

My question is: does navigation inside a patrolTest behave differently compared to usual app execution? Are there any known differences or areas I should investigate to resolve this issue?

══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞═════════════════
The following _TypeError was thrown running a test:
type 'Null' is not a subtype of type 'bool' in type cast

When the exception was thrown, this was the stack:
#0      ModuleNavigator._pushReservationCreationScreen (package:host/app/di/module_navigator.dart:153:19)
Future<bool> _pushReservationCreationScreen(
    ReservationCreationInput input,
  ) async {
    final result = await _navigationStack.push(
      _reservationCreationScreen(input),
      fullscreenDialog: true,
    );
    return result as bool;
  }

Thanks in advance for your help!

mozhaiskyi avatar Oct 10 '25 16:10 mozhaiskyi

Hi @mozhaiskyi, did you try to set some static wait before navigation? Or try to change FramePolicy? My guess is that patrol do actions too fast and app throws some exception 🤔 Can you also attach test body?

Kendru98 avatar Oct 17 '25 08:10 Kendru98

Hi @mozhaiskyi ! Sorry for late response. It doesn't look like issue connected to patrol in any way - patrol just runs your app's code without any changes, so navigation works the same as it does in the app ran without patrol.

Make sure to debug your app's code - maybe more things changed than patrol version.

Closing issue as not related to patrol. In case you think the issue is valid, you can reopen the issue or open new one - please provide a project where we can reproduce the error.

jBorkowska avatar Nov 18 '25 15:11 jBorkowska