英文:
Karate Cucumber Reports not displaying logs in html
问题
当在使用Git管道运行Karate测试时,日志在Git管道日志中可见,但不会显示在Cucumber HTML报告中。
Java 17
Gradle 7.4
Karate 1.2.0
Cucumber Reporting 5.3
print和karate.log都不会打印断言、打印语句等。是否需要设置日志以在Cucumber HTML报告中显示Karate日志?
感谢提供的任何帮助。
英文:
When running Karate tests using git pipelines, the logs are visible in git pipeline logs but are not showing up in cucumber html
Java 17
Gradle 7.4
Karate 1.2.0
Cucumber Reporting 5.3
Both print and karate.log are not printing assertions, print statement etc. Is there a logging setting needed for showing karate logs in cucumber html report?
Any help provided is appreciated
答案1
得分: 1
This can depend on if some other logging system has "taken over". Recently I saw this happen with Quarkus, so there was a need to "bridge" what Quarkus was using to "logback" which is what Karate uses. You may get some tips from this sample.
The other thing that comes to mind is that if the log level was forced to WARN, only DEBUG levels appear in the log.
Otherwise, sorry - it is near impossible to diagnose this without direct access to your runtime. You may need to figure this out on your own. The documentation has a section on logging, so see if that helps: https://github.com/karatelabs/karate#logging
英文:
This can depend on if some other logging system has "taken over". Recently I saw this happen with Quarkus, so there was a need to "bridge" what Quarkus was using to "logback" which is what Karate uses. You may get some tips from this sample.
The other thing that comes to mind is that if the log level was forced to WARN, only DEBUG levels appear in the log.
Otherwise, sorry - it is near impossible to diagnose this without direct access to your runtime. You may need to figure this out on your own. The documentation has a section on logging, so see if that helps: https://github.com/karatelabs/karate#logging
答案2
得分: 1
在调试后,我们成功解决了这个问题,只需在项目中添加一个包含Karate的logback.xml文件即可。
英文:
After debugging, we were able to resolve this issue after adding a logback.xml file in the project containing the karate.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论