This repository contains solution to the abn automation assessment problem. As part of this assessment, a package for an example android app is provided which is available at abn-automation-assessment
In this solution, I have created test automation framework for the given app based on Serenity framework using Selenium Java, Cucumber, Junit, Appium server, Appium inspector and Android Emulator. This solution considers running the test framework both locally and on Saucelabs.
A small update was made in the AndroidManifest.xml (to be able to launch the app on saucelabs) and a .apk file was generated by building the app in Android studio. This apk file is used in the test automation framework.
Test scenarios are available as two feature files. The features, step definitions and steps are named in such a way that tests are self-explanatory. As the app is a simple example app with just one landing page, scenarios are simple and not written in the most efficient way. My goal here is to showcase the technical automation framework based on Serenity and integration with Saucelabs.
- Java JDK 11
- Maven
- Android SDK
- Appium Server 1.22.0 (Do not forget to set ANDROID_HOME and JAVA_HOME)
- Android Emulator
-
Clone this GIT repository
-
Open the file serenity.properties and update the following
a. Uncomment the property fields listed under `local android configuration` b. Provide the name of your emulator/virtual device in appium.deviceName field C. Provide the full path to the apk file (app-debug.apk) in appium.app field
-
Save the updates to the properties file
-
Start running Appium server after editing the configurations
-
Start running the Android Virtual Device or Emulator
-
Run on terminal: mvn clean verify
-
Once the test run is completed, you will see a link to the test report.
[INFO] SERENITY REPORTS [INFO] - Full Report: file://<Full Path>/abn-assessment-solution/target/site/serenity/index.html
- Saucelabs Account (You can sign up here)
-
Clone this GIT repository
-
Open the file serenity.properties and update the following
a. Uncomment the property fields listed under `saucelabs android configuration` b. Provide your saucelabs authentication url in starter.sauce.url field
-
Save the updates to the properties file
-
Upload the app-debug.apk file to saucelabs application storage using the following curl command. Detailed instructions are available here
curl -u "$SAUCE_USERNAME:$SAUCE_ACCESS_KEY" --location \ --request POST 'https://api.eu-central-1.saucelabs.com/v1/storage/upload' \ --form 'payload=@"<path/to/your/file>"' \ --form 'name="<filename.ext>"'
-
Run on terminal: mvn clean verify
-
(Optional) You can also check that tests are running on your Saucelabs account under Automated Tests section.
-
Once the test run is completed, you will see a link to the test report.
[INFO] SERENITY REPORTS [INFO] - Full Report: file://<Full Path>/abn-assessment-solution/target/site/serenity/index.html