Skip to content

Latest commit

 

History

History
80 lines (52 loc) · 3.9 KB

README.md

File metadata and controls

80 lines (52 loc) · 3.9 KB

Introduction

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:

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.

Instructions to run the tests

Run the tests locally:

Pre-requisites:

  1. Java JDK 11
  2. Maven
  3. Android SDK
  4. Appium Server 1.22.0 (Do not forget to set ANDROID_HOME and JAVA_HOME)
  5. Android Emulator

Steps:

  1. Clone this GIT repository

  2. 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
    
  3. Save the updates to the properties file

  4. Start running Appium server after editing the configurations

  5. Start running the Android Virtual Device or Emulator

  6. Run on terminal: mvn clean verify

  7. 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
    

Run the tests on Saucelabs:

Pre-requisites:

  1. Saucelabs Account (You can sign up here)

Steps:

  1. Clone this GIT repository

  2. 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
    
  3. Save the updates to the properties file

  4. 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>"'
    
  5. Run on terminal: mvn clean verify

  6. (Optional) You can also check that tests are running on your Saucelabs account under Automated Tests section.

  7. 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
    

Example Test Report

Screenshot 2021-11-09 at 23 16 20

Screenshot 2021-11-09 at 23 20 37