我第一次尝试,没有Xvfb: 日志:
[31mFailed scenarios:[0m
[31msrc/test/resources/features/Login.feature:6 [0m# Scenario: Login to programs with invalid credentials
[31msrc/test/resources/features/Login.feature:10 [0m# Scenario: Login to programs with valid credentials
2 Scenarios ([31m2 failed[0m)
6 Steps ([31m2 failed[0m, [36m4 skipped[0m)
0m3.089s
java.lang.IllegalStateException: No webdriver is bound to current thread: 1. You need to call open(url) first.
我不知道为什么,在本地詹金斯上没有错误,例如您需要先调用open(url)。
第二次尝试,我读到需要xvfb
jenkins中xvfb的配置: https://i.imgur.com/zFkcPFZ.png https://i.imgur.com/BHCwDBS.png
日志:
Xvfb starting$ Xvfb :3 -screen 0 1024x758x16 -fbdir /var/lib/jenkins/xvfb-8-..fbdir5500835804021266071
ERROR: Failed to parse POMs
java.io.IOException: Cannot run program "Xvfb": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at hudson.Proc$LocalProc.<init>(Proc.java:249)
at hudson.Proc$LocalProc.<init>(Proc.java:218)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:929)
at hudson.Launcher$ProcStarter.start(Launcher.java:449)
at org.jenkinsci.plugins.xvfb.Xvfb.launchXvfb(Xvfb.java:587)
at org.jenkinsci.plugins.xvfb.Xvfb.setUp(Xvfb.java:697)
at jenkins.tasks.SimpleBuildWrapper.setUp(SimpleBuildWrapper.java:146)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:667)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1794)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 13 more
Finished: FAILURE
如果我取消选中xvfb安装“自动安装”,并且如果我尝试将“在其中找到Xvfb可执行文件的目录”设置为默认的/ usr / bin,我也会看到错误 主目录路径不包含Xfvb可执行文件:/ usr / bin
詹金斯(Jenkins)是否遇到过类似的问题? 我该怎么办? 我不能使用自动安装,应该与Jenkins管理员讨论xvfb可执行文件的路径吗?