feat(shot): mattermost-lts SCREENSHOT hook → /login (default lands the desktop-or-browser interstitial; watch-list wants the real sign-in form) + public screenshot.settle() for hooks; unit test via real loader; 206 unit tests pass, lint PASS
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
autonomic-bot
2026-06-11 06:19:39 +00:00
parent b8414a8fdb
commit 80e5713c5c
3 changed files with 52 additions and 0 deletions

View File

@ -116,6 +116,33 @@ def test_wait_budget_within_step_cap():
assert total_ms <= 60_000, f"screenshot wait budget {total_ms}ms exceeds the ~60s step cap"
def test_mattermost_screenshot_hook_lands_login():
"""phase-shot: mattermost-lts ships the first real SCREENSHOT hook — `/` serves the
desktop-or-browser interstitial, so the hook must navigate to /login (the representative,
credential-free sign-in form) and settle; the harness then snaps the PNG."""
class _Resp:
status = 200
class _NavPage(_FakePage):
def __init__(self):
super().__init__([])
self.urls = []
def goto(self, url, wait_until=None, timeout=None):
self.urls.append(url)
return _Resp()
tests_dir = os.path.join(os.path.dirname(__file__), "..")
meta = meta_mod.load("mattermost-lts", tests_dir=tests_dir)
hook = S._load_screenshot_hook(meta)
assert callable(hook), "mattermost-lts SCREENSHOT hook missing from the real load path"
page = _NavPage()
hook(page, meta_mod.hook_ctx("mm.example.org", meta))
assert page.urls == ["https://mm.example.org/login"]
assert page.idle_waits, "hook must settle before the harness snaps"
def test_screenshot_reachable_through_real_load_path(tmp_path):
"""R2 proof (rcust P1): a recipe SCREENSHOT hook declared in recipe_meta.py arrives at
screenshot._load_screenshot_hook through the REAL orchestrator load path (meta.load — the