0

In cucucmber i want to run a step after all the scenarios in a feature are run, can I have an after hook for the each feature. I want to have an after Hooks in cucumber java. Please help.

2 Answers2

0

I don't think there is nan "After Hook" in cucumber. You can use just after and it will do the job.

C. Peck
  • 3,641
  • 3
  • 19
  • 36
  • Hi Sai, it would be a better formatting if you distinguish @after using a text background highlight or using Bold style. Welcome to Stackoverflow :) – Ashraf Alshahawy May 27 '21 at 20:27
0

In Cucumber 7 or later versions we have the @BeforeAll and @AfterAll hooks.

  1. @BeforeAll: This will run before all the scenarios.
  2. @AfterAll: This will run after all the scenarios.

In this blog post, you can see the demonstration and signature of these hooks.