Tuesday, July 01, 2014

Mobile Test Automation Framework

Hi Test Devs,
For some time I was wondering how could I implement a starting point project for mobile test automation. A project that could allow me to focus on the real system under test and just extend the required object in order to extend the DSL used to write the test scripts.
This is a prove of concept of this starting point design of an internal DSL Mobile Test Automation Framework. Also provides the abstract level objects that can be extended for specific functionalities of any Device, Application, Application Page or User.
This project only needs the implementation of a third party mobile driver in order to control any device. The Driver class is just a wrapper of any third party driver that actually communicates with the real device or emulator. All the core Interfaces like Device, Application, User and Driver could be easily extended to cover all the possible functionality of the system under test.
This is a simple example of the internal DSL which creates a device, an application and a user, then launches the application and perform the login of the user and finally does a click to given element id of the page.
Example DSL:
on(device(DEVICE_NEXUS4))
   .installApp(APP_SAMPLE_1)
   .then()
   .launch()
   .login(user(SAMPLE_TEST_USER_1))
   .click("elementIdMenu");
Where DEVICE_NEXUS4, APP_SAMPLE_1, SAMPLE_TEST_USER_1 are constant strings to a properties file name with all the configuration details of the device, application and the user in test.
See TestScript package for more examples.

Posted by Marc Andreu.

No comments: