|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +## Project Overview |
| 4 | + |
| 5 | +Educational QA project using Python, pytest, and Playwright. GitHub: `adamcegielka/claude-code-testing`. |
| 6 | + |
| 7 | +## Commands |
| 8 | + |
| 9 | +```bash |
| 10 | +# Install dependencies |
| 11 | +uv pip install -r requirements.txt |
| 12 | +playwright install chromium |
| 13 | + |
| 14 | +# Run all tests |
| 15 | +pytest |
| 16 | + |
| 17 | +# API tests |
| 18 | +pytest tests/api/ -m api -v |
| 19 | + |
| 20 | +# UI tests (headless) |
| 21 | +pytest tests/ui/ -m ui -v |
| 22 | + |
| 23 | +# UI tests (headed) |
| 24 | +pytest tests/ui/ -m ui --headed -v |
| 25 | + |
| 26 | +# Smoke / regression |
| 27 | +pytest -m smoke -v |
| 28 | +pytest -m regression -v |
| 29 | +``` |
| 30 | + |
| 31 | +HTML report is auto-generated as `report.html` (configured in `pytest.ini`). |
| 32 | + |
| 33 | +## Project Structure |
| 34 | + |
| 35 | +``` |
| 36 | +conftest.py # Root fixtures: api_base_url, dummyjson_base_url, ui_base_url |
| 37 | +pytest.ini # Markers + --html=report.html |
| 38 | +requirements.txt # pytest, pytest-html, pytest-playwright, requests |
| 39 | +
|
| 40 | +tests/ |
| 41 | + api/ |
| 42 | + conftest.py # http_client (requests.Session), auth_token (JWT) |
| 43 | + test_posts.py # JSONPlaceholder CRUD |
| 44 | + test_users.py # DummyJSON users |
| 45 | + test_auth.py # DummyJSON login/register |
| 46 | + ui/ |
| 47 | + conftest.py # todo_page fixture |
| 48 | + pages/ |
| 49 | + base_page.py # BasePage (Playwright) |
| 50 | + todo_page.py # TodoPage : BasePage |
| 51 | + test_todo.py # TodoMVC UI tests |
| 52 | +
|
| 53 | +test_cases/ |
| 54 | + api_test_cases.md |
| 55 | + ui_test_cases.md |
| 56 | +``` |
| 57 | + |
| 58 | +## Test Services |
| 59 | + |
| 60 | +| Service | URL | |
| 61 | +|---------|-----| |
| 62 | +| JSONPlaceholder | https://jsonplaceholder.typicode.com | |
| 63 | +| DummyJSON | https://dummyjson.com | |
| 64 | +| TodoMVC | https://demo.playwright.dev/todomvc | |
| 65 | + |
| 66 | +## pytest Markers |
| 67 | + |
| 68 | +| Marker | Scope | |
| 69 | +|--------|-------| |
| 70 | +| `api` | All API tests | |
| 71 | +| `ui` | All UI tests | |
| 72 | +| `smoke` | Critical path | |
| 73 | +| `regression` | Full coverage | |
| 74 | + |
| 75 | +## Conventions |
| 76 | + |
| 77 | +- Fixtures live in `conftest.py` at the appropriate scope level (root or per-suite). |
| 78 | +- UI tests use Page Object Model — page logic goes in `tests/ui/pages/`, not in test files. |
| 79 | +- All test functions are marked with at least one pytest marker (`api`/`ui`) and one severity marker (`smoke`/`regression`). |
| 80 | +- Keep API and UI tests strictly separated under `tests/api/` and `tests/ui/`. |
0 commit comments