from __future__ import annotations import httpx import pytest from sqlalchemy import text from sqlalchemy.engine import Engine @pytest.mark.integration def test_backend_health_endpoint(api_client: httpx.Client): """ Scenario: Backend service health and database connectivity. Validates that the FastAPI backend container is operational and connected to PostgreSQL. """ res = api_client.get("/health") assert res.status_code == 200 data = res.json() assert data["status"] == "healthy" assert data["database"] == "connected" assert data["version"] == "1.0.0" @pytest.mark.integration def test_frontend_root_liveness(frontend_client: httpx.Client): """ Scenario: Frontend Vite dev server availability. Validates that the React frontend container is running and serving the single-page application. """ res = frontend_client.get("/") assert res.status_code == 200 assert "text/html" in res.headers.get("content-type", "") assert "" in res.text.lower() or "