crazy
crazy

Reputation: 57

android manual / semi-automated testing

I am in the process of gradually switching from manual to automatic testing using junit in android.

The problem is that for some of my tests full automatic validation seems to be not possible or too sophisticated. I need to validate, for example, if an image after some transformation is looking "good enough" or not.

On the other hand, I do not want to run the whole application for this but have something like a unit test which tests only the method that does the transformation. And which mocks up some sample data and a simple ui to show the image.

Main question: How do you usually perform tests like these for your android applications?

Side question: A basic approach I came up with would be to write a junit test class and build in some kind of stop after each test so that one can see the result image on the phone and decide if it looks good or not. Ideally, a dialog would show up on the phone or on the developers computer and as soon as I press ok the next test will be performed. But it is not so easy to implement this as there is no blocking UI model in android (c.f. https://stackoverflow.com/a/4381387/3991799). Any ideas?

Upvotes: 1

Views: 579

Answers (1)

michaelcarrano
michaelcarrano

Reputation: 1316

I have not yet used this framework yet but you can look into using Spoon by Square.

Spoon has screenshot functionality which will allow you to automate your tests and then manually review the screenshots after the tests finish.

https://github.com/square/spoon

There is also screenshot test by Facebook

https://github.com/facebook/screenshot-tests-for-android

Upvotes: 1

Related Questions