Browser journeys
Automate registration, login, account setup, transfers, bill payments, transaction searches, and loan requests.
Explore UI testsPYTHON · PLAYWRIGHT · PYTEST
A practical, end-to-end browser and API testing framework for ParaBank. Explore reusable page objects, pytest fixtures, data-driven tests, and cross-browser CI—all in one approachable project.
Practice project for a public demo application. Not a real bank.
# create an isolated environment
python -m venv .venv
# install project dependencies
python -m pip install -r requirements.txt
python -m playwright install
# run the suite
python -m pytest
A HANDS-ON LEARNING PROJECT
Start with a login check, then follow banking journeys through the UI and REST API.
Automate registration, login, account setup, transfers, bill payments, transaction searches, and loan requests.
Explore UI testsUse a shared requests client to check authentication, customer accounts, account details, and transaction responses.
Explore API testsKeep selectors and actions in focused page classes, separate from test intent and assertions.
Explore page objectsRun the suite across browser engines with GitHub Actions and keep HTML reports and failure artifacts.
Explore workflowsHOW IT FITS TOGETHER
Tests describe behavior; fixtures handle setup; page objects own browser interactions.
pages/Reusable UI objects
tests/UI and API scenarios
utils/Configuration and helpers
test_data/Data-driven inputs
LEARN THE EXECUTION FLOW
This structure separates test intent, reusable browser actions, and setup so each part is easier to learn and maintain.
It collects functions in tests/test_*.py. Markers such as ui and api, plus command-line filters, choose what runs.
Function parameters request reusable fixtures. For example, demo_login creates a read-only session; registered_customer attempts stateful registration.
A page class holds selectors and actions. The Playwright Page fills fields, clicks controls, and waits for application responses.
Tests use web-first expect checks and Python assertions. Pytest reports failures and retains browser evidence per pytest.ini.
Python ideas in this repo: functions and type hints, classes and inheritance, fixtures, JSON data, parameterization, HTTP sessions, locators, and Decimal for money calculations. A good reading path is tests/test_login.py → conftest.py → pages/login_page.py.
YOUR FIRST RUN
Install Python 3.10+, clone the repository, install the packages listed in requirements.txt, and download Playwright’s browsers.
git clone https://github.com/ajayya07/parabank.git
cd parabank
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements.txt
.\.venv\Scripts\python.exe -m playwright install chromium
Copy-Item .env.example .env
.\.venv\Scripts\python.exe -m pytest -m api
This uses the venv directly, so PowerShell execution-policy restrictions won't block setup. macOS/Linux: replace the Python path with .venv/bin/python. The full suite includes state-changing tests.
PICK A TEST RUN
python -m pytestpython -m pytest -m uipython -m pytest -m apipython -m pytest --headed --browser chromiumpython -m pytest -m "ui and not stateful" -k "not invalid_credentials"python -m pytest --collect-only -qShared demo, isolated writes. Read-only checks use ParaBank’s public demo login. Tests that change banking data register a unique customer. ParaBank is a shared public service, and registered test customers remain on its server.
WHAT THE SUITE COVERS
Read-only tests are safest against the shared demo. Stateful scenarios create customers and change data.
test_login.pyDemo login; invalid login (currently unreliable on the live demo); registration
test_accounts.pyAccount overview plus checking/savings creation
test_transfer.pyTransfer between a customer's accounts and verify balances
test_bill_payment.pySubmit a bill payment and check completion confirmation
test_transactions.pySearch account activity by amount
test_loan.pySubmit a loan request and read Approved/Denied outcome
test_api.pyREST login, accounts, account details, and transactions
test_ai_assistant.pyOffline tests of AI client contracts; no model/network needed
Known demo limitations. ParaBank has accepted invalid credentials and reported generated usernames as already taken. These are behaviors of the shared public service, not proof that a browser or Python install is broken.
OPTIONAL · LOCAL OR CLOUD
Use Ollama Cloud only for test-case generation. It requires an Ollama API key, an available cloud model, and internet access, but no Ollama install or local model download.
$secureKey = Read-Host "API key" -AsSecureString; $env:OLLAMA_API_KEY = [System.Net.NetworkCredential]::new("", $secureKey).Password$env:OLLAMA_CLOUD_MODEL = "gemma4:31b"python -m ai_assistant generate-tests --cloud --feature "Customer transfers funds"python -m ai_assistant generate-tests --cloud --feature "Customer transfers funds" --output ai-output/ideas.jsonpython -m ai_assistant explain --junit reports/ui-results.xmlpython -m ai_assistant suggest-locator --failure-file reports/error.txt --dom-file reports/dom.htmlYou can uninstall Ollama. Cloud test generation and regular tests still work without local Ollama. Only local failure/DOM analysis requires it. Cloud generation sends the feature prompt to Ollama; never include credentials or personal data. Usage may be subject to account limits or charges. AI suggestions need human review and are never executed automatically.
SHARE THE GUIDE
Enable GitHub Actions as the Pages source in your repository settings. The deployment workflow publishes this site whenever main changes.