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

3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Feature: Test Step Started Event
  2. This event is fired just before each step in a scenario or scenario outline example
  3. (generally named a Test Step) starts to be executed. This event is read-only, so there
  4. is no way to prevent the test step from running, but you can use it for logging or user
  5. notification.
  6. See [the API documentation](http://www.rubydoc.info/github/cucumber/cucumber-ruby/Cucumber/Events/TestStepStarted) for more information about the data available on this event and the result object.
  7. Background:
  8. Given the standard step definitions
  9. And a file named "features/test.feature" with:
  10. """
  11. Feature: A feature
  12. Scenario: A passing scenario
  13. Given this is a step
  14. """
  15. And a file named "features/support/events.rb" with:
  16. """
  17. stdout = nil
  18. InstallPlugin do |config|
  19. stdout = config.out_stream # make sure all the `puts` calls can write to the same output
  20. config.on_event :test_step_started do |event|
  21. stdout.puts "before"
  22. end
  23. config.on_event :test_step_finished do |event|
  24. stdout.puts "after"
  25. end
  26. end
  27. Given(/this is a step/) do
  28. stdout.puts "during"
  29. end
  30. """
  31. Scenario: Test step passes
  32. When I run `cucumber`
  33. Then it should pass with:
  34. """
  35. before
  36. during
  37. after
  38. """

No Description

Contributors (1)