# Manual Testing Guide: Markdown Rendering Feature **Feature**: 003-render-ai-analyis - Render AI Analysis as Formatted HTML **Tasks**: T020 (Security Verification) and T021 (Performance Validation) --- ## Prerequisites Before you begin, ensure: - ✅ Virtual environment is activated - ✅ Dependencies are installed (`pip install -r requirements.txt`) - ✅ You have the test data generator script: `prepare_markdown_manually.py` --- ## Step 1: Create Test Data Run the test data generator to create 4 different feedback samples: ```bash python prepare_markdown_manually.py ``` This creates: 1. **Rich Formatting Test** - Headings, lists, tables, code blocks, links 2. **XSS Security Test** - Script tags, iframes, javascript: protocol 3. **Complex Tables Test** - Nested lists, multiple tables, code samples 4. **Performance Test** - 30 sections with tables, lists, and code The script will output the feedback IDs created. --- ## Step 2: Start the Flask Application ### Option A: Using run.py (Recommended) ```bash python run.py ``` ### Option B: Using Flask CLI ```bash export FLASK_APP=app export FLASK_ENV=development flask run ``` The application will start on **http://localhost:5000** --- ## Step 3: Login to Dashboard 1. Open your browser and navigate to: **http://localhost:5000/login** 2. Login with default credentials: - **Username**: `admin` - **Password**: `admin123` 3. You should be redirected to: **http://localhost:5000/dashboard** --- ## Step 4: Verify Markdown Rendering (T020 & T021) ### Test 1: Rich Formatting ✅ **Feedback**: Click on the first test feedback (Rich Markdown Formatting) **What to verify:** 1. **Headings** - [ ] `## Summary` appears as styled `

` heading (not raw markdown) - [ ] `### Key Points` appears as styled `

` heading 2. **Text Formatting** - [ ] `**highly positive**` appears as **bold** text - [ ] `*minor concerns*` appears as *italic* text 3. **Lists** - [ ] Bullet points render with actual bullets (•) - [ ] Numbered lists show as 1, 2, 3 (not markdown "1.") 4. **Code** - [ ] Inline code `Flask` has monospace font and background - [ ] Code block shows Python syntax in preformatted block - [ ] Code block has distinct background/border 5. **Tables** - [ ] Table renders with borders and proper structure - [ ] Headers are distinct from data rows - [ ] All 4 rows (Score, Sentiment, Response Time, Priority) visible 6. **Links** (SECURITY - T020) - [ ] "Flask Documentation" link is clickable - [ ] Right-click → Inspect on the link - [ ] Verify `target="_blank"` attribute exists - [ ] Verify `rel="noopener noreferrer nofollow"` attribute exists - [ ] Click link - should open in NEW TAB **Browser DevTools Check**: ``` Right-click on link → Inspect → Should see: Flask Documentation ``` --- ### Test 2: XSS Security Testing ✅ (T020 - CRITICAL) **Feedback**: Click on the second test feedback (XSS Security Testing) **What to verify** (All should be REMOVED): 1. **Script Tags** - [ ] NO `