Files
TORCH/verify_landing_final.py
T
google-labs-jules[bot]andPR0M3TH3AN de8b62ef02 Run ui-ux-agent: Improve landing page a11y and add style guide
- Created `docs/style-guide.md` documenting design system.
- Refined `landing/index.html` with ARIA attributes and keyboard navigation for agent selection.
- Verified changes with Playwright script.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-25 05:35:27 +00:00

50 lines
1.7 KiB
Python

from playwright.sync_api import sync_playwright
def run(playwright):
browser = playwright.chromium.launch(headless=True)
page = browser.new_page()
page.goto("http://localhost:8080/landing/index.html")
# Wait for the page to load
page.wait_for_selector(".agent-selector")
# 1. Verify default state (Jules selected)
jules_card = page.locator("#card-jules")
codex_card = page.locator("#card-codex")
print("Checking default state...")
assert jules_card.get_attribute("aria-checked") == "true", "Jules card should be checked by default"
assert codex_card.get_attribute("aria-checked") == "false", "Codex card should not be checked by default"
# 2. Test keyboard navigation and selection
print("Testing keyboard interaction...")
# Focus on the first card (Jules)
jules_card.focus()
# Tab to link inside Jules card
page.keyboard.press("Tab")
# Tab to Codex card
page.keyboard.press("Tab")
# Check if focused element is Codex card
focused_id = page.evaluate("document.activeElement.id")
assert focused_id == "card-codex", f"Expected focus on card-codex, but got {focused_id}"
# Press Enter to select Codex
page.keyboard.press("Enter")
# Verify Codex is selected
assert codex_card.get_attribute("aria-checked") == "true", "Codex card should be checked after Enter"
assert jules_card.get_attribute("aria-checked") == "false", "Jules card should be unchecked after selection change"
# 3. Take screenshot
print("Taking screenshot...")
page.screenshot(path="verification.png")
browser.close()
if __name__ == "__main__":
with sync_playwright() as playwright:
run(playwright)