A java mobile test framework for Android and iOS utilizing Appium, Selenium, TestNG, Gradle and the latest tech available in January 2023.
- 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
- Java 16 SDK or lower (because of this issue)
- Appium
- Selenium
- Allure
- Android Emulator
- iOS Simulator
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.
- 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
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
- After the configuration is adjusted in the properties files, a test run can be initiated by running one of the TestNG xml suites.
- Allure report
- Slack notification