karatelabs / karate

Test Automation Made Simple
https://karatelabs.github.io/karate
MIT License
8.11k stars 1.94k forks source link

afterScenario hook not running when scenario fails #2540

Open Liz0206 opened 6 months ago

Liz0206 commented 6 months ago

I am doing an integration between Jira Rest API + karate that allows my team generate Test Cases automatically the first time running a new scenario. I added an after scenario hook in order to send the scenario results to Jira. Each time the scenario fails, the test stopped and afterScenario hook is skipped. Is there any open bug for this? I read the hook section but doesn't said anything related to the Scenario status itself? Is there anything I'm missing?

ptrthomas commented 6 months ago

@Liz0206 very few teams use hooks so my suggestion is please contribute code or work with your leadership to do so. you can see that vendors such as x-ray and report portal document how you can integrate, you may be able to look at their implementation for tips.

https://github.com/reportportal/agent-java-karate https://docs.getxray.app/display/XRAYCLOUD/Testing+APIs+using+Karate+DSL