dimanche 18 juin 2017

How to make all Cucumber scenarios rollback

I know how to achieve that by adding @txn to Scenario or Scenario Outline definition. Nevertheless I would prefer to achieve the same without having to add @txn to every single Scenario (Outline) definition.

To add some frustration moving the @txn tag to Feature level does nothing for me, contrary to this example. (Not like it would be the ideal solution but better than tagging every Scenario Outlines.) SpringTransactionHooks#startTransaction (source) is not called in that case.

Pleae note that I want to clean after each Scenario, not only after all tests are done. (Which IMO rules out merely adding @Transactional to the Cucumber runner class.)

Aucun commentaire:

Enregistrer un commentaire