Urgent.News

What's breaking now, across thousands of outlets.

Tech

GIMP now has UI tests

The GIMP program, known for its complex array of menus, dialogs, and tools, has implemented a new user interface (UI) testing platform. This advancement aims to catch potential interface issues early on, thereby preventing user-reported problems. A typical UI test involves starting GIMP, interacting with menus and buttons, and verifying the outcomes. These tests are executed automatically upon every contribution merge.

While GIMP already possesses unit tests, these focused on individual code segments like handling XCF files, they lacked the capability to open a real window. Consequently, they could not determine if dialogues open or if menu items perform their intended functions. In contrast to these unit tests, the new UI tests interact with the actual interface, thereby offering a more accurate representation of the program's behavior.

The UI tests are advantageous in several ways. Firstly, they operate independently of any screen display, starting a concealed desktop, executing GIMP within it, and removing it subsequently. This feature enables the tests to run on Continuous Integration (CI) servers, which typically lack a graphical interface. Secondly, the tests identify buttons and menus using accessibility information provided by GIMP to screen readers.

This not only aids in early bug detection but also enhances GIMP's accessibility for users relying on screen readers.

The UI tests are written in Python using a tool called Dogtail. To enable GIMP to run on a screen-less server, Dogtail required an upgraded feature, which the developers contributed upstream to Dogtail. Consequently, other projects can also benefit from this enhancement. Currently, the tests are operational only on Linux platforms (X11 and Wayland), as Dogtail does not support Windows or macOS.

The addition of these UI tests significantly boosts confidence in the GIMP's functionality post-build. It also demonstrates the effectiveness of the test infrastructure. The full change can be reviewed in merge request !2909. Although 13 tests are a solid starting point, GIMP comprises numerous more dialogs and tools. Interested contributors can assist by writing tests for their frequently used features in GIMP.

A guide detailing the process of creating a new test and troubleshooting test failures is available on developer.gimp.org. The developers hope this initiative will help identify bugs more promptly and maintain GIMP's optimal performance for all users.

Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at gimp.org →

More in Tech

Trading Strategy Backtest Results: How to Read Them

Trading strategy backtest results show how a set of rules would have traded on past prices. They do not show how the same rules will trade next month. A good backtest is a starting point for testing, not proof that a bot works.

More from Friday 20 November →