runing a feature with after hooks in cucumber

24 Views Asked by At

Is there somthing in cucumber that will allow me to run a feature file after a specific senario? I want to run a senario that will do changes in the system and then run a feature file that will check that the changes were successful

1

There are 1 best solutions below

0
M.P. Korstanje On

There is no way to do that in feature files. And you don't really have to either.

You can write a scenario that simply refers to a collection of checks in the abstract:

Scenario:
  Given a new system
  When changes are applied
  Then "system readiness" checks pass

To implement this last step you can invoke the actual code that executes all the checks that make up the system readiness checks. You can even reuse code you implemented for those other feature files.

And if you have to document in a feature file what the "system readiness" you can write another scenario:

Scenario:
  * The "system readiness" checks consist of:
    | liveness probe  |
    | readiness probe |

It will take some programming skills to get this all expressed correctly and it may not seem as straight forward as just writing a test script, but that is also not what Cucumber's was made for.