3.8 KiB
3.8 KiB
MC Cars — Local Testing Protocol
This document records the exact steps taken to verify the MC Cars stack is operational. Run these steps after every stack spin-up to confirm baseline functionality.
Prerequisites
- Docker Engine with Compose v2
- Clean data directory:
rm -rf data/db data/storage data/n8n && mkdir -p data/{db,storage,n8n}
1. Spin Up the Stack
docker compose -f docker-compose.yml -f docker-compose.local.yml up -d --build
Wait ~30 seconds for migrations to complete, then verify:
docker compose -f docker-compose.yml -f docker-compose.local.yml ps
Expected: all 14 services running (db healthy, kong healthy).
2. Verify API Responds
curl -s http://localhost:55580/index.html | head -5
Expected: HTML response with <!DOCTYPE html>
curl -s -H "apikey: $ANON_KEY" "http://localhost:55521/rest/v1/vehicles?select=brand,model"
Expected: [{"brand":"Ferrari","model":"296 GTB"}]
3. Playwright End-to-End Tests
3.1 Public Website — Verify Access & Ferrari
- Navigate to
http://localhost:55580/index.html - Verify page loads with title "MC Cars · Sportwagenvermietung Steiermark"
- Verify hero section is visible
- Verify "1" car count in stats section
- Verify Ferrari 296 GTB card is visible with:
- Image: "Ferrari 296 GTB"
- Specs: 830 PS, 330 km/h, 2.9s
- Price: € 850 / pro Tag
- Buttons: "Details" and "Buchen"
3.2 Playwright — Make a Reservation
- Scroll to/click "Buchen" section
- Select "Ferrari 296 GTB" from vehicle dropdown
- Click "Individuell" (custom dates) button
- Set Start date:
2026-06-20 - Set End date:
2026-06-22 - Click "Weiter" (Weiter button, ref=e146)
- Verify step 2 ("Kontaktdaten") is shown
- Verify pricing sidebar shows:
- "Ferrari 296 GTB · 2 Tage"
- "Wochenendtage (2 × € 1100)" → "€ 2.200"
- "MwSt. (20%)" → "€ 440"
- "Gesamtbetrag" → "€ 2.640"
- "Kaution" → "€ 5.000"
- Fill Name:
Jose Lago - Fill Email:
jose@lago.dev - Fill Phone:
+43 660 1234567 - Click "Weiter" to go to step 3
- Click "Anfrage absenden" (submit button)
- Verify toast notification: "Danke! Wir melden uns in Kürze per E-Mail."
- Verify form reset (vehicle dropdown back to "Fahrzeug wählen")
3.3 Admin Portal — Verify Lead Appears
- Navigate to
http://localhost:55581/admin.html - Verify login page loads with title "Admin · MC Cars"
- Fill email:
admin@mccars.local - Fill password:
mc-cars-admin - Click "Anmelden"
- Verify password rotation screen ("Passwort setzen") appears
- Set new password:
NewMcCars2026!(twice) - Click "Speichern"
- Verify admin dashboard loads with hash
#leads - Verify tabs: "Leads 1", "Kunden 0", "Bestellungen 0", "Fahrzeuge", "Einstellungen"
- Verify the lead appears in "Aktive Leads" table with:
- Eingang: 17.05.26, 13:34 (current date/time)
- Name/E-Mail: Jose Lago · jose@lago.dev
- Fahrzeug: Ferrari 296 GTB
- Zeitraum: 2026-06-20 → 2026-06-22
- Gesamtbetrag: € 2.640
- Status: new
- Actions: Details, Qualifizieren, Ablehnen
4. Spin Down & Cleanup
docker compose -f docker-compose.yml -f docker-compose.local.yml down
Clean data directory for next test run:
rm -rf data/db/* 2>/dev/null
# Note: data/db/ directory may need sudo to fully remove (owned by Docker bind mount UID)
Expected Results Summary
| Check | Expected |
|---|---|
| All services running | Yes (14 services) |
| Public website loads | Yes, 200 OK |
| API returns vehicles | Yes, Ferrari 296 GTB |
| Booking form works | Yes, 3-step wizard |
| Server-side pricing | Yes, € 2.640 for weekend |
| Booking submission | Yes, success toast shown |
| Admin login | Yes, password rotation enforced |
| Lead visible in admin | Yes, all fields correct |