Files
TORCH/verification/verify_dashboard.py
T
google-labs-jules[bot]andPR0M3TH3AN b92f0efd38 feat(security): migrate dashboard innerHTML to safe DOM APIs
- Replace innerHTML with document.createElement and replaceChildren in dashboard/index.html
- Add dashboard/domUtils.js for safe HTML escaping and element creation
- Add context, decisions, and test logs
- Update daily task logs

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-14 23:05:24 +00:00

25 lines
807 B
Python

from playwright.sync_api import sync_playwright
def verify_dashboard():
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page()
try:
page.goto("http://localhost:4173/dashboard/")
# Wait for title
page.wait_for_selector("h1:has-text('TORCH Agent Dashboard')")
# Wait a bit for JS to run and potentially render the summary bar
page.wait_for_timeout(3000)
# Take screenshot
page.screenshot(path="verification/dashboard.png")
print("Screenshot saved to verification/dashboard.png")
except Exception as e:
print(f"Error: {e}")
finally:
browser.close()
if __name__ == "__main__":
verify_dashboard()