per-step screenshot + html snapshots, matches-only list, full German UI, CSV export

* apply: Recorder.step_snap(page, name) captures both a JPEG screenshot and
  the page HTML for every major moment; every provider now calls step_snap at
  each logical step so failure reports contain the exact DOM and rendered
  state at every stage of the flow
* ZIP report: each snapshot becomes snapshots/NN_<label>.jpg +
  snapshots/NN_<label>.html for AI-assisted debugging
* web: Wohnungsliste zeigt nur noch Flats, die die eigenen Filter treffen;
  Match-Chip entfernt (Liste ist jetzt implizit matchend)
* UI komplett auf Deutsch: Protokoll statt Logs, Administrator statt admin,
  Trockenmodus statt dry-run, Automatik pausiert statt circuit open,
  Alarm statt Alert, Abmelden statt Logout
* Wohnungen-Header: Zeile 1 Info (Alarm + Filter), Zeile 2 Schalter mit
  echten Radio-Paaren (An/Aus) für Automatisch bewerben und Trockenmodus;
  hx-confirm auf den kritischen Radios; per-form CSS für sichtbaren Check-State
* Protokoll: von/bis-Datumsfilter (Berliner Zeit) + CSV-Download
  (/logs/export.csv) mit UTC + lokaler Zeit

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Moritz 2026-04-21 11:40:12 +02:00
parent 04b591fa9e
commit 7444f90d6a
16 changed files with 360 additions and 202 deletions

View file

@ -17,19 +17,18 @@ class Stadtundland(Provider):
r = ctx.recorder
p = ctx.profile
async with open_page(url, recorder=r) as page:
r.step("cookies.check")
await r.step_snap(page, "cookies.check")
cookie_accept_btn = page.get_by_text("Alle akzeptieren")
if await cookie_accept_btn.is_visible():
await cookie_accept_btn.click()
r.step("cookies.accepted")
else:
r.step("cookies.absent")
await r.step_snap(page, "cookies.accepted")
r.step("page.offline_check")
await r.step_snap(page, "page.offline_check")
if await page.get_by_role("heading", name="Hier ist etwas schief gelaufen").is_visible():
await r.step_snap(page, "abort.offline", status="warn")
return ApplicationResult(False, message=_("ad_offline"))
r.step("form.fill")
await r.step_snap(page, "form.fill")
await page.locator("#name").fill(p.firstname)
await page.locator("#surname").fill(p.lastname)
await page.locator("#street").fill(p.street)
@ -40,17 +39,20 @@ class Stadtundland(Provider):
await page.locator("#email").fill(p.email)
await page.locator("#privacy").check()
await page.locator("#provision").check()
await r.step_snap(page, "form.filled")
if not ctx.submit_forms:
r.step("submit.dry_run")
await r.step_snap(page, "submit.dry_run")
return ApplicationResult(True, _("application_success_dry"))
r.step("submit.review"); await page.get_by_role("button", name="Eingaben prüfen").click()
r.step("submit.send"); await page.get_by_role("button", name="Absenden").click()
await r.step_snap(page, "submit.review")
await page.get_by_role("button", name="Eingaben prüfen").click()
await r.step_snap(page, "submit.send")
await page.get_by_role("button", name="Absenden").click()
await page.wait_for_timeout(2000)
r.step("success.check")
await r.step_snap(page, "success.check")
if await page.locator("p").filter(has_text="Vielen Dank!").is_visible():
return ApplicationResult(True)
r.step("success.not_found", "warn")
await r.step_snap(page, "success.not_found", status="warn")
return ApplicationResult(success=False, message=_("submit_conformation_msg_not_found"))