Docker image for running Playwright tests with VNC support, allowing both headless execution in CI/CD and headed mode for local development/debugging. Particularly useful for Windows + WSL users who want to avoid complex local Playwright setup.
- Pre-installed Playwright with Chrome, Firefox, and WebKit browsers
- VNC server for visual access to browser sessions
- Support for both headless (CI/CD) and headed (local development) modes
- Test recording capability through VNC
- Volume mounting for local test development
- Pull the Docker image:
docker pull prudnikov21/playwright_vnc:latest
- Start the container:
docker-compose up --build
Execute tests in headed mode:
docker-compose exec playwright-python pytest tests/test_example.py --headed -v
Record new test by interacting with the browser through VNC:
docker-compose exec playwright-python python -m playwright codegen --target python -o tests/test_example.py
Install TigerVNC viewer:
sudo apt-get install tigervnc-viewer
Connect using:
vncviewer localhost:13901
-
Download and install TightVNC Viewer
-
During installation, use Custom Setup to deselect the VNC Server component - you only need the viewer for connecting to the Docker container.
- After installation completes, launch TightVNC Viewer from the Start menu
- Enter 127.0.0.1::13901 as the remote host address and click Connect
DISPLAY
: X11 display configuration (default::99
)PYTHONUNBUFFERED
: Python output buffering (default:1
)