I need to write automated GUI tests for apps built with and running on OpenJDK 14 (Swing & JFX) on Catalina.
This is easy, but when the tests are running the windows pop up on my screen, taking focus and interrupting my work.
On Linux I use xvfb to create a new virtual display (say 99) and run my tests with the environment variable DISPLAY=:99
and all is good.
However, OpenJDK on OS/X no longer has X11 bindings, so it is not possible to target an X11 environment.
Is there a way to do the equivalent on OS/X? I was wondering about scripting the creation of a new Desktop, without making it the currently displayed one, and ensuring that it is used as the Desktop on which to launch the app, but I haven't worked out how.
Prior research: No answer to Is there a Mac-native equivalent of xvfb for running on a headless Mac server?
gw check
so that I get quicker feedback if I've broken a unit test or upset my linter.I can probably work around it by skipping the gui tests locally, but it would be nice if they ran.
– Robert Elliot May 06 '20 at 13:58(It's actually a bit more as I separate downloading dependencies in the dockerfile from doing the build, so that the build can be done offline, which adds another 14 seconds.)
– Robert Elliot May 06 '20 at 15:14~/.gradle
directory, otherwise it would have to redownload gradle & all the dependencies, which takes minutes. – Robert Elliot May 06 '20 at 18:51:99
, or they are not running as part of the gradle build.This means they run as part of the docker build, and they run if I run the test directly in the IDE, but are skipped when I do a local build, so no unexpected windows popping up and grabbing focus.
– Robert Elliot May 15 '20 at 20:07