We have a Mac os x server (10.10.3) we use to run functional tests with Jenkins.
We would like to use (in our tests) a tool/lib (sikulix for information) which uses under the hood java.awt.Robot class -java.awt.GraphicsEnvironment-. The problem is : we can't use this java class in headless env, because it needs to have access to a GUI.
So I would like to know if there was a solution/hack to make this tool works with jenkins.
Considering we have an USB-HDMI simulator (mac headless accelerator) which simulates a display attached.
We have also Xquartz, X11, xauth installed so I thought it would have bypassed this java headless restriction, by forcing the java.awt.headless property to false, and by using an X window, but it's not the case.
Correct me if I'm wrong : we don't need to have a real screen to do that, it's the goal of a display emulator/simulator; isn't it?
What I've tried successfully to use this lib in our tests:
use it on desktop (with monitor, ofc it works)
use screen sharing between remote mac server machine A and local mac desktop machine B (by executing the script in terminal of this screen sharing) vnc?
with ssh -Y on my linux computer(client) which was also the server of a X Window System (X11) app : it has worked doing a X11 forwarding without any ssh config changes (-Y flag). java.awt.headless=false was useful here
But I can't really tell if this last solution was useful. Though I've executed the script via ssh, I had a screen connected : it might have influence something .
(Keep in mind the final goal is to execute the tests with jenkins).
It led me to this try : execute the script via ssh with -Y flag or by modifying ssh_config/sshd_config files (access to the mac -remote server-) with screen sharing active, but it doesn't automatically recognized X-window :(
Here my questions :
Would the xvfb plug-in (jenkins) be sufficient to do what we want? I don't know how to configure it yet.
Could it be possible to do a X11forwarding from mac server (script executed with jenkins as daemon/agent; including maybe a ssh -Y connexion, I don't know yet how to make it to work) to the screen shared ?-which is also the server.... don't know why it can't recognize it- .
Yeah I know, this question is strange but my brain is burning and I'm getting confused...
By the way I would prefer to do everything really headless, but if it's not possible and I have to use the screen sharing, I'm fine.
Currently I'm really wondering if it is possible to launch a GUI application which needs X11 -on mac- in an headless environment... I thought the answer was yes with the correct installations, but apparently it's not that simple... or I must don't understand something correctly.
For X11 forwarding, I have the $DISPLAY var set, but I still get
Error: Can't open display 'address'
Even if I set the display to local, remote, or address, I'm still blocked by the lib with GUI access.
Another solution could be to attach terminal sessions (screen sharing terminal/terminal launching the script), I will try tomorrow with tmux. I still find strange that the server can't detect its shared session (I wanted to say it another time !).... There is an opened screen dude :s
With xvfb :
export DISPLAY=:1
Xvfb :1 &
Then mvn command but it still doesn't work.