From 9459e76a6cf81e5e359a32cbab8b8bc7469fe2c1 Mon Sep 17 00:00:00 2001 From: "n.siegfried" Date: Fri, 14 Aug 2026 16:09:04 -0500 Subject: [PATCH] Add a front-end browser check, so the pages are testable and not just readable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit server/smoketest.py proves the API works; nothing proved the PAGES work. That gap is why users.js, wp-sidenav.js and the extracted console.css shipped unexecuted and had to be written up as a known issue instead of verified. This closes the gap with a tool rather than a one-off, so the next front-end change is cheap to check. tests/cdp.py a minimal DevTools Protocol client — hand-rolled stdlib WebSocket (handshake, masked frames), browser discovery for Edge/Chrome across platforms, and process teardown. tests/browser_check.py the fixture and 71 assertions. Stdlib only, matching smoketest.py's rule: these have to run on a plain Python install on whatever machine is to hand. No pip, no Selenium, no node. Self-contained — it builds a throwaway database, seeds a fixture, starts its own uvicorn on a free port, drives the browser, and tears everything down. The real database is never touched. Sessions come from minting a token with the app's own auth.create_token() rather than scripting the login form. What it asserts, beyond "no JavaScript errors on boot" (the thing that actually went unverified): the three role-dependent renderings of the directory, one-line rows and no sideways scroll, the roles each caller may grant, the project-access dialog opening and closing, the drawer's open/Escape/scrim/focus/aria behaviour and its role gating, ?project= carried only onto project-scoped links, and — the reason this matters most — that admin.html still has its tokens, cards, headings and dense sticky tables after console.css was lifted out of its inline