You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_case_finished_event.feature 1.2 kB

2 years ago
1234567891011121314151617181920212223242526272829303132333435
  1. Feature: Test Case Finished Event
  2. This event is fired after each scenario or examples table row (generally named a
  3. Test Case) has finished executing. You can use the event to learn about the
  4. result of the test case.
  5. See [the API documentation](http://www.rubydoc.info/github/cucumber/cucumber-ruby/Cucumber/Events/TestCaseFinished) for more information about the data available on this event.
  6. Scenario: Test case passes
  7. Given the standard step definitions
  8. And a file named "features/passing.feature" with:
  9. """
  10. Feature: A feature
  11. Scenario: A scenario
  12. Given this step passes
  13. """
  14. And a file named "features/support/events.rb" with:
  15. """
  16. InstallPlugin do |config|
  17. config.on_event :test_case_finished do |event|
  18. config.out_stream.puts "Results"
  19. config.out_stream.puts "-------"
  20. config.out_stream.puts "Test case: #{event.test_case.name}"
  21. config.out_stream.puts "The result is: #{event.result}"
  22. end
  23. end
  24. """
  25. When I run `cucumber`
  26. Then it should pass with:
  27. """
  28. Results
  29. -------
  30. Test case: A scenario
  31. The result is: ✓
  32. """

No Description

Contributors (1)