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

3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. Feature: Test Case Started Event
  2. This event is fired just before each scenario or scenario outline example row
  3. (generally named a Test Case) starts to be executed. This event is read-only.
  4. See [the API documentation](http://www.rubydoc.info/github/cucumber/cucumber-ruby/Cucumber/Events/TestCaseStarted) for more information about the data available on this event and the result object.
  5. Background:
  6. Given the standard step definitions
  7. And a file named "features/test.feature" with:
  8. """
  9. @feature
  10. Feature: A feature
  11. @scenario
  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_case_started do |event|
  21. stdout.puts "before"
  22. stdout.puts event.test_case.tags.map(&:name)
  23. end
  24. config.on_event :test_case_finished do |event|
  25. stdout.puts "after"
  26. end
  27. end
  28. Given(/this is a step/) do
  29. end
  30. """
  31. Scenario: Run the test case
  32. When I run `cucumber -q`
  33. Then it should pass with:
  34. """
  35. before
  36. @feature
  37. @scenario
  38. @feature
  39. Feature: A feature
  40. @scenario
  41. Scenario: A passing scenario
  42. Given this is a step
  43. after
  44. """

No Description

Contributors (1)