[英]Automating frank from jenkins
我正在尝试使用Frank从jenkins自动化测试会话。
这是我收到的错误消息。
(Frank::Cucumber::FrankNetworkError)
./step_definitions/test_steps.rb:30:in `/^I navigate to button V\303\244der$/'
test.feature:41:in `When I navigate to <link>'
| Radar | Norrland |
*********************************************
Oh dear. Your app fell over and can't get up.
*********************************************
Jenkins从git中签出代码,除此之外,我还添加了如下的shell命令。
cd ios #<--this is so that I go to the root folder, the one with the .xcodeproj project
frank setup
frank build
frank launch
mv features/*.feature Frank/features/. #<--- this is the testscript
mv features/step_definitions/*.rb Frank/features/step_definitions/. #<--here it is moved to the newly created frank/features & Frank/features/step_definitions folder
cd Frank/features
cucumber test.feature
一切都按照应有的方式构建,如果我转到服务器
并手动输入我的shell命令中的最后一行将执行测试。
最好的祝福
我个人在Mac上运行Jenkins时遇到很多问题。 特别是如果您使用了Jenskins Mac映像安装程序,则Jenkins始终在安装过程中创建的“ jenkins”用户下运行。
从内部运行黄瓜或启动iOS模拟器使我很头疼。
我终于学会了以自己的用户身份启动Jenkins,如下所示:“ nohup java -jar /Applications/Jenkins/jenkins.war --httpPort = 8080
从那时起,我就能够毫无问题地运行黄瓜。 希望这可以帮助。
每当您的应用程序崩溃时,就会发生这种情况。 当应用程序崩溃时,弗兰克停止接收事件,黄瓜以您看到的错误结束。
有两个可能的原因:
您应该检查崩溃/应用程序日志以查看确切原因。
我了解到通过詹金斯工作来捕获应用程序日志非常有帮助,例如
function grab_log_and_fail {
APP_NAME = "MyApplication"
# get the PID of the last process with the given name
PID=$( cat /var/log/system.log | grep "$APP_NAME\[" | tail -n 1 | sed -e "s/^.*$APP_NAME\ [\([^\]*\)\].*/\1/g" )
# grab all the messages from the process with the PID
cat /var/log/system.log | grep "$APP_NAME\[$PID\]" >"$WORKSPACE/$APP_NAME.log"
#fail the job
exit 1
}
您可以使用
cucumber test.feature || grab_log_and_fail
(仅当黄瓜以错误结尾时才会获取日志)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.