11# QA Learning Project - Python / pytest / Playwright
22
3- Projekt edukacyjny dla testera średniozaawansowanego, który chce nauczyć się używać ** Claude Code** do codziennej pracy QA.
3+ An educational project for intermediate-level QA engineers who want to learn how to use ** Claude Code** in their daily QA work .
44
5- ## Cele edukacyjne
5+ ## Learning Objectives
66
771 . ** pytest fixtures** - conftest.py, scope, parametrize
8- 2 . ** API testing** - asercje na status code, body, headers
9- 3 . ** Page Object Model** - separacja logiki UI od testów
10- 4 . ** Playwright** - selektory, akcje, asercje
11- 5 . ** Jak używać Claude Code** - generowanie test cases, debugowanie, refaktoryzacja
8+ 2 . ** API testing** - assertions on status code, body, headers
9+ 3 . ** Page Object Model** - separation of UI logic from tests
10+ 4 . ** Playwright** - selectors, actions, assertions
11+ 5 . ** How to use Claude Code** - generating test cases, debugging, refactoring
1212
1313---
1414
15- ## Struktura projektu
15+ ## Project Structure
1616
1717```
18- ├── requirements.txt # Zależności Python
19- ├── pytest.ini # Konfiguracja pytest (markery, opcje )
20- ├── conftest.py # Globalne fixtures (base URLs)
18+ ├── requirements.txt # Python dependencies
19+ ├── pytest.ini # pytest configuration (markers, options )
20+ ├── conftest.py # Global fixtures (base URLs)
2121│
2222├── tests/
2323│ ├── api/
@@ -29,18 +29,18 @@ Projekt edukacyjny dla testera średniozaawansowanego, który chce nauczyć się
2929│ └── ui/
3030│ ├── conftest.py # todo_page fixture
3131│ ├── pages/
32- │ │ ├── base_page.py # Page Object Model - klasa bazowa
33- │ │ └── todo_page.py # Page Object dla TodoMVC
34- │ └── test_todo.py # Testy UI - TodoMVC
32+ │ │ ├── base_page.py # Page Object Model - base class
33+ │ │ └── todo_page.py # Page Object for TodoMVC
34+ │ └── test_todo.py # UI tests - TodoMVC
3535│
3636└── test_cases/
37- ├── api_test_cases.md # Manualne przypadki testowe dla API
38- └── ui_test_cases.md # Manualne przypadki testowe dla UI
37+ ├── api_test_cases.md # Manual test cases for API
38+ └── ui_test_cases.md # Manual test cases for UI
3939```
4040
4141---
4242
43- ## Instalacja
43+ ## Installation
4444
4545``` bash
4646uv pip install -r requirements.txt
@@ -49,98 +49,98 @@ playwright install chromium
4949
5050---
5151
52- ## Uruchamianie testów
52+ ## Running Tests
5353
5454``` bash
55- # Wszystkie testy
55+ # All tests
5656pytest
5757
58- # Tylko testy API
58+ # API tests only
5959pytest tests/api/ -m api -v
6060
61- # Tylko testy UI (headless)
61+ # UI tests only (headless)
6262pytest tests/ui/ -m ui -v
6363
64- # Testy UI z widoczną przeglądarką
64+ # UI tests with visible browser
6565pytest tests/ui/ -m ui --headed -v
6666
67- # Testy smoke
67+ # Smoke tests
6868pytest -m smoke -v
6969
70- # Testy regression
70+ # Regression tests
7171pytest -m regression -v
7272
73- # Konkretny plik
73+ # Specific file
7474pytest tests/api/test_posts.py -v
7575
76- # Z raportem HTML (domyślnie włączony w pytest.ini)
76+ # With HTML report (enabled by default in pytest.ini)
7777pytest tests/api/ -v
78- # Raport : report.html
78+ # Report : report.html
7979```
8080
8181---
8282
83- ## Markery pytest
83+ ## pytest Markers
8484
85- | Marker | Opis |
86- | --------------| -----------------------------------|
87- | ` api ` | Testy API (requests) |
88- | ` ui ` | Testy UI (Playwright) |
89- | ` smoke ` | Testy smoke - kluczowe funkcje |
90- | ` regression ` | Testy regresyjne - pełne pokrycie |
85+ | Marker | Description |
86+ | --------------| -------------------------------------- |
87+ | ` api ` | API tests (requests) |
88+ | ` ui ` | UI tests (Playwright) |
89+ | ` smoke ` | Smoke tests - critical functionality |
90+ | ` regression ` | Regression tests - full coverage |
9191
9292---
9393
94- ## Serwisy testowe
94+ ## Test Services
9595
96- | Serwis | URL | Opis |
96+ | Service | URL | Description |
9797| --------| -----| ------|
98- | JSONPlaceholder | https://jsonplaceholder.typicode.com | Fake REST API (posty ) |
99- | DummyJSON | https://dummyjson.com | REST API z auth (użytkownicy , JWT) |
100- | TodoMVC | https://demo.playwright.dev/todomvc | Aplikacja UI do testów |
98+ | JSONPlaceholder | https://jsonplaceholder.typicode.com | Fake REST API (posts ) |
99+ | DummyJSON | https://dummyjson.com | REST API with auth (users , JWT) |
100+ | TodoMVC | https://demo.playwright.dev/todomvc | UI application for testing |
101101
102102---
103103
104- ## Jak używać Claude Code w pracy QA
104+ ## Using Claude Code for QA Work
105105
106- ### Generowanie test cases
106+ ### Generating Test Cases
107107
108108```
109- Napisz test pytest dla endpointu GET /api/users/{id} na reqres.in.
110- Test powinien sprawdzać status 200 i strukturę odpowiedzi .
109+ Write a pytest test for the GET /api/users/{id} endpoint on reqres.in.
110+ The test should verify status 200 and the response structure .
111111```
112112
113- ### Debugowanie testów
113+ ### Debugging Tests
114114
115115```
116- Ten test failuje z błędem AssertionError: assert 404 == 200.
117- Endpoint: GET /posts/0 na jsonplaceholder.typicode.com.
118- Jak naprawić ?
116+ This test fails with AssertionError: assert 404 == 200.
117+ Endpoint: GET /posts/0 on jsonplaceholder.typicode.com.
118+ How do I fix it ?
119119```
120120
121- ### Refaktoryzacja
121+ ### Refactoring
122122
123123```
124- Mam 5 testów, które wszystkie tworzą sesję HTTP osobno .
125- Jak wyciągnąć to do fixtures w conftest.py?
124+ I have 5 tests that each create an HTTP session separately .
125+ How do I extract that into fixtures in conftest.py?
126126```
127127
128- ### Analiza pokrycia
128+ ### Coverage Analysis
129129
130130```
131- Przejrzyj tests/api/test_posts.py i powiedz jakich przypadków testowych brakuje .
131+ Review tests/api/test_posts.py and tell me which test cases are missing .
132132```
133133
134- ### Tworzenie Page Objects
134+ ### Creating Page Objects
135135
136136```
137- Napisz Page Object dla formularza logowania na stronie example.com/login.
138- Powinien mieć metody : fill_credentials(email, password), submit(), get_error_message().
137+ Write a Page Object for the login form at example.com/login.
138+ It should have methods : fill_credentials(email, password), submit(), get_error_message().
139139```
140140
141141---
142142
143- ## Struktura fixtures (conftest.py)
143+ ## Fixture Structure (conftest.py)
144144
145145```
146146conftest.py (root)
@@ -150,8 +150,8 @@ conftest.py (root)
150150
151151tests/api/conftest.py
152152├── http_client → requests.Session (scope=session)
153- └── auth_token → JWT accessToken z dummyjson.com /auth/login
153+ └── auth_token → JWT accessToken from dummyjson.com /auth/login
154154
155155tests/ui/conftest.py
156- └── todo_page → TodoPage(page) z nawigacją do ui_base_url
156+ └── todo_page → TodoPage(page) with navigation to ui_base_url
157157```
0 commit comments