问题
Is there a way to get Karate to automatically print the name of each scenario as it is executed into the logs? We have a reasonably large suite that generates ~25MB
of log data in our Jenkins pipeline console output and sometimes it’s a little tricky trying to match a line where com.intuit.karate
logs an ERROR
to the failure summary at the end of the run. It is most likely possible to obtain the scenario name and print()
it but that would mean adding code to many hundred scenarios which I’d like to avoid.
回答1:
As part of the fix for this issue Karate will log the Scenario name (if not empty) along with any failure trace.
A beta version with this fix is available 0.6.1.2
it would be great if you can try it and confirm.
If you feel more has to be done, do open a ticket and we'll do our best to get this into the upcoming 0.6.2
release.
来源:https://stackoverflow.com/questions/47555016/log-name-of-scenario-when-it-starts