当jenkins作业运行时,我得到了这个输出:
...
启动xvnc
[workspace] $ /Applications/VNCServer.app/OSXvnc-server -rfbauth /Applications/VNCServer.app/pass.word :11 -geometry 800x600
2012-02-08 22:04:05.375 OSXvnc-server[3412:707] Arguments: -rfbauth /Applications/VNCServer.app/pass.word :11 -geometry 800x600
2012-02-08 22:04:05.394 OSXvnc-server[3412:707] Main Bundle: /Applications/VNCServer.app
[workspace] $ /bin/sh -xe /var/folders/5d/jp_23pvd3bq5331x7myfcrym0000gq/T/hudson487661983531354780.sh
2012-02-08 22:04:05.425 OSXvnc-server[3412:707] Loading Bundle /Applications/VNCServer.app/Contents/Resources/TigerBundle.bundle
Parsing POMs
2012-02-08 22:04:05.441 OSXvnc-server[3412:707] Loading Bundle /Applications/VNCServer.app/Contents/Resources/JaguarBundle.bundle
2012-02-08 22:04:05.447 OSXvnc-server[3412:707] Running in Little Endian
2012-02-08 22:04:05.448 OSXvnc-server[3412:707] Pasteboard Inaccessible - Pasteboard sharing disabled
2012-02-08 22:04:05.449 OSXvnc-server[3412:707] Waiting for clients
2012-02-08 22:04:05.449 OSXvnc-server[3412:2c03] Using Private Event Source
2012-02-08 22:04:05.450 OSXvnc-server[3412:2c03] No Event Source -- Using 10.3 API
2012-02-08 22:04:05.451 OSXvnc-server[3412:2c03] Using Dynamic Event Tap -- HID for console user
2012-02-08 22:04:05.452 OSXvnc-server[3412:2c03] Registering Bonjour Service(_rfb._tcp.) - jjmacbook.local
2012-02-08 22:04:05.452 OSXvnc-server[3412:3503] IPv6: Started Listener Thread on port 5901
2012-02-08 22:04:05.453 OSXvnc-server[3412:2c03] Started Listener Thread on port 5901
[workspace] $ /Library/Java/Home//bin/java -cp /Users/jenkins/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.2.jar:/Users/jenkins/.jenkins/tools/Maven/boot/plexus-classworlds-2.4.jar org.jvnet.hudson.maven3.agent.Maven3Main
/Users/jenkins/.jenkins/tools/Maven /Users/jenkins/.jenkins/war/WEB-INF/lib/remoting-2.9.jar /Users/jenkins/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.2.jar 50302
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /Users/jenkins/.jenkins/jobs/chess-svg/workspace/pom.xml clean install
然而,自动UI测试仍会在屏幕上弹出窗口。
使用的vncserver是http://sourceforge.net/projects/osxvnc/
答案 0 :(得分:1)
我遇到了同样的问题,我认为这实际上是不可能的。
问题是在OSX上运行的Firefox / Chrome版本是针对OSX而不是“普通”X11 - 所以即使你运行X11服务器并使用xvfb / xvnc / whatever并传入DISPLAY =:123 ,Firefox / Chrome不关心,因为它们不是基于X的,它们是基于碳/可可的。
您可以自行确认如下:
... Firefox仍显示在主屏幕上。
你可以用其他东西来检查 - 如果你做“DISPLAY =:123123 xcalc”,xcalc将不会出现在主屏幕上,但它会显示在xlsclients的列表中,因为它是X-根据。
但是如果您尝试“DISPLAY =:123123 / Applications / Calculator / Contents / MacOS / Calculator”,OSX计算器会显示在主屏幕上,因为它不是基于X的。
(另一种可能的解决方案是使用selenium服务器,但我们的网络应用程序打破了selenium服务器,因此这不是我们的选择 - 最后,我转而使用基于Windows的Jenkins安装,其中selenium和chromedriver工作正常从詹金斯开始跑。)