Cucumber: How to run the After hook only once after all examples in scenarion_outline
问题 I have a scenario_outline which tests login screen of a website. Scenario_outline: Try to login Verify login Examples: | User | Pass | | user1 | pass1 | | user2 | pass2 | I want to be able to start the web page at the beginning and close if after all examples are done. Running the Before hook is easy Before do $start ||= false if ! start #start web page $start = true end end But how do i run my After hook only once after all scenarios are done? After do #close web page end The above example