This repository contains a production-ready, scalable QA automation framework built using Java, Selenium, Rest Assured, TestNG, Maven, and GitHub Actions.
Designed to follow enterprise automation standards, this framework is suitable for:
- Real-world production testing π
- CI/CD pipelines π€
- Technical interviews and portfolio demonstrations π―
- π Web UI automation (Selenium WebDriver)
- π API automation (Rest Assured)
- β‘ Parallel execution & thread-safe driver management
- π Cross-browser testing (Chrome, Firefox, Edge)
- π§ͺ Smoke, sanity, and regression testing classification
- π Retry logic for flaky tests (RetryAnalyzer)
- π Rich Extent Reports (web steps, API logs)
- π€ CI/CD execution via GitHub Actions with matrix runs
| Layer | Technology |
|---|---|
| Language | Java 17 |
| UI Automation | Selenium WebDriver |
| API Automation | Rest Assured |
| Test Framework | TestNG |
| Build Tool | Maven |
| Driver Management | WebDriverManager |
| Reporting | Extent Reports |
| Logging | Log4j |
| CI/CD | GitHub Actions |
java-adapter
β
βββ src
β βββ main
β β βββ java
β β βββ framework
β β βββ config
β β β βββ ConfigManager.java
β β β βββ ApiConfig.java
β β β
β β βββ driver
β β β βββ DriverFactory.java
β β β βββ DriverManager.java
β β β βββ BrowserType.java
β β β
β β βββ listeners
β β β βββ ExtentTestListener.java
β β β
β β βββ retry
β β β βββ RetryAnalyzer.java
β β β βββ RetryAnnotationTransformer.java
β β β
β β βββ utils
β β βββ ExtentManager.java
β β βββ CommonUtils.java
β β
β βββ test
β β βββ java
β β βββ tests
β β βββ base
β οΏ½οΏ½ β βββ BaseTest.java
β β β βββ BaseWebTest.java
β β β βββ BaseApiTest.java
β β β
β β βββ web
β β β βββ (Web test classes)
β β β
β β βββ api
β β βββ (API test classes)
β β
β βββ resources
β βββ config
β βββ env.properties
β
βββ testng.xml
βββ pom.xml
βββ .github/workflows/ci.yml
All environment-specific and runtime configuration is centralized in src/test/resources/config/env.properties, with override priority as follows:
- Maven system properties (e.g.
-Dbrowser=chrome,-Denv=qa) - TestNG parameters (when used)
env.propertiesdefaults
Example env.properties keys:
browser=chrome
baseUrl=https://example.com
apiBaseUrl=https://api.example.com
timeout.ms=5000
retry.count=2- Thread-safe WebDriver management using
ThreadLocalensures fully isolated execution for parallel runs. - Browser lifecycle:
- Initialized in
@BeforeMethod - Quit and cleaned in
@AfterMethod
- Initialized in
- Supported browsers: Chrome, Firefox, Edge (via WebDriverManager)
- Built using Rest Assured for API interactions.
- API tests do NOT open browsers.
- Base URI initialized once per test class; requests & responses logged and attached to Extent reports.
Use TestNG groups to categorize tests:
smokeβ Critical flow validation π¨sanityβ Basic stability checks βregressionβ Full test coverage π§apiβ API-only execution πwebβ Web-only execution π
Sample:
@Test(groups = {"smoke", "regression"})
public void criticalFlowTest() { ... }- Implemented using
RetryAnalyzerand integrated via a TestNG annotation transformer. - Automatically retries failed tests to mitigate flaky failures. Configure retry count in
env.propertiesor via system property.
- Extent Reports are generated after every execution and include:
- Web test steps and screenshots (if enabled)
- API request and response logs
- Test status and failure details
Output directory:
test-output/
Run all tests:
mvn clean testRun tests by groups:
# Smoke
mvn clean test -Dgroups=smoke
# Regression
mvn clean test -Dgroups=regressionRun API-only or Web-only via Maven profiles and browser override:
# API tests only
mvn clean test -Papi
# Web tests only (explicit browser)
mvn clean test -Pweb -Dbrowser=chromeParallel execution is controlled by testng.xml and TestNG parameters (method-level or test-level parallelism). Thread-safe driver management prevents conflicts during parallel runs.
CI features:
- Matrix execution (browsers: Chrome, Firefox; environments: dev, qa)
- Automatic browser setup using WebDriverManager or containerized drivers
- Test report artifacts uploaded after execution
- Triggers:
- push to main
- pull request against main
A sample workflow file: .github/workflows/ci.yml (ensure it matches your desired matrix and artifact upload steps).
- β Web + API automation
- β Cross-browser testing
- β Parallel execution
- β Environment-specific execution
- β Retry mechanism for flaky tests
- β Extent reporting with API logs
- β CI/CD ready (GitHub Actions)
- β Interview-ready architecture & examples
- Headless execution toggle for faster CI runs
- Screenshot capture on failure (per-test)
- API schema validation (JSON Schema / OpenAPI checks)
- Dockerized execution for reproducible CI environments
- Add Allure reporting and centralized test data management
Add example folders to accelerate onboarding:
examples/basicβ simple web + api usage examplesexamples/asyncβ async flows and advanced scenariosexamples/spring-bootβ Spring Boot test integration (if relevant)
We welcome contributions! Suggested flow:
- Fork the repo π΄
- Create a branch:
git checkout -b feat/my-featureπ± - Add tests and documentation β
- Run all tests locally and ensure code style is followed π
- Open a pull request with a clear description and link to any related issue π
Please include unit tests for new logic and update README/examples when APIs change.
This project is licensed under the MIT License β see the LICENSE file for details. π
This framework is designed with scalability, maintainability, and real-world usage in mind. It reflects industry best practices for modern QA automation and is suitable for CI pipelines and interview/portfolio demos.
Maintainer: @Mcube333
Issues & feature requests: please open GitHub issues