Dockerized Linux Desktop App Testing Environment — containerized GUI testing with Xvfb, noVNC, and PyAutoGUI automation
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| examples | ||
| scripts | ||
| testenv | ||
| tests | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| conftest.py | ||
| docker-compose.yml | ||
| Dockerfile | ||
| entrypoint.sh | ||
| pyproject.toml | ||
| README.md | ||
| resolve-deps.py | ||
| SPEC.md | ||
| supervisord.conf | ||
Kimi_Agent_App Testing Environment Setup
A Dockerized Linux Desktop App Testing Environment providing a containerized X11 desktop with automated GUI testing capabilities. Supports testing pre-built binaries, APT packages, AppImages, and applications built from source.
Tech Stack
- Base Image: Ubuntu 24.04 LTS
- Display: Xvfb virtual framebuffer + noVNC web access
- Automation: Python 3 with PyAutoGUI, AT-SPI2 accessibility APIs
- Build Tools: CMake, Meson, Ninja, build-essential
- Process Control: supervisord
- Container: Docker + Docker Compose
Getting Started
git clone https://forgejo.tail018ac4.ts.net/Mark/kimi_agent_app_testing_environment_setup.git
cd kimi_agent_app_testing_environment_setup
# Build the image
docker build -t testenv:latest .
# Or use Docker Compose (software rendering)
docker compose --profile nogpu up
# Access noVNC at http://localhost:6080/vnc.html
Project Structure
.
├── Dockerfile # Ubuntu 24.04 base with X11/automation stack
├── docker-compose.yml # Compose profiles: nogpu, virtualgl, hostgpu
├── entrypoint.sh # Container entrypoint + app deployment
├── supervisord.conf # Process manager (Xvfb, openbox, x11vnc, noVNC)
├── resolve-deps.py # Shared-library dependency resolver
├── testenv/ # Python automation package
│ ├── __init__.py
│ ├── automation.py # DesktopSession API (screenshots, clicks, typing)
│ ├── accessibility.py # AT-SPI2 tree introspection
│ ├── actionlog.py # JSON Lines action logger
│ ├── screenshot.py # Multi-backend screenshot capture
│ └── deploy/ # Deployment adapters
│ ├── __init__.py
│ ├── binary.py # Pre-built binary deployer
│ ├── apt.py # APT package deployer
│ ├── appimage.py # AppImage extractor
│ └── source.py # Auto-detect build system + compile
├── scripts/
│ ├── deploy-app # CLI wrapper for deployment adapters
│ └── testenv-shell # Interactive shell into running container
├── examples/
│ ├── test_binary.sh
│ ├── test_apt.sh
│ ├── test_appimage.sh
│ └── test_source.sh
├── SPEC.md # Full technical specification
└── plan.md # Generation plan
Scripts
| Command | Description |
|---|---|
docker build -t testenv:latest . |
Build the Docker image |
docker compose --profile nogpu up |
Run with software rendering |
docker run -p 6080:6080 testenv --binary /path/to/app |
Test a binary |
docker run -p 6080:6080 testenv --apt firefox |
Test an APT package |
docker run -p 6080:6080 testenv --appimage /path/to/AppImage |
Test an AppImage |
docker run -p 6080:6080 testenv --source /path/to/src |
Test from source |
Deployment Modes
The container supports four mutually exclusive deployment modes via CLI flags:
--binary <path>— Copy a pre-built executable, resolve shared-library deps--apt <package>— Install viaapt-get, discover the binary withdpkg -L--appimage <path>— Validate magic bytes, extract with--appimage-extract--source <path>— Auto-detect build system (CMake, Meson, Make, npm, Cargo) and compile
DesktopSession API
from testenv import DesktopSession
session = DesktopSession(display=":99")
session.launch_app("xclock", wait_for_window="xclock")
img = session.screenshot()
btn = session.find_element(name="Quit", role="push button")
if btn:
session.click(element=btn)
See SPEC.md for the complete API reference.