"""
HTML Report Generator with modern, colorful UI
"""
import os
from datetime import datetime
from typing import Optional
def _base_html(title: str, body_html: str) -> str:
return f"""
{title}
{title}
Generated at {datetime.now().isoformat()}
{body_html}
"""
def generate_html_report_file(title: str, body_html: str, output_dir: str = "reports", filename: Optional[str] = None) -> str:
os.makedirs(output_dir, exist_ok=True)
if not filename:
filename = f"report_{datetime.now().strftime('%Y%m%d_%H%M%S')}.html"
path = os.path.join(output_dir, filename)
html = _base_html(title, body_html)
with open(path, "w", encoding="utf-8") as f:
f.write(html)
return path
def generate_markopolo_sample_report() -> str:
title = "Comprehensive Testing Report for Markopolo.ai Platform"
# Body authored as HTML blocks for fidelity
sections = [
(
"Executive Summary",
"""
I have conducted a comprehensive test of the Markopolo.ai platform, focusing on the onboarding process, data connections, integrations, and core modules. The testing revealed several critical issues that prevent full platform functionality, particularly with Shopify integration and data connectivity.
""",
),
(
"Test Results by Module",
"""
1. Onboarding Process Partially Successful
✅ Successfully logged into the platform
✅ Initial onboarding screen accessed
❌ Onboarding process appeared to be skipped or completed automatically
❌ No guided onboarding flow was experienced
2. Dataroom & Data Container Mixed Results
Client-side MarkTag
✅ Successfully connected and active
✅ Basic setup completed without issues
Server-side MarkTag
❌ Critical Failure: DNS verification failed repeatedly
❌ Unable to verify DNS records (CNAME and TXT records)
❌ System consistently showed "Records failed to verify"
Data Connectivity – Medium: Multiple integration failures
""",
),
(
"Recommendations",
"""
Priority 1: Resolve Shopify authentication issues
Priority 1: Fix Twilio credential validation
Priority 2: Address server-side MarkTag DNS verification
Priority 2: Improve error messaging and user guidance
Priority 3: Validate file upload flow with proper file handling
""",
),
(
"Conclusion",
"""
Overall Platform Readiness: Limited – key flows blocked by integration failures. Retest end-to-end journey after addressing blockers, especially Shopify.
""",
),
]
body = "".join([f'
{h}
{c}
' for h, c in sections])
return generate_html_report_file(title, body, output_dir="reports", filename=f"markopolo_report_{datetime.now().strftime('%Y%m%d_%H%M%S')}.html")