Guest User

Untitled

a guest
Jun 22nd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. ## cucumber.yml
  2. default: --format progress features
  3.  
  4.  
  5. ## directory structure and feature files
  6. features/first.feature
  7. features/by_role/second.feature
  8.  
  9.  
  10. ## content of features/first.feature
  11.  
  12.  
  13. Feature: first
  14. Scenario: first
  15. Given I am on "page 1"
  16.  
  17.  
  18. ## content of features/by_roles/second.feature
  19.  
  20. Feature: second
  21. Scenario: second
  22. Given I am on "page 2"
  23.  
  24.  
  25. ## support/paths.rb
  26.  
  27. def path_to(page_name)
  28. case page_name
  29.  
  30. when /the homepage/
  31. '/'
  32.  
  33. # Add more mappings here.
  34. # Here is a more fancy example:
  35. #
  36. # when /^(.*)'s profile page$/i
  37. # user_profile_path(User.find_by_login($1))
  38. when /page 1/
  39. "/"
  40. when /page 2/
  41. "/"
  42.  
  43. else
  44. raise "Can't find mapping from \"#{page_name}\" to a path.\n" +
  45. "Now, go and add a mapping in #{__FILE__}"
  46. end
  47. end
  48.  
  49. ## this shell command works as expected
  50.  
  51. $ cucumber
  52. ..
  53.  
  54. 2 scenarios (2 passed)
  55. 2 steps (2 passed)
  56. 0m0.049s
  57.  
  58. ## this shell command works as expected too
  59.  
  60. $ cucumber features/first.feature
  61. Feature: first
  62.  
  63. Scenario: first # features/first.feature:3
  64. Given I am on "page 1" # features/step_definitions/webrat_steps.rb:6
  65.  
  66. 1 scenario (1 passed)
  67. 1 step (1 passed)
  68. 0m0.050s
  69.  
  70. ## this shell command does NOT work as expected
  71.  
  72. $ cucumber features/by_role/second.feature
  73. Feature: second
  74.  
  75. Scenario: second # features/by_role/second.feature:3
  76. Given I am on "page 2" # features/by_role/second.feature:4
  77.  
  78. 1 scenario (1 undefined)
  79. 1 step (1 undefined)
  80. 0m0.001s
  81.  
  82. You can implement step definitions for undefined steps with these snippets:
  83.  
  84. Given /^I am on "([^\"]*)"$/ do |arg1|
  85. pending
  86. end
Add Comment
Please, Sign In to add comment