1

We have a requirement to run the entire test suite more than once considering different parameters.

Say, I have 5 feature files and each has 10 scenarios. I have a requirement to run these feature files twice one after the other.

There is a way to achieve this using Scenario Outline, which will execute each scenario for the number of parameters. But can we have all the scenarios run once for the 1st parameter and then all the scenario again for the 2nd parameter. Something like an Outline at Feature level.

Please suggest.

Chethan Swaroop
  • 160
  • 2
  • 12

1 Answers1

0

I think this should be done at the JUnit / Java runner level. Teams usually use tags to enable or disable features at run time.

Or you can create a "wrapper" feature that calls a second feature etc.

Otherwise please assume that what you want is not directly supported, you are welcome to contribute code to Karate if needed. My honest opinion is that this is not required in a testing framework, maybe you should just write code.

EDIT - see this answer, I think you will be able to figure out an approach based on it: https://stackoverflow.com/a/60387907/143475 - and keep in mind Karate supports a "dynamic" Scenario Outline.

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