frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Visual regression tests for personal blogs

https://marending.dev/notes/visual-testing/
32•beingflo•4d ago

Comments

Curiositry•4d ago
This is great.

I frequently break my site in ways that aren't obvious. Right now, I use a combination of visualping and a homebrew tests.sh that hits various endpoints and runs checks, but I have been meaning to integrate screenshoting into my tests script (via selenium or cutycapt) rather than relying on a hosted service.

Have you found a good way of diffing the screenshots? DiffPDF works pretty well, but I haven't found a good solution for checking whether there are relevant changes automatically, rather than just has-changed, in a way that could be integrated into a script.

beingflo•4d ago
I only use the built-in diffing by Playwright. It comes with a nice overview page [0] that shows all the failed tests including traces and screenshots. There you have a pixel diff. If you have some notion of irrelevant changes that shouldn't warrant a test failure, I wouldn't know of a way to pull that off.

[0] https://playwright.dev/docs/trace-viewer-intro#opening-the-h...

csomar•6h ago
If anyone is wondering what the test results look like, here is an example from my site: https://pub-1fbd8591bf7a40cea36fa130fb2ba6bc.r2.dev/playwrig...

I have these running in a CI/CD process, compare to previous commit. Results uploaded to R2. Few problems:

- Playwright regularly fails by timeout. This is flaky and go figure out what went wrong.

- You can do a matrix test (chrome/firefox/etc.) (mobile/tablet/etc.) but the problem is, you'll need to run these tests in parallel. The bare functional minimum is 16Gb vps with 4vcpu. For my test suite, it already take 20 minutes. If you want a larger matrix and have more pages, you'll be looking at a 64Gb with a dozen or so vpcus. That's hundreds of dollars a month...

- If you have an animation, it's a struggle to filter it out.

- From my knowledge, there is no "version slider" where you can go commit by commit and see how things changed.

- Playwright takes images and videos. These consumes a lot of data. Like Gbs of data for a few commits.

- Any of the managed solutions (like BrowserStack) costs hundreds of dollars.

Overall, I think it's great though a bit cumbersome to setup everything to work flawlessly and prevent from breaking every now and then. You can also do full flows (sigup-signin-do action-etc.. -> success/failure) which can test more than UI.

beingflo•3h ago
Thanks for the example of a Playwright report page. I agree that getting browser tests (not even just visual tests) to work reliably is considerable work. I built out a suite at work for a rather complex web application and it certainly looks easier than it is. A couple of notes:

- I disagree that you need a powerful VPS to run these tests, we run our suite once a day at midnight instead of on every commit. You still get most of the benefit for much cheaper this way.

- We used BrowserStack initially but stopped due to flakiness. The key to getting a stable suite was to run tests against a local nginx image serving the web app and wiremock serving the API. This way you have short, predictable latency and can really isolate what you're trying to test.

csomar•3h ago
> - I disagree that you need a powerful VPS to run these tests, we run our suite once a day at midnight instead of on every commit. You still get most of the benefit for much cheaper this way.

Then how do you know which commit is responsible for the regression? I can see that working for a very small team where the amount of changes is limited but even so, especially with css, where a change in some place can affect the styles in another.

beingflo•2h ago
We probably have max 50 commits a day in our team spread across many areas in the application. So when breakages occur it's typically easy to tell which commit caused it.

But I agree, if you have a large team or a large monorepo you probably want to know about breaking changes already at the PR stage.

kkarpkkarp•4h ago
> you have to first generate a screenshot by running your suite with --update-snapshots.

How is it executed? Is it something build in into the Playwright, or there is missing part of the code presented, responsible for executing it?

beingflo•3h ago
Ah forgot to mention it in the post. This comes built in by Playwright. Normally, you invoke the test suite by running `npx playwright test`. This fails your test if a screenshot is missing or if it differs. By running `npx playwright test --update-snapshots` you tell Playwright to just overwrite the snapshots and not fail tests.
OuterVale•4h ago
I'm familiar with TurnTrout's The Pond using visual regression testing as well: https://turntrout.com/design#visual-regression-testing

Gentoo Linux 2025 Review

https://www.gentoo.org/news/2026/01/05/new-year.html
58•akhuettel•2h ago•10 comments

C++ std::move doesn't move anything: A deep dive into Value Categories

https://0xghost.dev/blog/std-move-deep-dive/
128•signa11•2d ago•81 comments

"Food JPEGs" in Super Smash Bros. & Kirby Air Riders

