Skip to content

Grommash9/playwright_vnc

Repository files navigation

Playwright VNC Docker

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.

Features

  • 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

Quick Start

  1. Pull the Docker image:
docker pull prudnikov21/playwright_vnc:latest
  1. Start the container:
docker-compose up --build

Running Tests

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

VNC Client Setup

Linux

Install TigerVNC viewer:

sudo apt-get install tigervnc-viewer

Connect using:

vncviewer localhost:13901

Windows

  1. Download and install TightVNC Viewer

  2. During installation, use Custom Setup to deselect the VNC Server component - you only need the viewer for connecting to the Docker container.

TightVNC Custom Setup TightVNC Remote Server Option

  1. After installation completes, launch TightVNC Viewer from the Start menu

TightVNC Run Viewer

  1. Enter 127.0.0.1::13901 as the remote host address and click Connect

TightVNC Connect to host

  1. You should now see the Docker container's display: TightVNC Vnc Connect Screen

  2. You can now run Playwright tests in headed mode or use the record feature: TightVNC Using record mode

Environment Variables

  • DISPLAY: X11 display configuration (default: :99)
  • PYTHONUNBUFFERED: Python output buffering (default: 1)

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published