There are a number of different approaches to this, all them involve running the program and associated infrastructure under a virtual display servers. For X11 there is a virtual server called DebianMan:Xvfb. For Wayland DebianMan:sway with WLR_BACKEND=headless might be useful. Or the KDE KWayland test server might be useful too, DebianPackage:libkf5wayland-dev has a program /usr/lib/x86_64-linux-gnu/libexec/org-kde-kf5-kwayland-testserver <> = Approaches = == Accessibility infra == === Selenium === [[https://invent.kde.org/sdk/selenium-webdriver-at-spi|selenium-webdriver-at-spi]] (not in Debian yet) can be [[https://apachelog.wordpress.com/2022/12/14/selenium-at-spi-gui-testing/|used]] to [[https://invent.kde.org/sdk/selenium-webdriver-at-spi/-/wikis/writing-tests|write tests]] that use selenium to talk to the AT-SPI accessibility infrastructure in order to control and test programs. Tests that use Selenium can be written in several different languages. === Dogtail === [[DebianPackage:dogtail]] talks to the AT-SPI accessibility infrastructure in order to control and test programs. Tests that use Dogtail are written in Python and can control GTK and KDE/Qt programs. Example tests are [[https://gitlab.com/dogtail/dogtail/-/tree/master/examples/|available]]. == Input/output == DebianMan:xdotool can be used send input (keyboard, mouse) and window manager actions to X11 windows. DebianPackage:imagemagick DebianMan:convert can extract pixels and then the test can analyse them. Example tests are in [[https://sources.debian.org/src/bambam/latest/debian/tests/|src:bambam]]. = See also = * [[https://open.qa/|openQA]] ([[https://openqa.debian.net/|Debian instance]])