functional-tests build configuration here was set to run the Selenium-based tests with the assumption that a display is available to the user used to run the agent. This is not the case in most CI setups as the agents will be running in headless mode.
One strategy is to use a virtual display server, such as X virtual frame buffer (Xvfb). Xvfb makes it possible for agents that do not have a display to run apps that do require an X server to function correctly.