SShortSingh.
Back to feed

Playwright --update-snapshots can overwrite a good baseline with an unstable frame and still pass

0
·2 views

A Playwright issue, #44128, reports that running snapshot updates on a page that never becomes visually stable can replace a correct baseline with a random frame while the test passes. The author reproduced this in tests across Playwright versions 1.40.0 to 1.65.1, using pages with a CSS animation, a JavaScript animation, and a live clock. With the update flag, every run on the moving pages passed and overwrote the baseline, and the next normal run then failed, while runs without the flag failed as expected. Masking the moving element did not prevent the problem for the animation, but masking its container did. The behavior traces to toHaveScreenshot, which writes the last captured frame as the baseline on any error when updating, without checking the error type. The author has published the proof-of-concept code and results.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

AMARACUS 2026 hackathon offers GTA 6 or $100 for best post-quantum crypto app

The AMARACUS Cryptographic Innovation Hackathon 2026 invites developers to build projects that call the company's API, with the top entry winning a copy of Grand Theft Auto VI or $100 in cash, at the winner's choice. Eligible projects span encrypted chat apps, database encryption plugins, enterprise key-management tools, and post-quantum features such as ML-KEM-768 key exchange. Participants may enter solo or in teams of up to three and must be at least 13 years old. Submissions require a public GitHub repository or Drive archive whose code genuinely uses the API, with entry requiring a paid AMARACUS plan starting at $2 per month. The deadline is December 15, 2026, at 23:59 UTC, and full rules are published on the company's website.

0
ProgrammingDEV Community ·

Static analysis finds null-check and memory leak bugs in GmSSL cryptographic library

A reader suggested examining GmSSL, an open-source C cryptographic library from Peking University that implements China's SM2/SM3/SM4/SM9 standards and TLCP and TLS protocols. A PVS-Studio analysis found no especially critical bugs, but it did flag common errors. In one case, a connection pointer is dereferenced before being checked for null, which should be validated at the start of the function. Several test functions also exit early on allocation failure without freeing previously allocated buffers, causing memory leaks. The report notes that these are familiar mistakes that remain problematic despite being routine.

0
ProgrammingDEV Community ·

Why Overbuilt Signup Forms Drive Users Away

Signup flows are often treated as a design issue, but the real problem is usually that the form asks for too much too early. Many forms request extra details like company size, role, and phone number before the user has any reason to stay. Friction such as password rules revealed only after an error, confirm-password fields, and late email verification adds to the drop-off. The article argues that each unnecessary field erodes trust and that data can be collected later, in context. It recommends reducing signup to minimal essentials, such as email alone or email with a password.

0
ProgrammingDEV Community ·

Securing an AI agent that holds a payment card: key failure modes and design fixes

Giving an AI agent a payment card creates risks beyond simple overspending, and the article lists several failure modes to plan for. Card details should never be passed to the model, since they can leak through logs, traces, or exported datasets; instead, a server-side tool should complete checkouts and return only a status and reference ID. Because agents can be manipulated by untrusted web content, spending limits and merchant restrictions should be enforced by the card issuer and tool code rather than the system prompt. Retries after timeouts can cause duplicate charges, so payments need idempotency keys tied to the task step and a ledger check before paying. Cards should also be scoped to individual tasks and closed afterward, with recurring billing given separate, owned cards.