问题
Is it possible to see the status of the calls in a afterFeature and afterScenario as a report inside of either cucumber-html-reporting and the karate reports (preferably both)
Regards
回答1:
Can you check again. I thought afterScenario
is already being logged. Honestly you should use the after
hooks only in rare circumstances. But feel free to raise a feature request for the afterFeature
to be present in the logs as well.
EDIT: Actually just realized that only if you use a *.feature
file to implement your afterScenario and afterFeature hooks - will you see the logs. I just tested this (see commit). So you have to use karate.call('my-hook-code.feature')
in the hook JS.
So yes, if you print anything in JavaScript or use karate.log()
it will not appear in the report. This is intentional, the reporting is tuned to work only for feature steps.
来源:https://stackoverflow.com/questions/49578395/how-to-get-afterfeature-and-afterscenario-report-in-either-karate-or-cucumber-re