================================== Specialized Modules ================================== A second wave of utility modules ship under ``je_web_runner/utils/``, each in its own subpackage with focused unit tests. They are not part of the executor's hot path — import only what a particular test needs. Every module here is also reachable from action JSON as a ``WR_*`` command when the relevant entry point is wired up; see :doc:`../action_executor/action_executor_doc` for command registration. .. contents:: On this page :local: :depth: 2 ---- Web Platform APIs ================= For modern browser APIs that are awkward to drive through plain WebDriver: streams, storage, file pickers, notifications. ``webtransport_assert`` ----------------------- HTTP/3 WebTransport datagram + stream frame recorder. Symmetric API with ``websocket_assert`` and ``sse_assert`` so the assertion code looks the same regardless of transport. Key entry points: * ``WtFrameRecorder.record_sent_datagram(payload)``, ``.record_stream_chunk(direction, stream_id, payload, fin=…)`` * ``assert_datagram_count``, ``assert_stream_complete``, ``assert_payload_contains``, ``assert_json_shape`` ``indexed_db_explorer`` ----------------------- Generates a browser-side harvest script that serialises a chosen IndexedDB into JSON, plus typed :class:`IdbSnapshot` parser and ``assert_store_present`` / ``assert_record_count`` / ``assert_key_present`` / ``assert_index_present`` / ``diff_snapshots`` helpers. ``file_system_access`` ---------------------- JS shim that mocks ``showOpenFilePicker`` / ``showSaveFilePicker`` / ``showDirectoryPicker``. Records every ``write()`` against the fake save handle into ``window.__wr_fsa_writes__``; ``parse_writes`` + ``assert_wrote`` + ``combined_payload`` consume the harvested log. ``notifications_audit`` ----------------------- Installs a JS shim that tracks every ``Notification.requestPermission`` call and every ``new Notification(...)``. Asserts: * ``assert_no_prompt_without_gesture`` * ``assert_no_prompt_before(min_page_age_ms=…)`` * ``assert_no_spam_after_deny`` * ``assert_notification_shown(title_contains=…, body_contains=…, tag=…)`` * ``assert_unique_tags`` ``sse_assert`` -------------- Server-Sent Events wire-format parser + chunk-buffering :class:`SseRecorder`. Assertions: count, data-contains, JSON shape, strictly-increasing ids. ``websocket_assert`` -------------------- WebSocket frame recorder + count / payload / pubsub-pattern / JSON-shape assertions. ``webrtc_assert`` ----------------- Ingests JSON snapshots of ``RTCPeerConnection`` instance state and ``getStats()`` reports. Asserts: connected state, track presence, SDP codec, packet-loss ratio, minimum bytes flowed. ``view_transitions`` -------------------- JS instrumentation that records each ``document.startViewTransition`` lifecycle + ``LayoutShift`` entries scoped to the transition window. Asserts: ``assert_all_finished``, ``assert_under_duration``, ``assert_cls_under``, ``assert_group_present``. Security & Headers ================== ``mixed_content_audit`` ----------------------- HAR parser + console-message scanner that flags HTTP resources loaded on HTTPS pages. Severity bucket: ``ACTIVE`` (blocked outright) vs ``PASSIVE`` (loaded but unsafe) vs ``UPGRADE`` (HSTS-auto-redirected). ``clickjacking_audit`` ---------------------- Combined header policy verdict (``X-Frame-Options`` + ``frame-ancestors``) plus an HTML probe page generator so the actual browser behaviour can be measured even when headers look correct. ``open_redirect_detector`` -------------------------- Eight-payload probe set covering ``//evil``, ``@userinfo``, ``javascript:``, ``data:``, mixed-case bypass, backslash bypass, etc. Classifies each response as ``BLOCKED`` / ``ALLOWED`` / ``AMBIGUOUS`` against a caller-supplied probe callable. ``sri_verify`` -------------- Parses ``