A complete end-to-end software testing framework that combines UI automation π₯οΈ and REST API testing β‘ into a single, maintainable Java project. Built around the public demo site AutomationExercise.com, it mirrors that site's own published test-case catalogue (TC01βTC36) with real Selenium/TestNG and REST Assured coverage, complete Allure traceability, and Jira/Zephyr-style test-case linking β making it a solid reference for QA engineers building production-grade automation suites.
- 35+ UI Test Cases Mapped to Real Scenarios π§ͺ β Every test method (
TC01β¦TC36) corresponds 1:1 to a published test case on AutomationExercise.com's own test-case page, annotated with@Link/@TmsLinkback to the source scenario. - 14 REST Assured API Test Cases π‘ β Covers
productsList,brandsList,searchProduct,verifyLogin,createAccount,updateAccount,deleteAccount, andgetUserDetailByEmail, including disallowed-method checks (405), missing-parameter checks (400), and a full create β fetch β update β delete account lifecycle. - Page Object Model (POM) ποΈ β Nine page classes (
HomePage,LoginPage,SignupPage,ProductsPage,SingleProductPage,CartPage,CheckoutPage,PaymentPage,ConatctusPage) share a commonFrameworkbase with 30+ reusable Selenium wrappers (waits, dropdowns, alerts, drag-and-drop, window switching, screenshots). - Data-Driven Testing π β User credentials, page URLs, checkout/payment details, and contact-form data are all externalized as JSON (
SignupData.JSON,CreateAccount.JSON,PagesUrl.JSON,Payment.JSON,Contactus.JSON,ReviewData.JSON) and parsed with Gson into POJOs. - Configurable Test Environments βοΈ β A single
config.properties, read throughConfigReader, controls the browser, base URL, wait timings, and headless mode without touching test code. - Multi-Browser Support π β
WebDriverHandlesupports Chrome, Edge, and Brave (with a bundled ad-blocker.crxextension and anti-detection Chrome flags baked in). - Optimized WebDriver Lifecycle (55% Faster Execution) β‘ β Tests share one WebDriver instance per test class (initialized in
BaseTest's@BeforeClass) instead of spinning up a new browser per test method. In a real full-suite run this cut total execution time from 7 min 29 sec β 4 min 6 sec for the same 36 tests. - Allure Reporting with Full Traceability π β
@Epic/@Feature/@Story/@Severity/@Ownerannotations on every test, automatic failure screenshots via a customAllureListener, and REST Assured request/response logging attached to API test reports. - Built-in Flaky Test Handling π β A custom
RetryAnalyzerautomatically retries a failing test up to 2 times, logging each retry attempt separately from the final verified result, before marking it failed for real. - Test Case Management Alignment π― β
@TmsLink/@Linkannotations map automated tests back to Jira/Zephyr Scale test case IDs for traceability between manual and automated coverage.
| Category | Technology |
|---|---|
| Language | Java 25 β |
| Build Tool | Apache Maven π¦ |
| UI Automation | Selenium WebDriver 4.41.0 π |
| Test Runner | TestNG 7.11.0 π§ͺ |
| API Testing | REST Assured 6.0.0 β‘ |
| Reporting | Allure (allure-testng, allure-java-commons, allure-rest-assured 2.31.0) π |
| JSON Handling | Gson 2.13.2, Jackson Databind 2.17.0 π |
| Boilerplate Reduction | Lombok 1.18.42 π οΈ |
| Assertions/Unit | JUnit Jupiter β |
| Test Execution | Maven Surefire Plugin 3.1.2 π |
- JDK 25 (or lower the
maven.compiler.source/targetvalues inpom.xmlto match your installed JDK) - Apache Maven 3.8+
- Chrome, Edge, or Brave installed locally β
browserinconfig.propertiescontrols which oneWebDriverHandlelaunches (Brave is hardcoded to the default Windows install path; adjustWebDriverHandle.javaif you're on macOS/Linux or a different install location) - An IDE such as IntelliJ IDEA (the repo ships with an
.ideafolder) or Eclipse/VS Code
- Clone the repository
git clone https://github.com/SeifZiad/Automation-API-Testing-Project.git
cd Automation-API-Testing-Project
- Install dependencies
mvn clean install -DskipTests
- Configure your test environment
Edit
src/main/resources/config.properties:
browser=chrome
baseUrl=https://automationexercise.com/
implicitWait=10
explicitWait=15
headless=true
mvn clean test
Tests.xml wires up four test classes in this order: HomePageTests β AuthenticationTests β ProductsCartTests β UserStories. A clean full-suite run completes all 36 tests in around 4 minutes:
mvn test -Dtest=AuthenticationTests
ApiTests isn't currently wired into Tests.xml, so run it directly:
mvn test -Dtest=ApiTests
allure serve target/allure-results
or generate a static report:
allure generate target/allure-results --clean -o target/allure-report
allure open target/allure-report
Response res = given()
.baseUri("https://automationexercise.com")
.when()
.get("/api/productsList")
.then()
.extract().response();
ProductsResponse body = new Gson().fromJson(res.asString(), ProductsResponse.class);
Assert.assertEquals(res.statusCode(), 200);
Assert.assertNotNull(body.getProducts());@Test(dataProvider = "singleUserData")
@TmsLink("TC-02")
public void TC02_PositiveLoginTest(User user) {
homePage = new LoginPage(driver);
((LoginPage) homePage).perfromLogin(user.email, user.password);
String actual = ((LoginPage) homePage).ReadvalidloginMessage();
Assert.assertEquals(actual, user.firstName + " " + user.lastName);
}The framework was deliberately refactored to control WebDriver scope, since that's the single biggest lever on suite runtime for a Selenium project of this size.
| Approach | WebDriver Lifecycle | Total Time (36 tests) |
|---|---|---|
Legacy (Alltests.java, @BeforeMethod) |
New browser launched for every test method | 7 min 29 sec |
Current (BaseTest.java, @BeforeClass) |
One browser shared across all tests in a class | 4 min 6 sec |
That's a ~55% reduction in execution time for identical coverage, simply by moving driver initialization from @BeforeMethod to @BeforeClass and reusing the session across a test class's methods.
Every run produces a full Allure dashboard: pass/fail rate, execution duration, and tests grouped by @Feature/@Story (e.g., Navigation, Shopping Cart, Checkout Workflows), so a non-technical stakeholder can see coverage at a glance without reading code.
RetryAnalyzer (wired in via @Test(retryAnalyzer = RetryAnalyzer.class)) automatically retries a test up to 2 times before it's reported as a genuine failure. The console output β and the Allure report β clearly separate intermediate retry attempts from the final verified result, so a transient failure (e.g., a slow page load) never gets confused with a real regression:
Automation-API-Testing-Project/
βββ .idea/ # IDE project settings
βββ src/
β βββ main/
β β βββ java/
β β β βββ Pages/ # Page Object Model classes
β β β β βββ HomePage.java # Navigation, subscribe, category checks
β β β β βββ LoginPage.java # extends HomePage β login/signup entry points
β β β β βββ SignupPage.java # Full registration form flow
β β β β βββ ProductsPage.java # Product listing, search
β β β β βββ SingleProductPage.java # Product detail, add-to-cart, reviews
β β β β βββ CartPage.java # Cart contents, quantity, removal
β β β β βββ CheckoutPage.java # Checkout / order review
β β β β βββ PaymentPage.java # Payment form submission
β β β β βββ ConatctusPage.java # Contact Us form
β β β βββ Utils/
β β β βββ ApiResponsePOJOs/ # Gson/Jackson response models (Product, Brand, ApiResponse, ...)
β β β βββ POJOClasses/User.java # UI test-data POJO
β β β βββ ConfigReader.java # Reads config.properties
β β β βββ Framework.java # Reusable Selenium action wrappers (30+ methods)
β β β βββ WebDriverHandle.java # Chrome/Edge/Brave driver lifecycle (singleton)
β β βββ resources/
β β βββ config.properties # Environment configuration
β βββ test/
β βββ java/
β β βββ AllTests/
β β β βββ BaseTest.java # Shared setup/teardown (@BeforeClass driver init) + TestNG data providers
β β β βββ HomePageTests.java # TC10, TC25, TC26, TC29βTC36: navigation & home page tests
β β β βββ AuthenticationTests.java# TC01βTC06, TC27βTC28: signup/login/logout/delete
β β β βββ ProductsCartTests.java # TC08, TC09, TC11βTC13, TC16βTC19, TC21: products, cart, brands, categories, reviews
β β β βββ UserStories.java # TC14βTC16, TC20, TC23βTC24: end-to-end checkout/order journeys
β β β βββ ApiTests.java # 14 REST Assured API test cases
β β β βββ Alltests.java # Legacy monolithic suite (superseded by the classes above)
β β βββ Listeners/
β β β βββ AllureListener.java # Auto-attaches screenshots to Allure on failure
β β βββ Utils/
β β βββ RetryAnalyzer.java # Retries failed tests up to 2x, logging each attempt
β βββ resources/
β βββ TestingData/ # JSON test data
β β βββ SignupData.JSON
β β βββ CreateAccount.JSON
β β βββ PagesUrl.JSON
β β βββ Payment.JSON
β β βββ Contactus.JSON
β β βββ ReviewData.JSON
β βββ extensions/
β βββ adblocker.crx # Bundled ad-blocker extension for stable UI runs
βββ Tests.xml # TestNG suite (HomePageTests, AuthenticationTests, ProductsCartTests, UserStories)
βββ pom.xml # Maven build & dependency configuration
βββ .gitignore
βββ README.md
Note:
Alltests.javapredates the split intoHomePageTests/AuthenticationTests/ProductsCartTests/UserStoriesand duplicates much of their coverage in one 800+ line class, using a@BeforeMethoddriver β the slower, pre-optimization approach described above. It isn't referenced byTests.xmland is kept in the repo as an earlier iteration rather than the maintained entry point.
The framework is configured through src/main/resources/config.properties, loaded at runtime by ConfigReader:
| Key | Description | Example |
|---|---|---|
browser |
Browser used for Selenium execution β chrome, edge, or brave |
brave |
baseUrl |
Base URL of the application under test | [https://automationexercise.com/](https://automationexercise.com/) |
implicitWait |
Implicit wait timeout in seconds | 10 |
explicitWait |
Explicit/WebDriverWait timeout in seconds |
15 |
headless |
Run the browser headless (--headless=new) |
true |
If you set
browser=brave,WebDriverHandle.javacurrently points to a hardcoded Windows path (C:\Program Files\BraveSoftware\Brave-Browser\Application\brave.exe). Update this path directly in the source if you're on macOS/Linux or have Brave installed elsewhere.
Contributions, suggestions, and bug reports are welcome:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/your-feature-name. - Commit your changes with clear messages.
- Push the branch and open a Pull Request describing the change and its motivation.
- For bugs or ideas, feel free to open an Issue first to discuss the approach.
Please keep new UI tests aligned with the existing Page Object Model (extend Framework/HomePage as appropriate), initialize the WebDriver at the class level (not per-method) to preserve the current execution-time gains, add corresponding JSON test data under TestingData/, and wire new test classes into Tests.xml.
This project is intended for educational and portfolio purposes. No formal license file is currently published in the repository β if you plan to reuse or redistribute this code, please reach out to the repository owner (SeifZiad) for clarification.