sergio-sastre / AndroidUiTestingUtils

A set of TestRules, ActivityScenarios and utils to facilitate UI and screenshot testing under given configurations: FontSizes, Locales...

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

sergio-sastre opened this issue · comments

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.

  • run auto-generated tests from previews together with other existing screenshot tests
  • this would also allow you to run screenshot tests on devices
  • use library specific features, like "screenshot tests for accessibility"

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