How oktaliem/mobtestsamp works
Project Type and Purpose
• This is a Maven-based automated mobile testing sample project. It exercises a cross-platform Appium setup using two test frameworks (SerenityBDD and TestNG + Allure). Its sole purpose is to drive Android (APK) and iOS (IPA) apps through Appium, collect screenshots, videos, and produce HTML reports.
Main Architectural Components
a. Build & Dependency Manager
• Maven (pom.xml) – defines dependencies (Appium, Serenity, TestNG, Allure, etc.) and test goals.
b. Test Runner Layer
• SerenityBDD Runner (LoginTestWithSerenityRunner.java)
• TestNG Suites (under testsuite/TestNG/*.java)
c. Test Suite Definitions
• Packages under src/test/java/com/oktaliem/testsuite group tests per framework and per feature (Login, MakePayment, ExpenseReport, MortgageRequest, ScanCheck).
d. Page Object Model Layer
• src/test/java/com/oktaliem/pages/*.java – each class maps to one screen or flow in the mobile app (LoginPage, MenuPage, MakePaymentPage, etc.).
• BasePage.java – common Appium driver setup and helper methods.
• AdvanceActions.java – encapsulates custom Appium gestures.
e. Test Data & Utilities
• constants/TestData.java – holds static test inputs (user credentials, amounts, etc.).
• utils/GetDeviceInfo.java – dynamic detection of connected device capabilities (platformVersion, deviceName, UDID).
f. App Under Test
• src/test/resources/eribank.apk and EriBank.ipa – the actual mobile binaries used by Appium.
g. Appium Server & Mobile Devices
• External service (Appium server) – receives driver commands, relays them to real or virtual Android/iOS devices.
• Devices/Simulators – run the app and return UI element states.
h. Reporting
• Serenity reports or TestNG + Allure – aggregate test results, embed screenshots, attach video recordings of test sessions.
Relationships and Data Flows
• Maven invokes the Test Runner.
• The Runner reads device capabilities via GetDeviceInfo.
• Runner launches Appium driver (through BasePage) pointing at local/remote Appium server.
• Appium server drives the APK/IPA on the device.
• Page Objects issue commands (taps, swipes, fills) via the driver.
• Test methods orchestrate Page Object calls, validate UI state against TestData.
• During execution, listeners capture screenshots/video and forward them to the reporting engine.
• On completion, the reporter (Serenity or Allure) compiles an HTML dashboard with pass/fail, logs, media attachments.
Architectural Patterns & Design Principles
• Page Object Model (POM) – separates UI locators and actions from test logic.
• Layered Test Design – Test Runner → Test Suites → Page Objects → Utils/Constants.
• Cross-platform Abstraction – same Java code drives Android and iOS with minimal changes.
• Single Source of Truth for Test Data – avoids hard-coding in tests.
• Dependency Injection (Serenity) or Factory Methods (TestNG) for driver instantiation.
Detail Without Overthinking
• Every interaction: test → page object → driver → server → device → report.