- July 11, 2018
- Posted by: AFourTech
- Category: Blogs
Wearable technology is on the rise in both personal and business use. In the consumer space, sales of smart wristbands and watches are on an exponential growth path. With the rise in wearable devices, there’s a rush to make existing apps usable for smart watches and bands. There’s a need to have more robust development and testing practices for such apps.
This was the motivation in going for a POC for Android Wear 2.0, one of the most popular platforms for wearables in the smartwatch category. The intention was to see how existing tools can be leveraged for automation of wearable only apps and apps which are available on both Mobile and Android Wear platform. The following write-up gives an overview of the POC conducted.
Application Under Test (AUT)
The POC deals with automation of Android Wear 2.0 apps –
- A standalone ‘Calculator’ app
- A Mobile + Smart watch app ‘Google Keep’.
Calculator app on Android Wear
This is a simple calculator app that can be used to perform basic math operations on the Android watch. Here’s the link to the app.
The POC involves launching the app and performing some basic operations like addition, subtraction, etc. and verifying the results.
Google Keep App on Mobile & Android Wear
This POC takes into consideration an end to end flow in using the Google Keep app. The steps performed are as follows
- Create a checklist on the mobile ‘Keep app.’
- Verify the whether the checklist syncs on the android wear device or not.
- Mark all items as checked on the wearable device.
- Verify all items as checked on the wearable device.
- Refresh keep list on a mobile device
- Verify if all items are checked on a mobile device in the ‘keep app.’
- Delete the keep checklist to clean-up the data.
App Screenshots on Android Wear Emulator and Mobile device
Automation Tools Used
Library – Appium
Appium is the most popular automation library when it comes to automation of mobile devices. A few of the benefits of using this library are:
- The app source or apk is not required for automation.
- The app does not require any instrumentation i.e. the production apk can be used as it is, giving more confidence in the tests.
- A familiar Selenium based API is used for automation reducing the learning curve.
In the POC the Java client of the Appium library was used for automation of both the ‘Android Mobile Google Keep App’ and the ‘Android Wear Google Keep App.’
Framework – TestNg
TestNg is a widely used automation framework for the Java language. It’s based on Junit and provides a powerful feature for test configuration, execution, and reporting which makes it robust and easy to use.
Environment – AVD (Android Virtual Device) + Physical device
The environment consists of actual devices (physical, virtual, emulators) used for automation. Some of the options considered for automation were:
- Android Virtual Devices (AVD) for both Mobile and Android Wear.
- Real device for Mobile & AVD for Wear.
- Real devices for Mobile and Android Wear.
The second option was chosen considering the easy availability of an Android Mobile device and the unavailability of a real android wear device.
The crucial part here is to set up the environment such that the physical android device and Android wear device sync up to have the same Google accounts. This can be done by forwarding ports using the following command –
adb -s <android device id>forward tcp:5601 tcp:5601