Assigned
Status Update
Comments
pa...@outlook.com <pa...@outlook.com> #2
I did not have permissions to post this in component ID 1581441 so I hope someone can move this to the correct place.
cm...@google.com <cm...@google.com>
di...@google.com <di...@google.com>
di...@google.com <di...@google.com> #3
Hi, can you confirm what is the behavior you see in this case? Do you see any errors in the task? Or do you see the image being generated but without the expected dependency asset?
Description
Currently using com.android.compose.screenshot 0.0.1-alpha08 on a multi modular app where the following is the structure I am currently testing:
:feature:chat
Contains the entire chat feature, including the compose files, as well as the screenshot preview feature:core
Contains all the json mock data files used to simulate data for the purpose of previews, these files are stored undersrc\main\assets
of the respective moduleAll previews work correctly in the
:feature:chat
module, and all the generated screenshots are working properly, except for anything that tries to read the assets from the:core
module.Whenever it tries to read them when generating previews under the
src\screenshotTest\kotlin
of the:feature:chat
it's like none of the assets of:core
even exist.As far as I could interpret this, it seems to be that whatever context is being run in
src\screenshotTest\kotlin
is a context that does not have access to the same assets as the ones available in:core
.However, I have also been completely unable to find a way around this using other testing tools that provide different contexts (such as
ApplicationProvider
andInstrumentationRegistry
) but with no success.It appears that whatever context the ScreenShot Testing library uses is one that cannot reach assets by any means.
I tried checking the documentation, but it is absolutely scarce, and the release notes appear to have stopped completely on alpha 6, so I am at this point with no other way around this problem.
I cannot provide a sample app at this time, but I am hoping that the problem can be easily understood and a solution can be found.