| index 67a16ff..d3c1725 100644 |

| index 1dcfc7e..9d1512c 100644 |

| index 30afa1c..4ee74f6 100644 |

| index f9ccfed..7010bb8 100644 |

| index 1222003..71d72d9 100644 |

| index 0419add..94731f7 100644 |

| index 0419add..94731f7 100644 |

| index 29ea40e..7b2a688 100644 | ||
| --- a/plugin.json | ||
| +++ b/plugin.json | ||
| @@ -11,7 +11,7 @@ | ||
| 11 | 11 | "menus": false, |
| 12 | 12 | "verified": "mock", |
| 13 | 13 | "category": "devtools", |
| 14 | - "version": "1.0.1", | |
| 14 | + "version": "1.0.2", | |
| 15 | 15 | "license": "MIT", |
| 16 | 16 | "capabilities": [ |
| 17 | 17 | "outbound_https_github_rest_api", |
| index 69fd47f..e32a9fa 100644 | ||
| --- a/src/gh.h | ||
| +++ b/src/gh.h | ||
| @@ -44,7 +44,7 @@ | ||
| 44 | 44 | |
| 45 | 45 | #define GH_SLUG "github" |
| 46 | 46 | #define GH_ID "plugin_github" |
| 47 | -#define GH_VER "1.0.1" | |
| 47 | +#define GH_VER "1.0.2" | |
| 48 | 48 | #define GH_NAME "github" |
| 49 | 49 | #define GH_DESC "GitHub tools" |
| 50 | 50 |
| 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 / | ||
| 13 | 13 | * saving a token flips the pill, clears the password field, and never |
| 14 | 14 | echoes the token back into the DOM |
| 15 | 15 | * 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) | |
| 17 | 20 | |
| 18 | 21 | Skips cleanly (exit 0) when Playwright is missing, so the offline suite stays |
| 19 | 22 | dependency-free. |
| @@ -76,6 +79,21 @@ def start_mock(): | ||
| 76 | 79 | 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 | 97 | class Handler(http.server.BaseHTTPRequestHandler): |
| 80 | 98 | """Runs the binary as a CGI: env from the request, stdin from the body. |
| 81 | 99 | |
| @@ -213,6 +231,7 @@ def main(): | ||
| 213 | 231 | |
| 214 | 232 | # one committed screenshot per viewport + theme (the |
| 215 | 233 | # README's responsive story is told by these files) |
| 234 | + stabilise(page) | |
| 216 | 235 | page.screenshot( |
| 217 | 236 | path=os.path.join(shots, "ui-%dx%d-%s.png" % (w, h, theme)), |
| 218 | 237 | full_page=True) |
| @@ -280,8 +299,6 @@ def main(): | ||
| 280 | 299 | "document.getElementById('okline').textContent.indexOf('Saved') >= 0", |
| 281 | 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 | 302 | ctx.close() |
| 286 | 303 | |
| 287 | 304 | # small viewport screenshot for the responsive story |
| @@ -291,6 +308,7 @@ def main(): | ||
| 291 | 308 | page.goto(url + "?theme=light&embed=1", wait_until="networkidle") |
| 292 | 309 | page.wait_for_function( |
| 293 | 310 | "document.querySelectorAll('.tool').length == 5", timeout=15000) |
| 311 | + stabilise(page) | |
| 294 | 312 | page.screenshot(path=os.path.join(shots, "ui-embed-390-light.png"), |
| 295 | 313 | full_page=True) |
| 296 | 314 | ctx.close() |
| 297 | 315 |
| index 67a16ff..d3c1725 100644 | index 67a16ff..d3c1725 100644 |

| index 1dcfc7e..9d1512c 100644 | index 1dcfc7e..9d1512c 100644 |

| index 30afa1c..4ee74f6 100644 | index 30afa1c..4ee74f6 100644 |

| index f9ccfed..7010bb8 100644 | index f9ccfed..7010bb8 100644 |

| index 1222003..71d72d9 100644 | index 1222003..71d72d9 100644 |

| index 0419add..94731f7 100644 | index 0419add..94731f7 100644 |

| index 0419add..94731f7 100644 | index 0419add..94731f7 100644 |

| index 29ea40e..7b2a688 100644 | index 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", |
| index 69fd47f..e32a9fa 100644 | index 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 |
| index b356e9f..91998e5 100644 | index 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 never | 13 | * saving a token flips the pill, clears the password field, and never |
| 14 | echoes the token back into the DOM | 14 | echoes the token back into the DOM |
| 15 | * a bad api base surfaces the server's 400 message, not a silent no-op | 15 | * 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) | ||
| 17 | 20 | ||
| 18 | Skips cleanly (exit 0) when Playwright is missing, so the offline suite stays | 21 | 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, log | 79 | 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 (the | 232 | # 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 story | 304 | # 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() |
| 297 | 315 |