Reputation: 274
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)?
Upvotes: 1
Views: 421
Reputation: 274
For anyone stumbling upon this in the future, this now works on v >= 0.6.2
Upvotes: 2