Set the browser’s color scheme to dark, capture an approved baseline, and compare later screenshots against it. Playwright Test can do this with toHaveScreenshot(); reliable results depend on keeping the browser and capture conditions consistent and reviewing differences before updating the baseline.
Set up a dark-mode visual regression test
Playwright’s colorScheme option emulates the browser’s preferred color scheme. Use it to test pages that respond to the system preference. If the site also has its own theme toggle, set that control to the intended state in your test; media emulation alone does not operate a site-specific toggle.
As an Amazon Associate I earn from qualifying purchases.
Configure dark mode for a project
In playwright.config.ts, set colorScheme in the project’s use options:
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →import { defineConfig } from '@playwright/test';
export default defineConfig({
use: {
colorScheme: 'dark',
},
});
This makes the dark preference part of that project’s browser context. If you need both light and dark coverage, define separate projects with different colorScheme values rather than relying on whichever preference happens to be active on the machine running the test.
#1 Best Overall
- CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
- WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
- A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
Set dark mode for one test or page
For a focused test, configure the browser context or emulate the preference before navigation:
import { test, expect } from '@playwright/test';
test('homepage renders in dark mode', async ({ browser }) => {
const context = await browser.newContext({ colorScheme: 'dark' });
const page = await context.newPage();
await page.goto('https://example.com');
await expect(page).toHaveScreenshot('homepage-dark.png');
await context.close();
});
Alternatively, with an existing page, call await page.emulateMedia({ colorScheme: 'dark' }) before the page’s relevant rendering and screenshot assertion. The supported color-scheme values documented by Playwright are light and dark.
Rank #2
- CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
- 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
- SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
- INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
- THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
Create and maintain the baseline
A baseline is the approved reference image for a particular screenshot assertion. On its first run, Playwright creates the reference screenshot; later runs compare the current capture with that reference. The screenshot assertion and baseline workflow are documented in Playwright’s visual comparisons documentation.
- Choose the pages, viewport sizes and interaction states where dark appearance matters.
- Run the test in the selected environment to create the initial reference image.
- Review the image. Confirm that the page is genuinely in the intended dark state and that the capture is representative before treating it as approved.
- Run the same test on subsequent changes and inspect any reported visual difference.
- Update the reference only after deciding that the new appearance is intentional. Playwright documents snapshot updating; review the diff before accepting it so an accidental regression does not become the expected result.
Keep the baseline files with the test project and version-control them when using Playwright’s documented baseline workflow. A baseline is meaningful only in relation to the state and capture conditions used to create it.
Rank #3
- Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
- Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
- Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
- In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
- Ultra-thin bezels: Maximize your viewing experience with thin bezels.
Keep dark-mode comparisons stable
Pixel differences do not always mean your CSS changed. Microsoft Playwright warns that “Browser rendering can vary based on the host OS, version, settings, hardware, power source (battery vs. power adapter), headless mode, and other factors.” See its official visual comparisons documentation.
- Use a consistent environment: run baseline creation and later comparisons with the same operating system, browser version, settings and headless mode where practical.
- Make the state explicit: set
colorScheme: 'dark'in configuration or context, rather than inheriting a developer machine’s preference. - Control viewport and interactions: use the same viewport and perform the same actions before capturing. Include separate assertions for distinct page states that matter.
- Handle volatile content deliberately: timestamps, rotating content and animations can cause noisy diffs. Playwright’s screenshot assertion supports
stylePathfor injecting a stylesheet that can hide or neutralize dynamic elements. - Choose thresholds carefully: the assertion API exposes a perceived color-difference threshold and a maximum differing-pixel option. Understand what changes each setting tolerates before raising it; excessive tolerance can hide a real dark-mode defect.
For example, a test can point the assertion at a stylesheet that hides a changing timestamp. Keep that stylesheet limited to content that is genuinely irrelevant to the visual check; do not hide theme colors, contrast, layout or other behavior the test is supposed to protect.
Rank #4
- CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
- SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
- MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
- KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
- INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient
Choose native Playwright or hosted review
Native screenshot assertions keep capture and comparison in the Playwright test project. Hosted services may be a better fit when a team needs shared cloud review, but their integration details and commercial terms should be checked against current vendor documentation.
Free tools Windows power users keep installed
One-click scans. No signup required.
| Approach | Where comparison and review happen | Documented capture or noise controls | What to check for your team |
|---|---|---|---|
| Playwright Test | Reference snapshots in the test project; subsequent test runs compare against them. | Dark color-scheme emulation, screenshot assertion thresholds, and stylesheet injection through stylePath. |
Environment consistency, baseline ownership, review process, and CI workflow. |
| Chromatic with Playwright | Chromatic describes cloud snapshot generation and visual review. | Its documentation describes varying snapshots by browser, theme, viewport and other configuration. Its Playwright path describes integration with Playwright test utilities and a Storybook archive step. | Confirm the required project setup, capture matrix, permissions, usage limits and current pricing. These capabilities are vendor-described, not independently tested here. |
| Percy with Playwright | Percy documents page snapshots through its Playwright client. | Its client documentation includes full-page capture and ignored regions. | Confirm that its current integration and review workflow fit the project, and check current pricing and limits directly. |
Pricing and plan limits for Chromatic and Percy are not established here. Compare where baselines live, how reviewers approve changes, required CI or project steps, browser/theme/viewport coverage, and how volatile regions are handled before choosing a hosted workflow. Documentation is not a substitute for confirming present-day product behavior and terms.
Best Value
- 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
- 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
- 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
Or skip the browser setup
For a one-off screenshot or a capture pipeline that does not need your own Playwright baseline machinery, ScreenshotNeo is a website screenshot API and MCP server. It can return a PNG, JPEG, WebP or PDF from one GET request. Its clean-shot handling accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits cost nothing, with the outcome reported in X-Page-Verdict and X-Billed headers. It also offers an MCP server for AI agents, with take_screenshot, get_page_info and capture_pdf.
For dark-mode capture, request the target URL and set the capture’s browser color scheme using the API’s supported parameters described in the ScreenshotNeo documentation. The documentation is the place to confirm the exact parameter syntax for a given capture. A screenshot API capture is not a replacement for a version-controlled Playwright visual assertion when you need to compare a new render with an approved baseline and review a diff.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo’s free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Sign up for the free plan.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Troubleshoot dark-mode screenshot differences
- The capture looks light: confirm the test context uses
colorScheme: 'dark'or thatpage.emulateMedia({ colorScheme: 'dark' })runs before capture. If the site has a manual theme switch, interact with that site-specific control as well. - Every run produces noisy diffs: compare the browser, operating system, viewport and headless settings with those used for the baseline. Identify volatile elements and use a narrowly scoped screenshot stylesheet where appropriate.
- A threshold hides a visible regression: lower or remove the tolerance and inspect the changed pixels. Thresholds are noise controls, not proof that a changed appearance is harmless.
- The baseline changes unexpectedly: inspect the diff and test state before updating snapshots. Verify that the new image reflects an intentional design change, not a missing dark preference or altered capture conditions.
- The site’s toggle does not follow system preference: media emulation only sets the browser preference; it does not determine how a particular site’s own toggle is implemented. Set the toggle in the test using the site’s actual behavior.
Frequently Asked Questions
Does Playwright emulate dark mode without changing my operating system setting?
Yes. Set the browser context’s colorScheme to dark, or use page.emulateMedia({ colorScheme: 'dark' }) for a page.
Should I keep dark and light baselines separately?
Yes, if both appearances are part of the behavior you need to protect. Treat each color scheme as a distinct test state with its own approved reference.
Does a screenshot API automatically perform a visual regression comparison?
A capture endpoint returns an image; a regression workflow also needs a reference image, a comparison step and a way to review differences. Check the service documentation for the specific workflow you need.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Recommended Free Tools




