S008: every nacre:// page smoke and blank-shot checker

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-12 11:19:54 -06:00
commit 50f74c792a
3 changed files with 81 additions and 1 deletions

View file

@ -11,7 +11,7 @@ Verify passwords/vault and autofill, permissions prompts, history/bookmarks/down
- `src/ui/pages/mod.rs` (list of pages)
## Steps
- [ ] Script: open every nacre:// page and take a shot; check none panics or renders empty
- [x] Script: open every nacre:// page and take a shot; check none panics or renders empty
- [ ] Vault: create, lock/unlock, save a login from a local form page, autofill it, export/import; check the vault file is encrypted
- [ ] Permissions: a local page asking for notifications/geolocation/camera; allow/deny/remember; check `permissions` store
- [ ] History, bookmarks (add, folder, bookmarks bar, import/export HTML), downloads page lists entries

View file

@ -0,0 +1,58 @@
# Stores pass (S008): every nacre:// page opens, nothing panics, nothing renders blank (tools/check-shots.py).
# Settings sections are covered by settings.txt. Offline. Hidden: tools/smoke.sh tests/smoke/stores-pages.txt
# then: python3 tools/check-shots.py <outdir>
wait 3
resize 1280 900
page nacre://newtab
wait 1
shot page-newtab
page nacre://settings
wait 1
shot page-settings
page nacre://history
wait 1
shot page-history
page nacre://bookmarks
wait 1
shot page-bookmarks
page nacre://downloads
wait 1
shot page-downloads
page nacre://passwords
wait 1
shot page-passwords
page nacre://apps
wait 1
shot page-apps
page nacre://site-settings
wait 1
shot page-site-settings
page nacre://site-settings/example.com
wait 1
shot page-site-settings-host
page nacre://clear-data
wait 1
shot page-clear-data
page nacre://about
wait 1
shot page-about
page nacre://welcome
wait 1
shot page-welcome
page nacre://task-manager
wait 1
shot page-task-manager
page nacre://devtools
wait 1
shot page-devtools
page nacre://gallery
wait 1
shot page-gallery
page nacre://source/@PAGES@/hello.html
wait 1
shot page-source
open https://no-such-host.invalid/
wait 4
shot page-error
status done
quit

22
tools/check-shots.py Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env python3
"""Fail if a smoke screenshot looks blank: usage `tools/check-shots.py <outdir> [prefix]` (checks <prefix>*.png).
A shot is blank when its window area has fewer than 8 distinct colours or one colour covers over 99.5 % of it."""
import sys
from collections import Counter
from pathlib import Path
from PIL import Image
out = Path(sys.argv[1])
prefix = sys.argv[2] if len(sys.argv) > 2 else ""
bad = 0
shots = sorted(out.glob(prefix + "*.png"))
for shot in shots:
image = Image.open(shot).convert("RGB")
colours = Counter(image.getdata())
top = colours.most_common(1)[0][1] / (image.width * image.height)
blank = len(colours) < 8 or top > 0.995
print(f"{'BLANK' if blank else 'ok '} {shot.name}: {len(colours)} colours, {top:.1%} one colour")
bad += blank
print(f"{len(shots)} shots, {bad} blank")
sys.exit(1 if bad or not shots else 0)