fix(shot): mattermost hook v2 — interstitial appears on ANY first-visit route incl /login (proven byte-identical PNG); click 'View in Browser' best-effort then settle; unit test covers click + no-interstitial fallback; 207 pass, lint PASS
continuous-integration/drone/push Build is passing

This commit is contained in:
autonomic-bot
2026-06-11 06:45:43 +00:00
parent 5fc86991dd
commit 3c33129ebd
2 changed files with 31 additions and 8 deletions
+15 -6
View File
@@ -21,11 +21,17 @@ EXTRA_ENV = {"TIMEOUT": "600"}
def SCREENSHOT(page, ctx):
"""Land the real sign-in form for the CI card (phase-shot). The default landing capture gets
mattermost's "view in desktop app or browser?" interstitial at `/` — a real page but not
representative of the app. `/login` renders the standard login form directly. Credential-free
(empty fields, R7 secret-safety: never a page showing generated secrets); the harness snaps
the PNG after this returns."""
"""Land the real sign-in form for the CI card (phase-shot). Mattermost serves a
"view in desktop app or browser?" interstitial on a browser's FIRST visit to ANY route
(including /login — proven by shot-proof2-mattermost-lts: byte-identical interstitial PNG with
and without a plain /login hook); a real user clicks "View in Browser" to reach the login
form, so the hook does exactly that. Click + second settle are best-effort (if the
interstitial is absent we are already on the form). Credential-free (empty fields, R7
secret-safety); the harness snaps the PNG after this returns. Waits are kept short (8s/3s/8s)
so the realistic hook path stays well inside the ~60s step budget — the 45s nav deadline is
only burned when the app never serves, and then the hook raises before any settle."""
import contextlib
from harness import browser as harness_browser
from harness import screenshot as screenshot_mod
@@ -36,4 +42,7 @@ def SCREENSHOT(page, ctx):
deadline_seconds=screenshot_mod.NAV_DEADLINE_S,
wait_until="domcontentloaded",
)
screenshot_mod.settle(page)
screenshot_mod.settle(page, 8_000)
with contextlib.suppress(Exception):
page.click("text=View in Browser", timeout=3_000)
screenshot_mod.settle(page, 8_000)