1

I have read elsewhere on here that I can indeed call another feature file in an afterScenario function such as:

karate.configure('afterScenario', read('some.feature'));

However, can one send multiple feature files and tagging specific scenarios and send parameters?

I have two different calls I need to make to "clean up" after each of my test scenarios:

* call read(etc.feature@etc')
* call read(etc1.feature@etc1') { etc: '#(etc)' }

I did try sending both of those calls through (both in a single karate.configure and multiple) and using the parameter but it failed. Is it possible to do?

EDIT: I am attempting the following an am getting more promising results but still not there.

* configure afterScenario = 
"""
 function(){
 karate.log('etc'); 
 karate.call(etc@etc');
}
"""
hungryhippos
  • 617
  • 4
  • 15

1 Answers1

1

No, it is not possible. You are welcome to contribute code. You can always do a karate.get('someVarName') in case you want to access data.

You may be able to call a single feature (or JS function) that in-turn calls multiple other features. Such over-engineering is not something I personally recommend for tests.

Also see: https://stackoverflow.com/a/60944060/143475

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248