Crossbones+ - Reputation: 2838
Posted 21 June 2012 - 07:46 AM
I've given monkey runner a try and its useful for injecting random events into the application. And I believe it can be used to script up selenium style regression tests but I haven't tried that.
The android instrumentation classes seem like they offer a lot and and are powerful, but sadly like all aspects of android I've found the documentation lacking and missing crucial details. For instance it took a few minute to realize that test methods only got picked up if the method name starts with the word test.
I've been trying to build my unit tests using the android test cases pattern they show on dev site but I've been finding it very slow going. And I've spent a couple of hours struggling hopelessly to find out how to get any kind of activity state information which I need to build my behaviour tests. For instance I have one test that I want to check that pressing the save button has successfully persisted data to a db and finished the activity. And another that checks that a dialog window has opened and populated correctly when the user touches a certain text box. But there doesn't seem to be any obvious way of getting that information, calling an applications different lifecylce methods is easy but how you find out what state it currently is in or what the orientation currently is I have no idea.
What about other developers have you managed to crack building quality tests around your android apps?
Writing Blog: The Aspiring Writer
Legacy - Black Prince Saga Book One - By Alexander Ballard (Free this week)