https://sethmlarson.dev/food-jpegs-in-super-smash-bros-and-kirby-air-riders
51•SethMLarson•4d ago•5 comments

Think of Pavlov

https://boz.com/articles/think-pavlov
34•kiyanwang•2h ago•7 comments

The Concise TypeScript Book

https://github.com/gibbok/typescript-book
132•javatuts•8h ago•28 comments

Show HN: Is AI hijacking your intent? A formal control algorithm to measure it

6•daikikadowaki•28m ago•6 comments

Iran Shuts Down Starlink Internet for First Time

https://www.forbes.com/sites/zakdoffman/2026/01/11/kill-switch-iran-shuts-down-starlink-internet-...
59•neom•1h ago•23 comments

Vojtux – Unofficial Linux Distribution Aimed at Visually Impaired Users

https://github.com/vojtapolasek/vojtux
79•TheWiggles•4d ago•24 comments

More than one hundred years of Film Sizes

https://wichm.home.xs4all.nl/filmsize.html
48•exvi•5h ago•11 comments

BasiliskII Macintosh 68k Emulator Ported to ESP32-P4 / M5Stack Tab5

https://github.com/amcchord/M5Tab-Macintosh
6•rcarmo•1h ago•0 comments

Finding and fixing Ghostty's largest memory leak

https://mitchellh.com/writing/ghostty-memory-leak-fix
505•thorel•19h ago•109 comments

Show HN: I used Claude Code to discover connections between 100 books

https://trails.pieterma.es/
403•pmaze•21h ago•115 comments

'Bandersnatch': The Works That Inspired the 'Black Mirror' Interactive Feature (2019)

https://www.hollywoodreporter.com/tv/tv-news/black-mirror-bandersnatch-real-life-works-influences...
55•rafaepta•5d ago•23 comments

CPU Counters on Apple Silicon: article + tool

https://blog.bugsiki.dev/posts/apple-pmu/
112•verte_zerg•4d ago•0 comments

Code and Let Live

https://fly.io/blog/code-and-let-live/
368•usrme•1d ago•129 comments

Show HN: Ferrite – Markdown editor in Rust with native Mermaid diagram rendering

https://github.com/OlaProeis/Ferrite
192•OlaProis•12h ago•109 comments

Google: Don't make "bite-sized" content for LLMs

https://arstechnica.com/google/2026/01/google-dont-make-bite-sized-content-for-llms-if-you-care-a...
16•cebert•1h ago•11 comments

A Year of Work on the Arch Linux Package Management (ALPM) Project

https://devblog.archlinux.page/2026/a-year-of-work-on-the-alpm-project/
79•susam•11h ago•24 comments

Open Chaos: A self-evolving open-source project

https://www.openchaos.dev/
391•stefanvdw1•21h ago•80 comments

Max Payne – two decades later – Graphics Critique (2021)

https://darkcephas.blogspot.com/2021/07/max-payne-two-decades-later-graphics.html
79•davikr•10h ago•24 comments

AI is a business model stress test

https://dri.es/ai-is-a-business-model-stress-test
281•amarsahinovic•21h ago•267 comments

Overdose deaths are falling in America because of a 'supply shock': study

https://www.economist.com/united-states/2026/01/08/why-overdose-deaths-are-falling-in-america
170•marojejian•18h ago•144 comments

Show HN: Play poker with LLMs, or watch them play against each other

https://llmholdem.com/
134•projectyang•18h ago•69 comments

Show HN: Librario, a book metadata API that aggregates G Books, ISBNDB, and more

115•jamesponddotco•14h ago•39 comments

HTML-only conditional lazy loading (via preload and media)

https://orga.cat/blog/html-conditional-lazy-loading/
6•netol•2h ago•1 comments

Verifiable Brute Force Strength

https://gist.github.com/atoponce/a7715930ae6eb7d6b487f2f76b57a68d
4•upofadown•5d ago•1 comments

An Experimental Approach to Printf in HLSL

https://www.abolishcrlf.org//2025/12/31/Printf.html
30•ibobev•4d ago•2 comments

LLM poetry and the "greatness" question: Experiments by Gwern and Mercor

https://hollisrobbinsanecdotal.substack.com/p/llm-poetry-and-the-greatness-question
13•networked•1h ago•0 comments

Show HN: I built an Open Source screen timer for the m5stickc (Arduino)

https://partridge.works/screenie-christmas-project-2025-26/
9•urbandw311er•5d ago•0 comments

A battle over Canada’s mystery brain disease

https://www.bbc.com/news/articles/c623r47d67lo
167•lewww•9h ago•114 comments