Adding instrumentation tests to Idea Growr

0 Flares Filament.io Made with Flare More Info'> 0 Flares ×

SpoonEditSet01

At work, I’m learning more about how to use instrumentation tests with Android development. I’m now applying this to my Idea Growr app.

Tools used

These type of tests will ‘fake’ a user pressing buttons, and it’s quite fun to watch. I’m using Espresso to make the test scenarios, and Spoon for making a nice rapport on each test.

In the beginning I had the problem of not being able to take screenshots of pop-up windows with Spoon. So I’m using the Falcon library to make this happen.

Than I ran into the problem that Idea Growr supports android version with SDK 9 (really old), and the Falcon library has a minimum of SDK 10. So I needed to add a line in my manifest file to work around that:

At first that didn’t work, but then I found out that I should put it in a separate AndroidManifest file.

I’ve complained about this before, but I keep being surprised how things that seem like ‘core’ parts of Android require you to do some quite obscure Googling. But on the positive side, it’s quite easy to make test scenarios with Espresso.

Up next

One of the main goals is to make it easier to develop new features without accidentally breaking existing functionality. Also, I can much easier see how the app works on different devices (emulators).

I’m not there yet. Todo:

  • Add more tests
    I’ve made a couple of basic tests, like creating an idea with a note, but there is more to be done.
  • Figure out how to best test for mutiple languages
    There doesn’t seem to be something in Espresso for doing the same test for multiple languages. But it should be do-able
  • Figure out screen orientation changes
  • Add even more tests

 

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Pin It Share 0 Filament.io Made with Flare More Info'> 0 Flares ×

Leave a Reply

Your email address will not be published. Required fields are marked *