how to get afterFeature and afterScenario report in either karate or cucumber reporting

别说谁变了你拦得住时间么 提交于 2019-12-24 07:39:46

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!