Standardization Pipeline
### [Flow Name] User type: Pet Owner / Vet / Admin Entry point: Page/button/link Goal: One sentence Steps: 1. First action 2. Second action 3. ... Expected result: - What should happen Common problems: - Problem 1 Edge cases: - Special case 1
Feature: Turnero - Book appointment Scenario: Book vaccination for cat Given I am on the turnero page When I enter address "Av Santa Fe 1234" And I click "Next" Then a guest user should be created When I add pet "Koshka" type "Cat" And I select "Vaccination" Then "Clinical consult" is auto-added Scenario: Services filtered by pet type Given I added a cat Then I see cat vaccines And I dont see dog vaccines
features/ ├── pet-owner/ │ ├── registro.feature # 6-8 scenarios │ ├── reservar-turno.feature # 10-15 scenarios │ ├── gestion-mascotas.feature │ └── pago.feature ├── veterinarian/ │ └── ... └── backoffice/ └── ...
# DON'T do this features/pet-owner/registro/ ├── registro-exitoso.feature ├── registro-email-invalido.feature ├── registro-password-corto.feature └── ... (dozens of tiny files)
# Scenarios per file: 5-20 Normal, keep as is 20-40 Consider splitting 40+ Definitely split
tests/contracts/ ├── base.py # mode switcher ├── endpoints.py # API paths (single source) ├── helpers.py # test data │ ├── mascotas/ # app tests │ ├── test_pet_owners.py │ ├── test_pets.py │ └── test_coverage.py ├── productos/ │ ├── test_services.py │ └── test_cart.py ├── solicitudes/ │ └── test_service_requests.py │ └── workflows/ # compositions └── test_turnero_general.py
# Fast (Django test client) pytest tests/contracts/ # Live (real HTTP) CONTRACT_TEST_MODE=live pytest
# Calls endpoints in sequence:
1. Check coverage
2. Create pet owner
3. Create pet
4. Get services
5. Create request
tests/e2e/ ├── pages/ # Page Objects │ ├── BasePage.ts │ ├── LoginPage.ts │ └── index.ts │ └── login.spec.ts # E2E test
export class LoginPage extends BasePage { get emailInput() { return this.page.getByLabel('Email'); } async login(email, password) { await this.emailInput.fill(email); await this.passwordInput.fill(password); await this.submitButton.click(); } }
# All tests npx playwright test # With UI npx playwright test --ui # Specific file npx playwright test login.spec.ts
Full example: def/work_plan/10-flow-turnero.md
Backend README: amar_django_back/tests/contracts/README.md
Frontend README: amar_frontend/tests/README.md