What is screenshot testing - devrath/ComposeAlchemy GitHub Wiki
Screenshot Testing
is a new compose tool that allows us to test the composable UI automatically, without writing the test cases.
- This tool is released by Google.
How the UI tests are traditionally written
- We launch a screen.
- We make some actions on the views on the screen.
- We then do some assertions to check if the expectation matches the outcome.
How is this done
- We need to write a
test case
that sets up the UI
first
- It will take a
screen-shot
of the screen first.
- We perform some action and take a new
screen-shot
.
- Now we compare the two screenshots. The framework is able to tell the differences between 2 screen-shots.
- When there is a difference, we know there is some issue.