Project Brief — E-Commerce App Test Suite in Java

5 min read

The capstone project brings together everything from the course: project structure, driver management, page objects, gestures, data-driven testing, reporting, and CI. You'll build a complete test suite for a real mobile app — not a toy example.

The target app

You'll test the Sauce Labs Demo App — a purpose-built test app available on both Android and iOS. Download it from the Sauce Labs sample apps repository.

  • Android: Android.SauceLabs.Mobile.Sample.app.x.x.x.apk
  • iOS (Simulator): iOS.Simulator.SauceLabs.Mobile.Sample.app.x.x.x.zip (unzip to get the .app bundle)

The app has a login screen, product catalog, cart, and checkout — a realistic e-commerce flow with enough screens to exercise your full test framework.

What you'll build

A Maven project with the following components:

Project structure

saucelabs-appium-java/
├── pom.xml
├── testng-smoke.xml
├── testng-regression.xml
└── src/test/
    ├── java/com/saucelabs/tests/
    │   ├── base/
    │   │   ├── BaseTest.java          (TestNG lifecycle, AppiumServiceBuilder)
    │   │   └── DriverManager.java    (ThreadLocal driver)
    │   ├── pages/
    │   │   ├── LoginPage.java
    │   │   ├── ProductListPage.java
    │   │   ├── ProductDetailPage.java
    │   │   ├── CartPage.java
    │   │   └── CheckoutPage.java
    │   ├── tests/
    │   │   ├── LoginTest.java
    │   │   ├── ProductTest.java
    │   │   └── CheckoutTest.java
    │   ├── utils/
    │   │   ├── GestureUtils.java
    │   │   └── WaitUtils.java
    │   └── listeners/
    │       ├── ScreenshotListener.java
    │       └── RetryTransformer.java
    └── resources/
        ├── apps/
        │   ├── saucelabs.apk
        │   └── saucelabs.app
        └── testdata/
            └── users.json

Test scenarios

LoginTest (annotated smoke + regression):

  1. Valid login with standard user
  2. Valid login with performance glitch user (should succeed, but may be slow)
  3. Invalid login — locked out user (expect error message)
  4. Invalid login — wrong password (expect error message)
  5. Login with empty credentials (expect validation error)

ProductTest (annotated regression):

  1. Product list displays at least 6 items
  2. Sorting by name A-Z shows "Backpack" first
  3. Sorting by price low-to-high shows cheapest item first
  4. Tapping a product opens its detail page with matching title
  5. Scroll to the last product and add it to cart

CheckoutTest (annotated regression):

  1. Add item to cart, verify cart badge count
  2. Complete checkout with valid shipping info, verify order confirmation
  3. Attempt checkout with empty shipping fields, verify validation
  4. Remove item from cart, verify cart is empty

Acceptance criteria

Your submission passes these checks:

  • mvn test -DsuiteFile=testng-smoke.xml runs in under 3 minutes with 0 failures
  • mvn test -DsuiteFile=testng-regression.xml runs both Android and iOS in parallel
  • Screenshots are saved to target/screenshots/ for any failing test
  • Allure report generates with Epic → Feature → Story hierarchy visible
  • RetryTransformer is registered; @NoRetry exempts the checkout test
  • DriverManager uses ThreadLocal — no static driver fields
  • All locators use accessibilityId or UIAutomator/predicate strings — no XPath

Getting started

  1. Create a new Maven project or start from the course skeleton (replace with your own repository)
  2. Add the dependencies from Chapter 1: io.appium:java-client:9.3.0, org.testng:testng:7.9.0, io.qameta.allure:allure-testng:2.25.0
  3. Download the Sauce Labs app APK and .app bundle, place in src/test/resources/apps/
  4. Copy DriverManager.java and BaseTest.java from Chapter 1's project structure
  5. Run the smoke suite against a local emulator to confirm session creation works before writing any page objects

The walkthrough lesson covers one complete test method from scratch. After that, the remaining scenarios follow the same pattern.

// tip to track lessons you complete and pick up where you left off across devices.