Dockerized Linux Desktop App Testing Environment — containerized GUI testing with Xvfb, noVNC, and PyAutoGUI automation
Find a file
hermes 0e995fe300
All checks were successful
CI / ci (push) Successful in 8m1s
ci: re-run via runner pickup verification
2026-09-26 20:06:50 -07:00
.forgejo/workflows fix(ci): pin ubuntu container, drop dead dep, repair Dockerfile + compose 2026-09-12 03:21:00 -07:00
examples gsd: pre-implementation lint/format cleanup 2026-05-26 21:54:45 -07:00
scripts init: project bootstrap from archive 2026-05-13 21:39:36 -07:00
testenv gsd: pre-implementation lint/format cleanup 2026-05-26 21:54:45 -07:00
tests gsd: pre-implementation lint/format cleanup 2026-05-26 21:54:45 -07:00
.gitignore scrub: never track .gsd/ — tool state per-machine 2026-05-19 15:06:54 -07:00
.pre-commit-config.yaml chore: add basic pre-commit hooks (trailing-whitespace, eof-fixer, ruff) 2026-06-03 17:28:36 -07:00
conftest.py Add unit tests for testenv package (#1) 2026-05-22 17:51:37 -07:00
docker-compose.yml fix(ci): pin ubuntu container, drop dead dep, repair Dockerfile + compose 2026-09-12 03:21:00 -07:00
Dockerfile fix(ci): pin ubuntu container, drop dead dep, repair Dockerfile + compose 2026-09-12 03:21:00 -07:00
entrypoint.sh Add health checks and runtime monitoring (#3) 2026-05-22 12:37:54 -07:00
pyproject.toml fix(ci): pin ubuntu container, drop dead dep, repair Dockerfile + compose 2026-09-12 03:21:00 -07:00
README.md docs: rewrite README with project overview, structure, and quick start 2026-05-13 21:45:22 -07:00
resolve-deps.py gsd: pre-implementation lint/format cleanup 2026-05-26 21:54:45 -07:00
SPEC.md init: project bootstrap from archive 2026-05-13 21:39:36 -07:00
supervisord.conf fix #6: Security hardening: non-root user, VNC password, seccomp 2026-05-19 09:38:35 -07:00

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 via apt-get, discover the binary with dpkg -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.