(page, slug: str, label: str)
| 243 | |
| 244 | |
| 245 | def _save_screenshot(page, slug: str, label: str) -> Path: |
| 246 | SCREENSHOT_DIR.mkdir(parents=True, exist_ok=True) |
| 247 | stamp = dt.datetime.now(dt.timezone.utc).strftime("%Y%m%dT%H%M%SZ") |
| 248 | path = SCREENSHOT_DIR / f"{slug}-{label}-{stamp}.png" |
| 249 | try: |
| 250 | page.screenshot(path=str(path), full_page=True) |
| 251 | except Exception: # noqa: BLE001 — never let a screenshot failure mask the real error |
| 252 | return path |
| 253 | return path |
| 254 | |
| 255 | |
| 256 | class FoojayAdapter: |
no test coverage detected