Recommended Free Tools
For repeatable Playwright screenshots in Docker, pin a Playwright image and use the same Playwright version in your project; if you build your own image, install the matching browsers and their system dependencies. Add and verify the fonts your application needs, wait for web fonts before capturing, and generate and review baselines in the same environment you use for comparison. Docker reduces environment differences, but it does not make screenshots identical across operating systems, browser versions, settings, hardware, power sources, or headless modes.
How to run Playwright screenshot tests in Docker
The simplest setup is Playwright’s published Docker image, which includes browser binaries and browser system dependencies. It does not include your project’s Playwright package, so install that dependency separately and keep its version aligned with the image. Playwright recommends pinning an image to a specific version; tags and supported variants change, so check the current Docker documentation when choosing one.
Use the official Playwright image
For example, a project using Playwright 1.63.0 could use the corresponding published image tag, such as mcr.microsoft.com/playwright:v1.63.0-noble. This is a version-specific example, not a recommendation to use that version indefinitely. The image variants documented include Ubuntu 24.04 (Noble), 22.04 (Jammy), and 26.04 (Resolute); verify that the tag you need is still published. Install your project dependencies in the image:
FROM mcr.microsoft.com/playwright:v1.63.0-noble
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
CMD ["npx", "playwright", "test"]
Replace the image version with the Playwright version used by the project. The image supplies browser binaries and system dependencies, not the Playwright package; npm ci installs the package version pinned in the lockfile. Official images are intended for testing and development, not for visiting untrusted websites.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Build a custom Linux image
A custom base image gives you control over the operating system and installed software, but you must install a compatible Playwright package, browser binaries, and browser system dependencies. For a Node.js project, the documented pattern is:
FROM node:22-bookworm
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npx -y playwright@1.63.0 install --with-deps
CMD ["npx", "playwright", "test"]
Use the Playwright version appropriate to your project rather than copying 1.63.0 blindly. The CLI installs browsers compatible with that release and, with --with-deps, the browser system dependencies. Without browser names, the install command installs Playwright’s default browsers; supply a browser name when you only need a subset. For example, run npx playwright install chromium to install Chromium. Keep the package and browser-install versions matched.
Playwright’s Firefox and WebKit builds target glibc; Alpine and other musl-based distributions are unsupported for those browsers. If choosing a custom base, use a supported Linux distribution for the browser projects you intend to run.
Choose browsers and screenshot baselines deliberately
Playwright supports Chromium, Firefox, and WebKit, as well as branded Chrome and Edge and device emulation. A screenshot from one browser or platform is not automatically an appropriate baseline for another: rendering may differ, so configure separate projects and baselines for the combinations you need to support.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Playwright Test’s toHaveScreenshot() captures a baseline on first execution and compares later captures against it. It waits for two consecutive screenshots to match before saving the initial reference. PNG is the default snapshot format; the visual-comparisons guide also supports lossless WebP. In a multi-project configuration, the project identity can be reflected in snapshot naming.
Example visual test
import { test, expect } from '@playwright/test';
test('home page visual baseline', async ({ page }) => {
await page.goto('http://app:3000');
await page.evaluate(() => document.fonts.ready);
await expect(page).toHaveScreenshot('home.png');
});
Run the test with npx playwright test. The first run creates the expected screenshot; subsequent runs compare against it. The document.fonts.ready wait helps ensure page-loaded web fonts are ready before capture, but it does not install missing system fonts in the container.
Update snapshots intentionally
When a visual change is expected, inspect the differences and update the reference deliberately with:
npx playwright test --update-snapshots
Keep snapshot directories under version control and review baseline changes alongside code changes. Generate and compare references using the same image, browser, and relevant settings to reduce accidental drift.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Install and verify fonts in the container
Fonts affect text metrics, line breaks, glyph shapes, and therefore screenshot output. Playwright’s visual-testing documentation identifies fonts as a source of screenshot differences. The official Docker documentation does not promise a definitive inventory of font families in published images, so do not assume a container has the fonts installed on a developer workstation.
Make font availability explicit
- List the fonts your application depends on, including any licensed or project-specific font files.
- Install or copy those fonts into the image using your distribution’s supported method, then run a build step that refreshes the font cache if required by that distribution.
- Verify the font is available inside the exact image used in CI, rather than relying on what is installed on the host.
- Wait for application web fonts to finish loading before the screenshot assertion, for example with
await page.evaluate(() => document.fonts.ready).
The precise font-install commands depend on the selected base distribution and the font’s licensing and packaging. Check the image itself and explicitly provision the fonts your app requires; installing browser system dependencies alone is not evidence that a particular application font is present.
Run Docker safely and reliably in CI
Playwright recommends starting containers with --init. For Chromium, it advises --ipc=host because Chromium can otherwise run out of memory and crash. A basic invocation for a project image is:
docker run --rm --init --ipc=host -v "$PWD:/app" -w /app my-playwright-image npx playwright test
For local Chromium launch problems, Playwright’s Docker guide suggests trying --cap-add=SYS_ADMIN. Treat that as a troubleshooting option, not a default permission to add to every container.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
CI installation and worker settings
The standard CI sequence is to install project dependencies, install Playwright browsers and dependencies, then run tests. With a custom image, the browser installation can happen during the image build; with a general runner, install it in the job using the CLI and a version matching the project. The Playwright CI guide recommends one worker for stability and reproducibility. Stronger self-hosted runners can use parallel execution or sharding when throughput matters, while accounting for the additional resource use and keeping the environment consistent.
Playwright does not recommend caching browser binaries in CI because restoring them can take about as long as downloading them, and Linux OS dependencies cannot be cached as browser files. If you do cache browser binaries, key the cache to the Playwright version so a package upgrade does not reuse incompatible executables.
Container security context
The official image runs as root by default, which disables Chromium sandboxing. Playwright says this can be acceptable for trusted end-to-end tests. For untrusted crawling or scraping, use a separate user and a seccomp profile as described in its Docker guidance; do not treat the test-container default as suitable for every workload.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Why Playwright screenshots differ in CI
A container makes the runtime easier to pin, but it does not erase all rendering differences. Playwright identifies these factors as possible causes of screenshot variation:
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesBest Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
- Host operating system and platform.
- Browser version.
- Browser and screenshot settings.
- Hardware and power source.
- Headless versus headed mode.
- Fonts available to the browser, including application web fonts that have not loaded.
To diagnose drift, first compare the image tag and Playwright package version, browser project, launch and screenshot settings, and font availability between baseline generation and CI. Then examine whether the page has settled before capture, including whether web fonts and dynamic content are ready. If you intentionally run more than one browser or platform, maintain and review the corresponding baselines rather than expecting them to match one another.
Official image or custom base image?
| Approach | What it provides | What you must manage | Best fit |
|---|---|---|---|
| Official Playwright image | Browser binaries and browser system dependencies. | Install the project Playwright package and keep its version aligned with the image; verify project-specific fonts. | A direct path to a supported browser test environment. |
| Custom base image | Control over the base operating system and image contents. | Install the Playwright package, matching browsers, system dependencies, and application-required fonts. | Projects with specific base-image, system-package, or font requirements. |
For either approach, use the same environment for baseline creation and comparison when repeatability matters. Broad browser and platform coverage is useful, but it normally means maintaining distinct expected images for the combinations you test.
Troubleshoot common Docker screenshot failures
| Symptom | Likely cause | What to do |
|---|---|---|
| Playwright cannot find a browser executable | The project package and image/browser install versions do not match, or the browser was not installed. | Align the image and package versions; in a custom image, run npx playwright install --with-deps with the project’s matching version. |
| Firefox or WebKit does not run on the base image | The distribution uses musl, as Alpine does, rather than glibc. | Use a glibc-based supported image for those browser builds. |
| Chromium exits or crashes in Docker | It may lack shared memory, dependencies, or an appropriate container setup. | Use --init --ipc=host; if an unusual local launch issue remains, try --cap-add=SYS_ADMIN as the Docker guide suggests. |
| Text wraps differently or glyphs change | A required font is absent, a fallback font is being used, or a web font was not ready. | Verify and install the required font in the container, then wait for document.fonts.ready before capture. |
| Snapshots change across CI and local runs | The image, browser, OS, settings, hardware, power conditions, or headless mode differ. | Compare those variables and generate/compare baselines in a consistent environment; keep separate baselines where browser or platform coverage requires them. |
| CI runs are unstable under parallel load | Resource contention can affect repeatability. | Start with the CI guide’s recommended one worker; use parallelism or sharding only when runner capacity and project needs justify it. |
| A cached browser install is incompatible after an upgrade | The cache key does not include the Playwright version. | Key browser caches by Playwright version or reinstall the browsers for the package version in use. |
Or skip the browser setup
If your goal is to capture a page rather than run Playwright visual assertions in a controlled browser environment, ScreenshotNeo offers a screenshot API and MCP server. For an API capture, see the ScreenshotNeo API documentation:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo removes cookie/consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. Its MCP server lets AI agents use screenshot tools, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. This is a page-capture service, not a replacement for Playwright’s test assertions and version-controlled visual baselines. Sign up for free.
Frequently Asked Questions
Can Docker guarantee identical Playwright screenshots on every machine?
No. A pinned container helps control the environment, but host, browser, settings, hardware, power source, and headless mode can still affect rendering.
Does Playwright’s official Docker image include Playwright Test?
No. It includes browser binaries and their system dependencies; install the Playwright package in your project separately.
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.

