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):
- Standard user logs in — product list visible
- Performance glitch user logs in — succeeds (may be slow)
- Locked out user — error message shown
- Wrong password — error message shown
- Empty credentials — validation error shown
test_products.py (marked regression):
- Product list shows at least 6 items after login
- Sort by Name A-Z — "Sauce Labs Backpack" appears first
- Sort by Price low-to-high — cheapest item first
- Tap a product — detail page shows matching title and price
- Add to cart from detail page — cart badge shows 1
test_checkout.py (marked regression, no_retry):
- Add item, go to cart, verify count and subtotal
- Complete checkout with valid info — confirmation page shown
- Attempt checkout with empty fields — validation error
- Remove item from cart — cart is empty
Acceptance criteria
Your capstone passes when:
-
pytest -m smokeruns in under 2 minutes with 0 failures -
pytest -m regressionruns 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_retryapplied to checkout tests - All locators use
AppiumBy.ACCESSIBILITY_IDor UIAutomator/predicate — no XPath - No
time.sleep()in any file — only explicit waits -
conftest.pyhas thepytest_runtest_makereporthook
Getting started
- Create a new directory and activate a virtual environment
- Install dependencies:
pip install Appium-Python-Client pytest allure-pytest pytest-rerunfailures - Download the Sauce Labs APK/APP and place in
apps/ - Copy the
base_page.pyfrom Chapter 3 as your starting point - Write
conftest.pywith the driver fixture and makereport hook from Chapter 5 - 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.