Mobile app testing automation using Jenkins, Espresso, Spoon, Github

Shivaraj Patil
3 min readJul 6, 2017

--

Android Automation Testing: Part 1

Android continuous integration (CI/CD) automation testing using Jenkins, Espresso, Robotium & Spoon.

Android Home Test Lab. Image source google

Story behind why we started Home Test Lab?

Now we all know how important it is to test your app but honestly 2 years back no one was talking about app testing specially in India, it was very much ignored maybe because every one was busy in writing 100’s of apps.

During mid 2014 we at skyro voice recorder app realized the importance of app testing and we decided to test our app as much as possible but being a very early stage startup and small team of 2 developers it was difficult for us to test the app heavily, because varieties of devices with different screen sizes (like 4", 5",5.5" phones & 7", 8", 10" tablets etc).

Most of skyro tests are long running tests[1–10 hours] so it took us lot of time & effort to test all scenarios, very soon we both fed up with excel sheets and test case generators, then the only way we could achieve this was by automating the whole testing process, literally no human interaction.

Initially we started R&D on which all tools & technology to use? then we started brain storming on different scenarios, test cases etc & finally we ended up using Jenkins, Robotium, Espresso & Spoon.

What is Jenkins?

Jenkins is a Continuous Integration server.

Jenkins Image source google

What is Robotium?

Robotium is a test framework created to make it easy to write powerful and robust automatic UI test cases for Android applications.

Robotium Image source google

What is Espresso?

The Espresso test framework. Espresso is a testing framework for Android to make it easy to write reliable user interface tests.

Espresso Image source google

What is Spoon?

Distributing instrumentation tests to all your Androids.

Now we know about the tools, slowly we started writing simple Robotium tests & after multiple iterations we had something to run. Then we configured jenkins to run the robotium tests automatically every day for us and used spoon to run all these tests simultaneously on all the devices.

Next we bought a dedicated computer just to run all these tests all the time but it took us lot of time to configure the setup on this new computer, later we also figured out a decent reporting system, it was like once all tests are done we will get the reports directly to your email with all test results on each device. Isn’t that cool? We have around 8 physical devices, multiple Genymotion emulators and tablets to run all these tests.

Boom, It’s 2015 & Google introduced Espresso, which takes care of few drawbacks of robotium like random waits solo.wait(xxx millis) and tests run much more faster than robotium, Google was very serious about testing & we knew that it is gonna release more & more features in upcoming days so we spent time to migrating from robotium to espresso, it was worth doing it.

That’s it in part 1.

Before you start Part 2: You should have your app in github with at least one Expresso test or for this blog you can clone this project.

Part -2: Setting up Jenkins server, Espresso & Spoon.

--

--

Shivaraj Patil

Entrepreneur, Android enthusiast, passionate Android Developer worked @Triveous skyroapp.com