Sign inSign up
web-qa logo

stden/web-qa

By stden

•Updated 1 day ago

Test web pages with Playwright, Chrome, axe, and Lighthouse in a multi-stage Python image.

Image
Languages & frameworks
Integration & delivery
Developer tools
0

1.5K

stden/web-qa repository overview

⁠stden/web-qa

Test web pages with Playwright, Chrome, axe, and Lighthouse in a multi-stage Python image.

⁠What you learn

  • How a multi-stage build uses COPY --from to merge Node.js tools into a Python base image
  • Why security upgrades run after Playwright: Playwright adds its own apt packages first
  • How PLAYWRIGHT_BROWSERS_PATH controls where Playwright stores its browser download
  • How DETECT_CHROMEDRIVER_VERSION=true matches ChromeDriver to an installed Chrome version

⁠Overview

This image contains:

  • Python, uv, pytest, Behave, Playwright, and pytest-playwright.
  • Chromium that matches the installed Playwright package.
  • Google Chrome and the ChromeDriver that axe uses.
  • Node.js, npm, the axe CLI, and Lighthouse.

Use it for browser tests, behavior tests, and accessibility checks. The working directory is /workspace. The default command starts Bash. The image includes Chromium and Chrome. For Firefox and WebKit, a separate installation is necessary.

⁠Tags

TagMeaningPlatform
latestLatest successful build from main.linux/amd64

View all tags on Docker Hub⁠. The latest tag changes when a new build passes its tests.

⁠Pull the image

docker pull stden/web-qa:latest

⁠Run project tests

Run these commands from your project directory. Give the browser tests shared memory with --shm-size=1g.

docker run --rm --shm-size=1g -v "$PWD":/workspace \
  stden/web-qa:latest pytest

docker run --rm --shm-size=1g -v "$PWD":/workspace \
  stden/web-qa:latest behave

Install extra project dependencies in a child image. Keep the installed Playwright package and its browser revision together. If you change the package version, run python -m playwright install --with-deps chromium in that build.

For Python Playwright code, use playwright.chromium.launch() for Chromium. Set channel="chrome" to use Google Chrome.

⁠Check accessibility

Replace https://example.com with the page to test. The commands save the reports to the mounted project directory.

docker run --rm --shm-size=1g -v "$PWD":/workspace stden/web-qa:latest \
  axe https://example.com --exit \
  --chrome-options="no-sandbox,disable-dev-shm-usage,remote-debugging-pipe" \
  --save axe.json

docker run --rm --shm-size=1g -v "$PWD":/workspace stden/web-qa:latest \
  lighthouse https://example.com --only-categories=accessibility \
  --chrome-flags="--headless --no-sandbox --disable-dev-shm-usage" \
  --output=html --output-path=lighthouse.html

Use these commands only for pages that you control. They run Chrome without its sandbox in a disposable container. Inside the container, localhost is the container itself. Use a Docker network and a service name to connect to another container.

⁠Source and checks

The smoke test opens a local page in Chromium and Chrome. It also runs pytest, Behave, axe, and a Lighthouse accessibility check.

Tag summary

Content type

Image

Digest

sha256:0dcfe5764…

Size

1.3 GB

Last updated

1 day ago

docker pull stden/web-qa