How shivakumarhn/masterappiumframework works
Main project type and purpose
• This project is a mobile automation testing framework built using Appium. It implements a full-featured test automation architecture including parallel execution, reporting via ExtentReports, email notification via Java Mail API, programmatically managing the Appium server, and integration with Jenkins.
• Key functionalities include running tests on multiple devices/emulators (Android and iOS), capturing and archiving videos of tests, logging activities, reporting test execution results, and sending email notifications with attachments.
File structure to pinpoint architectural components
• Directories such as “src/main/java/com/appium” contain core framework classes (base pages, test classes, utilities, page objects, annotations, enums, manager classes, and report-related classes).
• The “src/test/java/com/appium/tests” directory holds the actual test cases written for specific app functionalities (LoginTests, ProductTests, etc.). This clearly indicates a page object model pattern.
• Configuration and resource files are in “src/main/resources” and “src/test/resources” (e.g., config.properties, log4j2.properties, app binaries, test data JSON, and XML files for expected data).
• Supporting directories like “ExtentReports”, “Videos”, and “ServerLogs” indicate storage for generated test execution output such as reports, screen recordings, and log files.
• The presence of “testng.xml” and variant XML files for specific devices (e.g. testng_pixel_3.xml, testng_pixel_4.xml) reflects the use of TestNG for test orchestration and parallel execution.
a. Test Execution Layer:
• TestNG Runner: Illustrated by the testng.xml configurations that trigger parallel testing.
• Test Classes: Specifically those in the “src/test” package.
• Page Object Model: Components such as LoginPage, ProductsPage, ProductDetailsPage, SettingsPage handling the UI interactions.
b. Framework Core:
• Base Classes: BaseTest and BasePage for common test functionalities.
• Manager Classes: DriverManager, DeviceNameManager, PlatformManager, DateTimeManager, and StringsManager manage underlying configurations, device specifics, and utility functions.
• Utility Classes: A collection including ScreenshotUtils, VideoRecordUtils, AppiumServerUtils (for programmatically starting/stopping Appium Server), and others which handle reporting, email sending (EmailSendUtils, java_Mail_API modules), and configuration management.
• Custom Annotations and Enums: For filtering and categorizing tests, such as custom annotations in the “annotations” package and enums (CategoryType, AuthorType, WaitStrategy).
c. Reporting and Logging:
• Reporting Infrastructure: Classes like ExtentReport, ExtentManager, and ExtentLogger in the “reports” package.
• Logs and Server Logs: Managed repositories such as “ServerLogs” and “logs” directories, and logging configurations in resources (log4j2.properties).
• Video Capture: Directory “Videos” stores media for failed test case recordings.
d. Integration & Deployment:
• Email Notification Service: Using Java Mail API (EmailConfig, EmailAttachmentsSender) to automatically send emails with attachments (ExtentReports zip).
• Jenkins Integration: The README details a Jenkins job setup for running the tests and sending email reports.
• External Dependencies: Integration with the Saucelabs sample app (provided in “src/test/resources/app”) and use of external libraries such as ExtentReports v5.0.9.
• Main components: Test Runner, Appium Server Manager, Base Test/Page Objects, Manager & Utility modules, and Reporting/Email integration.
• External dependency on the Saucelabs sample app and Jenkins integration for continuous integration and email dispatch workflow.