""" 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

2. Dataroom & Data Container Mixed Results

Client-side MarkTag

Server-side MarkTag

3. Integrations Mixed Results

Email Services

WhatsApp Integration

CRM Integrations

4. Shopify Integration Critical Failure

Impact: Unable to test Shopify-specific flows (campaigns, discounts, event tracking).

5. Users Module Partially Tested

6. Audience Studio Functional but Limited

7. Analytics Module Limited Functionality

8. Knowledge Base Not Tested

""", ), ( "Critical Issues Identified", """ """, ), ( "Recommendations", """
  1. Priority 1: Resolve Shopify authentication issues
  2. Priority 1: Fix Twilio credential validation
  3. Priority 2: Address server-side MarkTag DNS verification
  4. Priority 2: Improve error messaging and user guidance
  5. 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")