Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to enable LocalInspectionMode for auto-generated tests from Compose Preview? #652

Open
mikanIchinose opened this issue Feb 7, 2025 · 4 comments

Comments

@mikanIchinose
Copy link

I'm using generateComposePreviewRobolectricTests to automatically generate tests from Compose Previews, but there are cases where LocalInspectionMode is needed.

This is particularly relevant for components that load images from the internet using Coil.

I noticed that support for LocalInspectionMode was added in v1.37.0, but my understanding is that it can only be enabled manually when writing tests using RoborazziComposeOptions.

Would it be possible to provide a way to enable this via the generateComposePreviewRobolectricTests block or gradle.properties? I would appreciate your consideration.

@takahirom
Copy link
Owner

Thanks. We are developing @RoboComposePreviewOptions, which will enable the customization of features like this. However, this process requires significant architectural planning time. Thank you for your patience.
#633

@takahirom
Copy link
Owner

I would check if the test is running on Robolectric, and you could add inspection mode to your codebase. I think you have your own AsyncImage()-like function in your code.
https://stackoverflow.com/a/30713876/4339442

@takahirom
Copy link
Owner

For Coil, have you tried this?
https://github.com/coil-kt/coil/tree/main/coil-test

@mikanIchinose
Copy link
Author

Thank you!. I'll try it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants