sergio-sastre / AndroidUiTestingUtils

A set of TestRules, ActivityScenarios and utils to facilitate UI and screenshot testing under given configurations: FontSizes, Locales...
MIT License
285 stars 14 forks source link

Generate screenshot tests from Compose preview annotations, that can run with ANY screenshot library #85

Open sergio-sastre opened 8 months ago

sergio-sastre commented 8 months ago

The idea is that one can generate screenshot tests automatically from the previews, and run them with the Screenshot test library of his choice!

For that, one can use a solution similar to the one described in the blog post automate-screenshot-testing-for-compose-previews-via-reflection together with the capability of AndroidUiTestingUtils of writing Cross-Library screenshot tests

Moreover, it'd be good to wait till Google releases its own solution to see how this solution would complement it, e.g.

On the other hand, it might also have some limitations, e.g. not all libraries might support everything the previews can.