Project Brief — Travel App Test Suite in Python

5 min read

The capstone project tests the Sauce Labs Demo App end-to-end using everything from this course: fixtures, page objects, gestures, parametrize, markers, reporting, and CI.

The target app

Download the Sauce Labs Demo App 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 .app)

The app includes login, a product catalog with sorting, a shopping cart, and a checkout flow — enough screens to exercise the full framework.

Project structure

saucelabs-appium-python/
├── requirements.txt
├── pytest.ini
├── .env                          # PLATFORM, APPIUM_SERVER, device names (gitignored)
├── conftest.py                   # driver fixture, hooks, Appium server start
├── pages/
│   ├── __init__.py
│   ├── base_page.py
│   ├── login_page.py
│   ├── home_page.py
│   ├── product_detail_page.py
│   ├── cart_page.py
│   ├── checkout_step_one.py
│   ├── checkout_step_two.py
│   └── order_confirmation_page.py
├── tests/
│   ├── __init__.py
│   ├── test_login.py
│   ├── test_products.py
│   └── test_checkout.py
├── utils/
│   ├── __init__.py
│   ├── gesture_utils.py
│   └── wait_utils.py
└── apps/
    ├── saucelabs.apk
    └── saucelabs.app

Test scenarios

test_login.py (marked smoke + regression):

  1. Standard user logs in — product list visible
  2. Performance glitch user logs in — succeeds (may be slow)
  3. Locked out user — error message shown
  4. Wrong password — error message shown
  5. Empty credentials — validation error shown

test_products.py (marked regression):

  1. Product list shows at least 6 items after login
  2. Sort by Name A-Z — "Sauce Labs Backpack" appears first
  3. Sort by Price low-to-high — cheapest item first
  4. Tap a product — detail page shows matching title and price
  5. Add to cart from detail page — cart badge shows 1

test_checkout.py (marked regression, no_retry):

  1. Add item, go to cart, verify count and subtotal
  2. Complete checkout with valid info — confirmation page shown
  3. Attempt checkout with empty fields — validation error
  4. Remove item from cart — cart is empty

Acceptance criteria

Your capstone passes when:

  • pytest -m smoke runs in under 2 minutes with 0 failures
  • pytest -m regression runs with Android and iOS parallel (if running -n 2)
  • Screenshots saved to screenshots/ for any failing test
  • Allure report generates with Epic/Feature/Story structure visible
  • @pytest.mark.no_retry applied to checkout tests
  • All locators use AppiumBy.ACCESSIBILITY_ID or UIAutomator/predicate — no XPath
  • No time.sleep() in any file — only explicit waits
  • conftest.py has the pytest_runtest_makereport hook

Getting started

  1. Create a new directory and activate a virtual environment
  2. Install dependencies: pip install Appium-Python-Client pytest allure-pytest pytest-rerunfailures
  3. Download the Sauce Labs APK/APP and place in apps/
  4. Copy the base_page.py from Chapter 3 as your starting point
  5. Write conftest.py with the driver fixture and makereport hook from Chapter 5
  6. Start with login_page.py — verify a single test passes before building the rest

The walkthrough lesson shows the full login test built step by step.

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