1
votes

I am reusing a feature file by calling it inside a Scenario. The context is that I want to have some common features that all my endpoints need to be tested for in a common.feature file. Then in the feature file (endpoint.feature) for a particular endpoint, I first call the common.feature file in a Scenario and then have other scenarios specific to this endpoint.

My common.feature file looks like this:

Feature: ...  
Scenario: scenario 1  
Scenario: scenario 2  

My endpoint.feature file looks like this:

Feature: ...
Scenario: test
  * call read('common.feature')
...

Everything works as expected. The Scenarios from the common.feature file get executed. The issue is that if Scenario 1 from common.feature fails, I get the following result:

Tests in error: * call read('classpath:common/common.feature')(Scenario: test): feature call failed: classpath:common/common.feature(..) Scenario: test: feature call failed: classpath:common/common.feature(..)

Karate does not say exactly which Scenario from common.feature failed. If, for example, I have 20 Scenarios in common.feature, it would be great to see exactly which Scenarios failed.

Is there any way for having Karate list exactly which Scenarios in the called feature file failed (the way it shows during normal execution of a feature file)?

1
which version of Karate is this ? v0.6.1 has a lot of improvements, and you would at least see which line number failed. if we are missing the Scenario name, please raise a feature request.Peter Thomas
@Peter I am on v0.6.1. Yes it shows the line number that failed. I will raise a feature request to also show the Scenario name (also, totally in love with Karate!)imran arshad

1 Answers

2
votes

For anyone stumbling upon this in the future, this now works on v >= 0.6.2