PYTHON · PLAYWRIGHT · PYTEST

Learn test automation
with a real banking flow.

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.

terminal
# 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
PythonReadable test code
3 browsersChromium · Firefox · WebKit
UI + APIOne integrated suite
GitHub ActionsAutomated CI workflow

A HANDS-ON LEARNING PROJECT

Explore the full testing workflow.

Start with a login check, then follow banking journeys through the UI and REST API.

Browser journeys

Automate registration, login, account setup, transfers, bill payments, transaction searches, and loan requests.

Explore UI tests

REST API checks

Use a shared requests client to check authentication, customer accounts, account details, and transaction responses.

Explore API tests

Reusable page objects

Keep selectors and actions in focused page classes, separate from test intent and assertions.

Explore page objects

Continuous integration

Run the suite across browser engines with GitHub Actions and keep HTML reports and failure artifacts.

Explore workflows

HOW IT FITS TOGETHER

Small pieces. Clear responsibilities.

Tests describe behavior; fixtures handle setup; page objects own browser interactions.

01pytest testsScenarios and assertions
02Fixtures & clientsSetup, config, HTTP
03Page objects / APIUI actions and REST calls
04ParaBankDemo application
pages/Reusable UI objects tests/UI and API scenarios utils/Configuration and helpers test_data/Data-driven inputs

LEARN THE EXECUTION FLOW

Follow one test from pytest to the app.

This structure separates test intent, reusable browser actions, and setup so each part is easier to learn and maintain.

01 · DISCOVER

Pytest finds tests

It collects functions in tests/test_*.py. Markers such as ui and api, plus command-line filters, choose what runs.

02 · PREPARE

Fixtures provide setup

Function parameters request reusable fixtures. For example, demo_login creates a read-only session; registered_customer attempts stateful registration.

03 · INTERACT

Page Objects use Playwright

A page class holds selectors and actions. The Playwright Page fills fields, clicks controls, and waits for application responses.

04 · VERIFY

Assertions check behavior

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

Get started on your machine.

Install Python 3.10+, clone the repository, install the packages listed in requirements.txt, and download Playwright’s browsers.

See all Python dependencies
Windows PowerShellmacOS / Linux
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

Explore at your own pace.

Complete suitepython -m pytest
Browser testspython -m pytest -m ui
REST API testspython -m pytest -m api
Watch Chromiumpython -m pytest --headed --browser chromium
Read-only UI checkspython -m pytest -m "ui and not stateful" -k "not invalid_credentials"
List tests without running thempython -m pytest --collect-only -q

Shared 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

From login to money movement.

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

AI help without using local model resources.

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.

Enter API key securely for this terminal$secureKey = Read-Host "API key" -AsSecureString; $env:OLLAMA_API_KEY = [System.Net.NetworkCredential]::new("", $secureKey).Password
Choose an account-enabled cloud model$env:OLLAMA_CLOUD_MODEL = "gemma4:31b"
Draft cases through Ollama Cloudpython -m ai_assistant generate-tests --cloud --feature "Customer transfers funds"
Save a draft locallypython -m ai_assistant generate-tests --cloud --feature "Customer transfers funds" --output ai-output/ideas.json
Failure explanations (local Ollama only)python -m ai_assistant explain --junit reports/ui-results.xml
Locator suggestions (local Ollama only)python -m ai_assistant suggest-locator --failure-file reports/error.txt --dom-file reports/dom.html

You 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

Host this project guide on GitHub Pages.

Enable GitHub Actions as the Pages source in your repository settings. The deployment workflow publishes this site whenever main changes.

Hosting instructions