afterScenario hook not running when scenario fails

20 Views Asked by At

I am doing an integration between Jira Rest API + Karate that allows my team to generate Test Cases automatically the first time running a new scenario. I added an afterScenario 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? Is there anything I'm missing?

  1. I search for other issues like the one I'm experiencing and I found this one that is quite similar https://github.com/karatelabs/karate/issues/2013

Background: initialize test configurations

#ENTER USER STORY NUMBER______

  • def userStory = 'MMM-3781'

    #TEST VARIABLES_____

    • def util = call read('classpath:common.feature')

    • def readId = util.UUID()

      #TEST IMPLEMENTATION

@MMM-3781

Scenario: Test Connection from BlackBeltFramework Part VII

  • def scenarioDescription = 'This test will validate the connection between Black-Belt Framework and MMM Jira Board. The function to test is CreateControlTowerCashTransferBST'

  • def step_1 = 'Create Control Cash Transfer'

  • def createWorkspace = call read('../API_calls/CreateControlTowerCashTransferBST.feature') {Authorization: 'a2a', id: 'readId'}

Then assert responseStatus =200 -----> is going to Fail so the JIRA CONNECTION section is skip.

#JIRA CONNECTION___

 * def JavaD = Java.type('com.amex.api.automation.JavaIntegration_QA')    
 * configure afterScenario = JavaD.CreateTestCase(userStory, karate.scenario.name, scenarioDescription)  
 * configure afterScenario = JavaD.CreateTestStep(step_1,read('../request/Payload.json'),createWorkspace.response ,userStory, karate.scenario.name)    
 * configure afterScenario = JavaD.CreateTestExecution(karate.scenario.name,userStory, karate.scenario.message.)
0

There are 0 best solutions below