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.

work_in_progress.feature 3.8 kB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. Feature: Cucumber --work-in-progress switch
  2. In order to ensure that feature scenarios do not pass until they are expected to
  3. Developers should be able to run cucumber in a mode that
  4. - will fail if any scenario passes completely
  5. - will not fail otherwise
  6. Background: A passing and a pending feature
  7. Given the standard step definitions
  8. And a file named "features/wip.feature" with:
  9. """
  10. Feature: WIP
  11. @failing
  12. Scenario: Failing
  13. Given this step raises an error
  14. @undefined
  15. Scenario: Undefined
  16. Given this step is undefined
  17. @pending
  18. Scenario: Pending
  19. Given this step is pending
  20. @passing
  21. Scenario: Passing
  22. Given this step passes
  23. """
  24. And a file named "features/passing_outline.feature" with:
  25. """
  26. Feature: Not WIP
  27. Scenario Outline: Passing
  28. Given this step <what>
  29. Examples:
  30. | what |
  31. | passes |
  32. """
  33. Scenario: Pass with Failing Scenarios
  34. When I run `cucumber -q -w -t @failing features/wip.feature`
  35. Then the stderr should not contain anything
  36. Then it should pass with:
  37. """
  38. Feature: WIP
  39. @failing
  40. Scenario: Failing
  41. Given this step raises an error
  42. error (RuntimeError)
  43. ./features/step_definitions/steps.rb:2:in `/^this step raises an error$/'
  44. features/wip.feature:4:in `this step raises an error'
  45. Failing Scenarios:
  46. cucumber features/wip.feature:3
  47. 1 scenario (1 failed)
  48. 1 step (1 failed)
  49. """
  50. And the output should contain:
  51. """
  52. The --wip switch was used, so the failures were expected. All is good.
  53. """
  54. Scenario: Pass with Undefined Scenarios
  55. When I run `cucumber -q -w -t @undefined features/wip.feature`
  56. Then it should pass with:
  57. """
  58. Feature: WIP
  59. @undefined
  60. Scenario: Undefined
  61. Given this step is undefined
  62. 1 scenario (1 undefined)
  63. 1 step (1 undefined)
  64. """
  65. And the output should contain:
  66. """
  67. The --wip switch was used, so the failures were expected. All is good.
  68. """
  69. Scenario: Pass with Undefined Scenarios
  70. When I run `cucumber -q -w -t @pending features/wip.feature`
  71. Then it should pass with:
  72. """
  73. Feature: WIP
  74. @pending
  75. Scenario: Pending
  76. Given this step is pending
  77. 1 scenario (1 pending)
  78. 1 step (1 pending)
  79. """
  80. And the output should contain:
  81. """
  82. The --wip switch was used, so the failures were expected. All is good.
  83. """
  84. Scenario: Fail with Passing Scenarios
  85. When I run `cucumber -q -w -t @passing features/wip.feature`
  86. Then it should fail with:
  87. """
  88. Feature: WIP
  89. @passing
  90. Scenario: Passing
  91. Given this step passes
  92. 1 scenario (1 passed)
  93. 1 step (1 passed)
  94. """
  95. And the output should contain:
  96. """
  97. The --wip switch was used, so I didn't expect anything to pass. These scenarios passed:
  98. (::) passed scenarios (::)
  99. features/wip.feature:15:in `Scenario: Passing'
  100. """
  101. Scenario: Fail with Passing Scenario Outline
  102. When I run `cucumber -q -w features/passing_outline.feature`
  103. Then it should fail with:
  104. """
  105. Feature: Not WIP
  106. Scenario Outline: Passing
  107. Given this step <what>
  108. Examples:
  109. | what |
  110. | passes |
  111. 1 scenario (1 passed)
  112. 1 step (1 passed)
  113. """
  114. And the output should contain:
  115. """
  116. The --wip switch was used, so I didn't expect anything to pass. These scenarios passed:
  117. (::) passed scenarios (::)
  118. features/passing_outline.feature:7:in `Scenario Outline: Passing'
  119. """

No Description

Contributors (1)