Skip to content

nagyzsolt1989/MobileAutomationFramework

Repository files navigation

Logo width="200" height="400"

Java Mobile Automation Framework

Badge   Badge   Badge   Badge   Badge  

OverviewFramework StackDocumentationDemo

📑 Menu

📜 Overview

A java mobile test framework for Android and iOS utilizing Appium, Selenium, TestNG, Gradle and the latest tech available in January 2023.

🏭 Framework Stack

Logo

📚 Features

  • Utilizing Page Object Model and Page Factory design patterns
  • Integrated Allure reporting
  • Attach screenshots to Allure before every click or input field change
  • Attach a screenshot to Allure on test failure
  • Capability to post the test results to Slack
  • Capability to post the test results to TestRail
  • Capability to retry failed cases up to 3 times
  • Customizable console logger

📘 Documentation

❗ Prerequisites

🎑 Design Patterns

Page Object Model: A structure where every page of the application is represented with a class that contains the elements for that page with the methods for interacting with these elements. When the UI of the app changes the tests themselves don’t need to change, only the page object class should be updated. The advantages of POM:

  • Easier code maintenance
  • Code reusability
  • Improved readability and reliability

Page Factory: Provides @FindBy annotation to locate and declare elements using different locator strategies. It uses a lazy load initElements() static method to initialize the elements only when they are used in an operation or activity.

👂 Listeners

  • EventListener: A WebDriverListener for Appium related events
  • TestListener: An ITestListener listener for TestNG related events
  • AnnotationTransformer: For retrying failed test cases up to 3 times
  • ExecutionListener: Listener for test execution related events

💾 Dependencies and libs

📂 Directory Tree

MobileAutomationFramework
├── images
│   ├── framework_stack.png
│   ├── IDE.png
│   └── logo.png
├── src
│   ├── main
│   │   ├── java
│   │   │   ├── framework
│   │   │   │   ├── core
│   │   │   │   │   ├── BasePage.java
│   │   │   │   │   └── BaseTest.java
│   │   │   │   └── platform
│   │   │   │       ├── AndroidBaseTest.java
│   │   │   │       └── IOSBaseTest.java
│   │   │   └── utils
│   │   │       ├── listeners
│   │   │       │   ├── AnnotationTransformer.java
│   │   │       │   ├── EventListener.java
│   │   │       │   ├── ExecutionListener.java
│   │   │       │   └── TestListener.java
│   │   │       ├── slack
│   │   │       │   └── SlackUtil.java
│   │   │       ├── testrail
│   │   │       │   ├── TestRailID.java
│   │   │       │   └── TestRailUtil.java
│   │   │       ├── PropertyReader.java
│   │   │       └── RetryAnalyzer.java
│   │   └── resources
│   │       ├── android.properties
│   │       ├── ios.properties
│   │       ├── log4j2.properties
│   │       ├── slack.properties
│   │       └── testrail.properties
│   └── test
│       ├── java
│       │   ├── pages
│       │   │   ├── HomePage.java
│       │   │   ├── SignInPage.java
│       │   │   └── ValidationPage.java
│       │   ├── suites
│       │   │   ├── android.xml
│       │   │   └── ios.xml
│       │   └── tests
│       │       ├── android
│       │       │   ├── HomeTests.java
│       │       │   ├── SignInTests.java
│       │       │   └── ValidationTests.java
│       │       └── ios
│       │           ├── HomeTests.java
│       │           ├── SignInTests.java
│       │           └── ValidationTests.java
│       └── resources
│           └── apps
│               ├── demoApp.apk
│               └── demoApp.zip
├── .gitignore
├── build.gradle
├── gradlew
├── gradlew.bat
├── readme.md
└── settings.gradle

📀 Demo

  • After the configuration is adjusted in the properties files, a test run can be initiated by running one of the TestNG xml suites.

IDE

  • Allure report

IDE IDE

  • Slack notification

IDE