From 50f74c792aab466b87f89acb5153b7a4e17607f5 Mon Sep 17 00:00:00 2001 From: astar76 Date: Thu, 12 Nov 2026 11:19:54 -0600 Subject: [PATCH] S008: every nacre:// page smoke and blank-shot checker Co-Authored-By: Claude Sonnet 5.5 --- Plans/02 Verify/S008-verify-stores.md | 2 +- tests/smoke/stores-pages.txt | 58 +++++++++++++++++++++++++++ tools/check-shots.py | 22 ++++++++++ 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 tests/smoke/stores-pages.txt create mode 100755 tools/check-shots.py diff --git a/Plans/02 Verify/S008-verify-stores.md b/Plans/02 Verify/S008-verify-stores.md index cc60983..76fb715 100644 --- a/Plans/02 Verify/S008-verify-stores.md +++ b/Plans/02 Verify/S008-verify-stores.md @@ -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 diff --git a/tests/smoke/stores-pages.txt b/tests/smoke/stores-pages.txt new file mode 100644 index 0000000..dade89c --- /dev/null +++ b/tests/smoke/stores-pages.txt @@ -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 +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 diff --git a/tools/check-shots.py b/tools/check-shots.py new file mode 100755 index 0000000..7db6d15 --- /dev/null +++ b/tools/check-shots.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +"""Fail if a smoke screenshot looks blank: usage `tools/check-shots.py [prefix]` (checks *.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)