Urgent.News

What's breaking now, across thousands of outlets.

Tech

Screenshot testing a design system with Playwright and Docker

I work on the Koobiq design system, which has component libraries for React and Angular . in this article I'll show how the screenshot tests in our React library are set up and which decisions made running them and updating baselines easier. Problem in Koobiq React , the shared FormField wrapper is the base of every field: Input, Select, Textarea, DateInput and a dozen others. change its padding…

The author works on the Koobiq design system, which includes component libraries for React and Angular. Screenshots tests in the React library are set up using Playwright on top of Storybook. Each component gets a test story with variants and states, and one test takes a screenshot in both light and dark themes. Pixel precision is used, and tests fail on any changed pixel.

The environment is fixed, and screenshots are compared only inside a Docker image, both locally and in CI. Baselines are stored in Git, live next to the component in the same PR, and updating them is straightforward. Updating baselines doesn't require Docker; a simple comment on the PR regenerates them in CI and commits them to the branch.

The test grid consists of six variants by six states in each theme, totaling 72 combinations. Test 01 focuses on buttons with text and icons, while Test 02 and 03 cover icon-only buttons and buttons with text and icons on both sides, respectively. Shared helpers and environment live separately from tests and baselines, which are located in the component folder.

Playwright configuration sets the locale, time zone, disables animations, and sets a zero comparison threshold to ensure tests fail on any changed pixel.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Road to Golden Jacket

More than four years after passing the AWS Cloud Practitioner, learning and earning AWS certifications along the way, I finally achieved the Golden Jacket!

  • AI Practitioner certification focuses on AI, Machine Learning, and Generative AI concepts within AWS
  • Golden Jacket awarded after earning various AWS certifications in a single year

Waymo Says Its Self-Driving Cars Reduced Injury-Causing Accidents by 82%

Waymo's self-driving car technology "continues to outperform human benchmarks," the company claimed this week. "It was involved in 841 fewer injury-causing crashes — an 82% reduction compared to human…

  • Waymo's self-driving cars reduced injury-causing accidents by 82%
  • 841 fewer crashes resulted in injuries compared to human drivers
  • Significant decrease in accidents involving pedestrians, cyclists, and motorcyclists

More from Sunday 27 September →