Testing In-App Purchase (IAP) flow is especially difficult — completing the flow produces side effects that are hard to reverse, e.g. upgrading a user or making a purchase, so it makes sense to mock these calls even in a UI test. In this article we will create Espresso UI Instrumented tests for Android that will proceed through the IAP, mocking the responses from Google Billing and our own user database.

The stack

The process

Create directory your/folder/location/src/androidTest. It should be on the same level as src/main.

Within this directory, mirror…


One of the most frustrating and rewarding features I worked on during my co-op was reworking a settings page for users that featured drag-and-drop and optimistic updates. The problems that arose showed me the subtle complexities of such a feature. They also cautioned me to write simpler, readable (and ergo debuggable) code so design flaws are less often confused with technical bugs.

General use case: Manage groups of ordered items, where individual items can be moved between groups

User Story As an Android Hootsuite user, I want to be able to control the content that is displayed to me. To that end, I should be able to group related social networks/streams together into tabs and rearrange

Augustine Kwong

Coop Developer. UBC Combined Major CPSC & STAT. http://github.com/augudyne.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store