"""Generated by Agentic Swarm Simulator from run repair-loop-bd6a868. Visitor: First-time visitor. Goal: Open the About page and read why Overturn exists. Outcome: stuck. Clicked 'ABOUT' and the page answered with error 404. Last words: "fix why this exists link" Navigation smoke check only. A pass does not establish task completion. Red while a page on this path answers with an error; no error is presumed. Run: pip install pytest playwright && playwright install chromium && pytest this_file.py """ import os, re from playwright.sync_api import sync_playwright, expect START = os.environ.get("SWARM_START_URL", "http://127.0.0.1:63798/") PATH = ["ABOUT"] SELECTORS = [None] def test_visitor_path_about(): with sync_playwright() as pw: browser = pw.chromium.launch(headless=True) page = browser.new_page(viewport={"width": 1440, "height": 900}) status = {} page.on("response", lambda r: status.__setitem__("last", r.status) if r.request.is_navigation_request() and r.frame == page.main_frame else None) first = page.goto(START, wait_until="domcontentloaded") assert first is not None and first.status < 400, f"start page answered {first.status if first else None}" for index, label in enumerate(PATH): status.pop("last", None) # Whole label, any case: the visitor read rendered text, which CSS text-transform can change from the accessible name. name = re.compile("^" + re.escape(label) + "$", re.I) target = page.get_by_role("link", name=name).or_(page.get_by_role("button", name=name)).or_(page.get_by_role("tab", name=name)).or_(page.locator("summary").filter(has_text=name)) if SELECTORS[index]: target = page.locator(SELECTORS[index]).and_(page.locator("a[href],button,[role=button],[role=link],[role=tab],summary")).filter(has_text=name) expect(target).to_have_count(1, timeout=8000) assert target.count() == 1, f"recorded control missing or ambiguous: {label!r}" target.click() page.wait_for_load_state("domcontentloaded") code = status.get("last", 200) assert code < 400, f"clicking {label!r} opened a page that answered {code}" text = page.locator("body").inner_text().strip() assert len(text) > 40, "the last page on the path has almost no text" browser.close()