peregrine/tests/e2e/modes
pyr0ball cb8afa6539 fix(e2e): cloud auth via cookie, local port, Playwright WebSocket gotcha
E2E harness fixes to get all three modes (demo/cloud/local) passing:

- conftest.py: use ctx.add_cookies() for cloud auth instead of
  ctx.route() or set_extra_http_headers(). Playwright's route() only
  intercepts HTTP; set_extra_http_headers() explicitly excludes
  WebSocket handshakes. Streamlit reads st.context.headers from the
  WebSocket upgrade, so cookies are the only vehicle that reaches it
  without a reverse proxy.

- cloud_session.py: fall back to Cookie header when X-CF-Session is
  absent — supports direct access (E2E tests, dev without Caddy).
  In production Caddy sets X-CF-Session; in tests the cf_session cookie
  is set on the browser context and arrives in the Cookie header.

- modes/cloud.py: add /peregrine base URL path (STREAMLIT_SERVER_BASE_URL_PATH=peregrine)

- modes/local.py: correct port from 8502 → 8501 and add /peregrine path

All three modes now pass smoke + interaction tests clean.
2026-03-17 20:01:42 -07:00
..
__init__.py chore(e2e): scaffold E2E harness directory and install deps 2026-03-16 22:58:47 -07:00
cloud.py fix(e2e): cloud auth via cookie, local port, Playwright WebSocket gotcha 2026-03-17 20:01:42 -07:00
demo.py feat(e2e): add smoke + interaction tests; fix two demo mode errors 2026-03-17 07:00:54 -07:00
local.py fix(e2e): cloud auth via cookie, local port, Playwright WebSocket gotcha 2026-03-17 20:01:42 -07:00