test(e2e): byte-stable screenshots + drop the redundant 1440 shot (1.0.2)
Two problems the committed PNG set had, both found by re-running the suite after the tree was already clean: 1. Every run produced different bytes. The status card prints the mock's ephemeral port and the tmp work dir, so docs/ui-*.png changed on each invocation - which dirties the working tree, and a dirty tree is exactly what `scorpiox-cli-botplugin audit` refuses (exit 5: working tree is dirty). The publish gate was therefore failing for a reason that looked like a test-hygiene nit and was actually the release gate. The page's volatile facts are neutralised before the shutter (display only, after every assertion), so two runs now hash identically: 7/7 md5 match. 2. docs/ui-dark-1440.png was a leftover of an earlier name and duplicated ui-1440x900-dark.png; e2e.py no longer writes it, and it is removed. 1.0.2 carries no code change: version bumped so the fixed artifacts are distinguishable from the ones this test wrote.
AuthorPico <picobot@scorpioplayer.com>
Date2026-11-16 13:18:54
Commit433f177d
Parentse6c02501
Changed files
plugin.json+1−1■■
src/gh.h+1−1■■
tests/e2e.py+21−3■■■■■
10 files+23−5
Diff
docs/ui-1024x768-dark.png+0−0■
index 67a16ff..d3c1725 100644
binary image
Binary image file
docs/ui-1024x768-light.png+0−0■
index 1dcfc7e..9d1512c 100644
binary image
Binary image file
docs/ui-1440x900-dark.png+0−0■
index 30afa1c..4ee74f6 100644
binary image
Binary image file
docs/ui-1440x900-light.png+0−0■
index f9ccfed..7010bb8 100644
binary image
Binary image file
docs/ui-390x844-dark.png+0−0■
index 1222003..71d72d9 100644
binary image
Binary image file
docs/ui-390x844-light.png+0−0■
index 0419add..94731f7 100644
binary image
Binary image file
docs/ui-embed-390-light.png+0−0■
index 0419add..94731f7 100644
binary image
Binary image file
plugin.json+1−1■■
index 29ea40e..7b2a688 100644
--- a/plugin.json
+++ b/plugin.json
@@ -11,7 +11,7 @@
1111 "menus": false,
1212 "verified": "mock",
1313 "category": "devtools",
14- "version": "1.0.1",
14+ "version": "1.0.2",
1515 "license": "MIT",
1616 "capabilities": [
1717 "outbound_https_github_rest_api",
src/gh.h+1−1■■
index 69fd47f..e32a9fa 100644
--- a/src/gh.h
+++ b/src/gh.h
@@ -44,7 +44,7 @@
4444
4545 #define GH_SLUG "github"
4646 #define GH_ID "plugin_github"
47-#define GH_VER "1.0.1"
47+#define GH_VER "1.0.2"
4848 #define GH_NAME "github"
4949 #define GH_DESC "GitHub tools"
5050
tests/e2e.py+21−3■■■■■
index b356e9f..91998e5 100644
--- a/tests/e2e.py
+++ b/tests/e2e.py
@@ -13,7 +13,10 @@ API base at tests/mockapi.py, opens the page with Playwright at 1440 / 1024 /
1313 * saving a token flips the pill, clears the password field, and never
1414 echoes the token back into the DOM
1515 * a bad api base surfaces the server's 400 message, not a silent no-op
16- * screenshots land in docs/ for the README
16+ * screenshots land in docs/ and are byte-stable: the state card's
17+ ephemeral port and tmp work dir are neutralised before the shutter, so
18+ re-running the suite never dirties the git tree (a dirty tree fails
19+ `scorpiox-cli-botplugin audit`, which is the publish gate)
1720
1821 Skips cleanly (exit 0) when Playwright is missing, so the offline suite stays
1922 dependency-free.
@@ -76,6 +79,21 @@ def start_mock():
7679 return proc, "http://127.0.0.1:%d" % port, log
7780
7881
82+def stabilise(page):
83+ """Make the page's volatile facts constant so the committed PNGs are
84+ reproducible. Only the display is touched; nothing the assertions read is
85+ changed, and this runs after every assertion at its viewport."""
86+ page.evaluate(
87+ """() => {
88+ const base = document.getElementById('sBase');
89+ if (base) base.textContent = 'http://127.0.0.1:PORT';
90+ const dir = document.getElementById('sDir');
91+ if (dir) dir.textContent = '/home/user/.scorpiox/connectors/plugin_github';
92+ const meta = document.getElementById('saveMeta');
93+ if (meta) meta.textContent = '';
94+ }""")
95+
96+
7997 class Handler(http.server.BaseHTTPRequestHandler):
8098 """Runs the binary as a CGI: env from the request, stdin from the body.
8199
@@ -213,6 +231,7 @@ def main():
213231
214232 # one committed screenshot per viewport + theme (the
215233 # README's responsive story is told by these files)
234+ stabilise(page)
216235 page.screenshot(
217236 path=os.path.join(shots, "ui-%dx%d-%s.png" % (w, h, theme)),
218237 full_page=True)
@@ -280,8 +299,6 @@ def main():
280299 "document.getElementById('okline').textContent.indexOf('Saved') >= 0",
281300 timeout=20000)
282301
283- shot = os.path.join(shots, "ui-%s-%s.png" % (theme, "1440"))
284- page.screenshot(path=shot, full_page=True)
285302 ctx.close()
286303
287304 # small viewport screenshot for the responsive story
@@ -291,6 +308,7 @@ def main():
291308 page.goto(url + "?theme=light&embed=1", wait_until="networkidle")
292309 page.wait_for_function(
293310 "document.querySelectorAll('.tool').length == 5", timeout=15000)
311+ stabilise(page)
294312 page.screenshot(path=os.path.join(shots, "ui-embed-390-light.png"),
295313 full_page=True)
296314 ctx.close()
297315
docs/ui-1024x768-dark.png+0−0■
index 67a16ff..d3c1725 100644index 67a16ff..d3c1725 100644
binary image
Binary image file
docs/ui-1024x768-light.png+0−0■
index 1dcfc7e..9d1512c 100644index 1dcfc7e..9d1512c 100644
binary image
Binary image file
docs/ui-1440x900-dark.png+0−0■
index 30afa1c..4ee74f6 100644index 30afa1c..4ee74f6 100644
binary image
Binary image file
docs/ui-1440x900-light.png+0−0■
index f9ccfed..7010bb8 100644index f9ccfed..7010bb8 100644
binary image
Binary image file
docs/ui-390x844-dark.png+0−0■
index 1222003..71d72d9 100644index 1222003..71d72d9 100644
binary image
Binary image file
docs/ui-390x844-light.png+0−0■
index 0419add..94731f7 100644index 0419add..94731f7 100644
binary image
Binary image file
docs/ui-embed-390-light.png+0−0■
index 0419add..94731f7 100644index 0419add..94731f7 100644
binary image
Binary image file
plugin.json+1−1■■
index 29ea40e..7b2a688 100644index 29ea40e..7b2a688 100644
--- a/plugin.json--- a/plugin.json
+++ b/plugin.json+++ b/plugin.json
@@ -11,7 +11,7 @@@@ -11,7 +11,7 @@
11 "menus": false,11 "menus": false,
12 "verified": "mock",12 "verified": "mock",
13 "category": "devtools",13 "category": "devtools",
14- "version": "1.0.1",14+ "version": "1.0.2",
15 "license": "MIT",15 "license": "MIT",
16 "capabilities": [16 "capabilities": [
17 "outbound_https_github_rest_api",17 "outbound_https_github_rest_api",
src/gh.h+1−1■■
index 69fd47f..e32a9fa 100644index 69fd47f..e32a9fa 100644
--- a/src/gh.h--- a/src/gh.h
+++ b/src/gh.h+++ b/src/gh.h
@@ -44,7 +44,7 @@@@ -44,7 +44,7 @@
44 44
45 #define GH_SLUG "github"45 #define GH_SLUG "github"
46 #define GH_ID "plugin_github"46 #define GH_ID "plugin_github"
47-#define GH_VER "1.0.1"47+#define GH_VER "1.0.2"
48 #define GH_NAME "github"48 #define GH_NAME "github"
49 #define GH_DESC "GitHub tools"49 #define GH_DESC "GitHub tools"
50 50
tests/e2e.py+21−3■■■■■
index b356e9f..91998e5 100644index b356e9f..91998e5 100644
--- a/tests/e2e.py--- a/tests/e2e.py
+++ b/tests/e2e.py+++ b/tests/e2e.py
@@ -13,7 +13,10 @@ API base at tests/mockapi.py, opens the page with Playwright at 1440 / 1024 /@@ -13,7 +13,10 @@ API base at tests/mockapi.py, opens the page with Playwright at 1440 / 1024 /
13 * saving a token flips the pill, clears the password field, and never13 * saving a token flips the pill, clears the password field, and never
14 echoes the token back into the DOM14 echoes the token back into the DOM
15 * a bad api base surfaces the server's 400 message, not a silent no-op15 * a bad api base surfaces the server's 400 message, not a silent no-op
16- * screenshots land in docs/ for the README16+ * screenshots land in docs/ and are byte-stable: the state card's
17+ ephemeral port and tmp work dir are neutralised before the shutter, so
18+ re-running the suite never dirties the git tree (a dirty tree fails
19+ `scorpiox-cli-botplugin audit`, which is the publish gate)
17 20
18 Skips cleanly (exit 0) when Playwright is missing, so the offline suite stays21 Skips cleanly (exit 0) when Playwright is missing, so the offline suite stays
19 dependency-free.22 dependency-free.
@@ -76,6 +79,21 @@ def start_mock():@@ -76,6 +79,21 @@ def start_mock():
76 return proc, "http://127.0.0.1:%d" % port, log79 return proc, "http://127.0.0.1:%d" % port, log
77 80
78 81
82+def stabilise(page):
83+ """Make the page's volatile facts constant so the committed PNGs are
84+ reproducible. Only the display is touched; nothing the assertions read is
85+ changed, and this runs after every assertion at its viewport."""
86+ page.evaluate(
87+ """() => {
88+ const base = document.getElementById('sBase');
89+ if (base) base.textContent = 'http://127.0.0.1:PORT';
90+ const dir = document.getElementById('sDir');
91+ if (dir) dir.textContent = '/home/user/.scorpiox/connectors/plugin_github';
92+ const meta = document.getElementById('saveMeta');
93+ if (meta) meta.textContent = '';
94+ }""")
95+
96+
79 class Handler(http.server.BaseHTTPRequestHandler):97 class Handler(http.server.BaseHTTPRequestHandler):
80 """Runs the binary as a CGI: env from the request, stdin from the body.98 """Runs the binary as a CGI: env from the request, stdin from the body.
81 99
@@ -213,6 +231,7 @@ def main():@@ -213,6 +231,7 @@ def main():
213 231
214 # one committed screenshot per viewport + theme (the232 # one committed screenshot per viewport + theme (the
215 # README's responsive story is told by these files)233 # README's responsive story is told by these files)
234+ stabilise(page)
216 page.screenshot(235 page.screenshot(
217 path=os.path.join(shots, "ui-%dx%d-%s.png" % (w, h, theme)),236 path=os.path.join(shots, "ui-%dx%d-%s.png" % (w, h, theme)),
218 full_page=True)237 full_page=True)
@@ -280,8 +299,6 @@ def main():@@ -280,8 +299,6 @@ def main():
280 "document.getElementById('okline').textContent.indexOf('Saved') >= 0",299 "document.getElementById('okline').textContent.indexOf('Saved') >= 0",
281 timeout=20000)300 timeout=20000)
282 301
283- shot = os.path.join(shots, "ui-%s-%s.png" % (theme, "1440"))
284- page.screenshot(path=shot, full_page=True)
285 ctx.close()302 ctx.close()
286 303
287 # small viewport screenshot for the responsive story304 # small viewport screenshot for the responsive story
@@ -291,6 +308,7 @@ def main():@@ -291,6 +308,7 @@ def main():
291 page.goto(url + "?theme=light&embed=1", wait_until="networkidle")308 page.goto(url + "?theme=light&embed=1", wait_until="networkidle")
292 page.wait_for_function(309 page.wait_for_function(
293 "document.querySelectorAll('.tool').length == 5", timeout=15000)310 "document.querySelectorAll('.tool').length == 5", timeout=15000)
311+ stabilise(page)
294 page.screenshot(path=os.path.join(shots, "ui-embed-390-light.png"),312 page.screenshot(path=os.path.join(shots, "ui-embed-390-light.png"),
295 full_page=True)313 full_page=True)
296 ctx.close()314 ctx.close()
297315