Karate Cucumber报告未在HTML中显示日志。

huangapple go评论146阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年6月8日 20:51:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/76432040.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定