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_step_finished_event.feature 1.4 kB

2 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. Feature: Test Step Finished Event
  2. This event is fired after each step in a scenario or scenario outline example
  3. (generally named a Test Step) has finished executing. You can use the event to learn about the
  4. result of the test step.
  5. See [the API documentation](http://www.rubydoc.info/github/cucumber/cucumber-ruby/Cucumber/Events/TestStepFinished) for more information about the data available on this event and the result object.
  6. Background:
  7. Given the standard step definitions
  8. And a file named "features/test.feature" with:
  9. """
  10. Feature: A feature
  11. @pass
  12. Scenario: A passing scenario
  13. Given this step passes
  14. @fail
  15. Scenario: A failing scenario
  16. Given this step fails
  17. """
  18. And a file named "features/support/events.rb" with:
  19. """
  20. InstallPlugin do |config|
  21. config.on_event :test_step_finished do |event|
  22. config.out_stream.puts "Test step: #{event.test_step}"
  23. config.out_stream.puts "The result is: #{event.result}"
  24. end
  25. end
  26. """
  27. Scenario: Test step passes
  28. When I run `cucumber --tags @pass`
  29. Then it should pass with:
  30. """
  31. Test step: this step passes
  32. The result is: ✓
  33. """
  34. Scenario: Test step fails
  35. When I run `cucumber --tags @fail`
  36. Then it should fail with:
  37. """
  38. Test step: this step fails
  39. The result is: ✗
  40. """

No Description

Contributors (1)