Challenge Overview
In this challenge, we’ll provide (on the challenge forum available on registration) a Java class that you have to update based on the requirements explained below.
The primary objective is adding “Pass Login Screen” functionality.
This class will be used from our automatic coverage testing framework (TCUML + Application Design Specification attached on the challenge forum).
Detailed Requirements
Overall refactoring
The provided class requires overall refactoring and polishing.
-
The hardcoded values like emails and passwords should be configurable.
-
All methods should be documented.
-
Any duplicate code should be moved to reusable methods.
You can also modify, extend or write the existing code from scratch following a different approach/technique in order to improve the final results.
Create Database
-
The class needs to connect to a Database (MySQL or PostgreSQL) and save/read the login credentials from there. The ID for each entry (app) should be the SHA256 of the APK file.
-
Provide scripts to initialize the table(s) in the DB.
Get Past Login Screen
The overall issue with the custom app login is that it requires registration. In order to register, the
new method should perform traversal of the UI elements as it is currently done. The registration
button should be clicked and controls should be populated in a similar way as it is currently done
in enterFbLoginDetails().
The important aspects of the implementation are:
-
Best effort to identify and get past the login screen.
-
For the given APK, the app needs to check the DB and find if there’s already a registered account. If there’s a registered account, the credentials from the DB should be used to login. Otherwise, the tool should try to register for an account and save the new account credentials to the DB.
-
The needed values for the registration like email, password, and additional properties like name, country, etc. should be configurable.
-
The method should try to fill the standard registration properties like email, password, first name, last name, etc with the passed values, and then fill the rest of the UI widgets with random values.
-
The method should check whether there’s an agreement/consent within the activity and try to select the related checkbox.
-
The implementation should assume that registration can be split between activities/screens.
In addition, the class will be responsible for scheduled registration confirmation emails processing.
Technology overview
-
Android 8
-
UIAutomator 2.0 API
Final Submission Guidelines
Submit a zip file containing:
-
Updated java class
-
Deployment document with details on how to setup the database and use the class.
-
A document explaining your approach