Modul 11 · Python for SDETs

Capstone: tam
API + UI dəsti

0–10-cu modullardan hər şey, müsahibəçiyə göstərəcəyin layihəyə yığılıb

fixtures API + UI data-driven hesabat + CI
AI with Rufat
Bir ağıllı test yox, qatlar boyunca əhatə

API uğurlu yol

Məhsullar siyahı/oxu + düzgün total-lı bir sifariş (M3, M5)

🚫

API neqativ

səhv girişdə 400 / 401 / 404 / 409 (M4)

🖱️

UI axını

page object ilə brauzerdən daxil ol (M6, M7)

🗃️

Data-driven

JSON faylından login matrisi (M8)

🧱

Struktur & təcrid

Fixture-lər, reset_db, sahə başına qovluqlar (M2, M5, M9)

🤖

Hesabat & CI

HTML hesabat, hər push-da yaşıl (M9, M10)

AI with Rufat
Düzülüş elə dizayndır

Reviewer ağacı oxuyub nə etdiyini bilə bilər

python-sdet/
├── .github/workflows/tests.yml # CI (M10)
├── pages/login_page.py # POM (M7)
├── tests/
│ ├── conftest.py # base_url / api / reset_db
│ ├── data/login_cases.json # data-driven (M8)
│ ├── api/ test_products · test_orders · test_negative · test_login_matrix
│ └── ui/ test_login # Playwright + POM (M6, M7)
├── pytest.ini # markers + pythonpath
└── requirements.txt # pinned deps
🗂️Hər qovluğun bir işi var — ona görə yeni testin aydın evi var və işə qoşulma bir wiki yox, bir ağac oxumaqdır.
AI with Rufat
Hər iki istiqamət, hər iki qat
API — uğurlu yol + neqativ
@pytest.mark.api
def test_order_total(reset_db, base_url, api):
r = api.post(f"{base_url}/api/orders", …)
assert r.status_code == 201
assert r.json()["total"] == pytest.approx(29.99*2)
# bad password -> 401
UI — page object vasitəsilə bir ssenari
@pytest.mark.ui
def test_login_flow(page, base_url):
(LoginPage(page, base_url)
.goto()
.login("customer@test.io", …))
expect(page.get_by_test_id("nav-logout")).to_be_visible()
AI with Rufat
Marker ilə hissə, tam dəst bir hesabatla
bash
pytest -m api # just the API layer
pytest -m ui # just the browser
pytest -ra --html=report.html \
--self-contained-html
İnkişaf edərkən lokalda marker-lə sürətli əks-əlaqə; push-dan əvvəl bütün dəst hesabatla.
🚀Modul 10 workflow-u ilə push et və CI hər PR-da hamısını işlədir — hesabat da daxil. Komandaya və ya işə götürən menecerə təhvil verə biləcəyin bir dəst.
AI with Rufat
🎉

Python for SDETs-i
bitirdin

pip install pytest-dən CI ilə qorunan API + UI dəstinə qədər — əsl SDET rollarının hər gün işlətdiyi alət dəsti

🧰
İndi bacarırsan
pytest, requests, Playwright, fixtures, POM, data-driven, reporting, CI
🧩
Onu genişləndir
Bir CRUD həyat dövrü + neqativ UI testi əlavə et, sonra öz tətbiqinə yönəlt
💼
Portfolion
Bu capstone işə götürən menecerə göstəriləcək layihədir
AI with Rufat
← / → · space