Test web pages with Python, Chromium, Google Chrome, axe, and Lighthouse.
116
Test web pages with Python, Chromium, Google Chrome, axe, and Lighthouse.
This image provides:
Use it for browser tests, behaviour tests, and accessibility checks. The working
directory is /workspace. The default command starts Bash. The image includes
Chromium and Chrome; Firefox and WebKit need a separate installation.
| Tag | Meaning | Platform |
|---|---|---|
latest | Latest successful build from main. | linux/amd64 |
View all tags on Docker Hub.
The latest tag changes when a new build passes its tests.
docker pull stden/web-qa:latest
Run these commands from your project directory. Give 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.
Replace https://example.com with the page to test. Reports are saved 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
These commands run Chrome without its sandbox in a disposable container. Use
them for pages you control. Inside the container, localhost refers to the
container. Use a Docker network and a service name to reach another container.
The smoke test opens a local page in Chromium and Chrome. It also runs pytest, Behave, axe, and a Lighthouse accessibility check.
Content type
Image
Digest
sha256:80b2c5a88…
Size
1.2 GB
Last updated
about 15 hours ago
docker pull stden/web-qa