Replies: 3 comments 2 replies
-
Hi @Calpoog, that's the first time I hear about such problem. Thanks for reporting. You can get better logs when running with |
Beta Was this translation helpful? Give feedback.
-
Totally missed that! But yes, that was much more helpful and confirmed that the first exception is indeed that an asset could not be found. As linked above, supposedly integration tests should work with package paths for assets in the same package, but it definitely does not appear to be the case here. I'm wondering if it's because Patrol has it's own custom bindings? I'm pretty busy but maybe I can set up the example app and add a single package reference asset to validate this. |
Beta Was this translation helpful? Give feedback.
-
I confirmed by modifying my simple test. Here is my test: void main() {
Future<Widget> setup() async {
return Column(
children: [
Image.asset('assets/Images/Loading/loading-spinner.png'),
Image.asset(
'packages/my_package/assets/Images/Loading/loading-spinner.png'),
],
);
}
patrolTest(
'The app loads past the splash screen',
($) async {
final app = await setup();
await $.pumpWidgetAndSettle(app);
expect(true, isTrue);
},
);
} If I remove the second image, the test succeeds. If I leave it, the test fails. The test just tests true=true, so the uncaught asset exception is causing the failure. This package path works outside of this package in an app that consumes it. |
Beta Was this translation helpful? Give feedback.
-
I've got an app package that's an app only in order to do integration testing. The contents of my package are actually meant to be consumed by other apps. Because of that, all assets are referenced with package paths, aka "packages/my_packages/asset/path/file".
I'm seeing briefly when the app pops up during a patrol test that the assets are showing as having failed to load. There was historically a Flutter bug that package paths didn't work in tests within that same package – however, it is supposedly fixed:
flutter/flutter#111350. Unfortunately, due to Patrol's lack of exception/log capturing all I know is that the test failed to run with "multiple exceptions".
Anyone have experience with this? Obviously I can't remove the package path references because then all assets would fail in the consuming application.
Beta Was this translation helpful? Give feedback.
All reactions