def test_environment() -> Dict[str, any]:
    """Determine and configure the test environment.

    Returns:
        Dictionary with environment configuration
    """
    # Determine environment from environment variable
    env = os.environ.get("AIRWEAVE_TEST_ENV", "test")

    # Set configuration based on environment
    if env == "test":
        backend_port = 9001  # Test environment port
        frontend_port = None  # No frontend in test environment
    else:  # onboarding environment
        backend_port = 8001  # Onboarding environment port
        frontend_port = 8080  # Frontend port for onboarding

    return {
        "env": env,
        "backend_port": backend_port,
        "frontend_port": frontend_port,
        "backend_url": f"http://localhost:{backend_port}",
        "frontend_url": f"http://localhost:{frontend_port}" if frontend_port else None,
    }
Determine and configure the test environment.

    Returns:
        Dictionary with environment configuration
    
backend/tests/e2e/conftest.py