feat(b17): Akkordeon-Expansion im Audit-Walk (Stufe 2, #7)
Nach jedem Compliance-Doc-Aufruf werden alle Akkordeons /
<details> / [aria-expanded=false] / Trigger-Patterns geklickt
und im Video aufgenommen.
- _expand_accordions(): 7 Selektor-Patterns, max 25 Expansionen
pro Seite, Dedup nach inner_text (verhindert Endlos-Loops bei
nesteten Strukturen). Scroll-into-view + click + 400ms warten
sicher dass das Klick-Result im Video erfasst wird.
- _visit_link(): Returns (nav_event, expand_event) Tuple. Expand
läuft nur bei HTTP 2xx + ohne nav-error.
- 1500ms post-expand wait gibt der Kamera Zeit, den finalen
Zustand mitzuschneiden.
Backend B17 render: "expand_accordions" Action wird als "5
Akkordeon/Details-Sektion(en) entfaltet" gerendert. Bei 0:
"Keine Akkordeons gefunden" (neutraler Hinweis, kein Fehler).
Real-World-Smoke gegen Elli:
Impressum: 0 Akkordeons (keine)
Datenschutzerkl: 5 Akkordeons aufgeklappt
Nutzungsbeding: 0 Akkordeons
Video-Größe verdoppelt sich (581 KB → 1.14 MB) — Reviewer sieht
jetzt den vollen DSE-Vendor-Tabellen-Inhalt im Video.
Tests: 10/10 grün (+2 für Akkordeon-Render-Pfade).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,8 @@ _FAKE_WALK = {
|
||||
"url": "https://example.com/datenschutz",
|
||||
"anchor_text": "Datenschutz", "status": 200,
|
||||
"title": "Datenschutzerklärung"},
|
||||
{"timestamp": "2026-06-07T10:00:12+00:00",
|
||||
"action": "expand_accordions", "expanded": 5, "max": 25},
|
||||
],
|
||||
"video": {
|
||||
"filename": "video.webm",
|
||||
@@ -49,14 +51,27 @@ class TestRender:
|
||||
|
||||
def test_action_table_lists_all_actions(self):
|
||||
html = _render(_FAKE_WALK)
|
||||
# All four actions appear as <tr>
|
||||
assert html.count("<tr>") >= 4 # incl. header
|
||||
# All five actions + header appear as <tr>
|
||||
assert html.count("<tr>") >= 5
|
||||
|
||||
def test_nav_count_reflects_navigate_actions(self):
|
||||
html = _render(_FAKE_WALK)
|
||||
# 1 navigate in the fixture
|
||||
assert "1 Compliance-Seiten" in html
|
||||
|
||||
def test_renders_accordion_expansion_count(self):
|
||||
html = _render(_FAKE_WALK)
|
||||
assert "5 Akkordeon" in html
|
||||
|
||||
def test_accordion_zero_renders_neutral_text(self):
|
||||
walk = dict(_FAKE_WALK)
|
||||
walk["actions"] = [
|
||||
{"timestamp": "...", "action": "expand_accordions",
|
||||
"expanded": 0, "max": 25},
|
||||
]
|
||||
html = _render(walk)
|
||||
assert "Keine Akkordeons gefunden" in html
|
||||
|
||||
|
||||
class TestRunB17:
|
||||
def test_no_request_skipped(self):
|
||||
|
||||
Reference in New Issue
Block a user