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.

rerun_formatter.feature 4.5 kB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. Feature: Rerun formatter
  2. The rerun formatter writes an output that's perfect for
  3. passing to Cucumber when you want to rerun only the
  4. scenarios that prevented the exit code to be zero.
  5. You can save off the rerun output to a file by using it like this:
  6. `cucumber -f rerun --out .cucumber.rerun`
  7. Now you can pass that file's content to Cucumber to tell it
  8. which scenarios to run:
  9. `cucumber \`cat .cucumber.rerun\``
  10. This is useful when debugging in a large suite of features.
  11. Background:
  12. Given the standard step definitions
  13. Scenario: Exit code is zero
  14. Given a file named "features/mixed.feature" with:
  15. """
  16. Feature: Mixed
  17. Scenario:
  18. Given this step is undefined
  19. Scenario:
  20. Given this step is pending
  21. Scenario:
  22. Given this step passes
  23. """
  24. When I run `cucumber --publish-quiet -f rerun`
  25. Then it should pass with exactly:
  26. """
  27. """
  28. Scenario: Exit code is zero in the dry-run mode
  29. Given a file named "features/mixed.feature" with:
  30. """
  31. Feature: Mixed
  32. Scenario:
  33. Given this step fails
  34. Scenario:
  35. Given this step is undefined
  36. Scenario:
  37. Given this step is pending
  38. Scenario:
  39. Given this step passes
  40. """
  41. And a file named "features/all_good.feature" with:
  42. """
  43. Feature: All good
  44. Scenario:
  45. Given this step passes
  46. """
  47. When I run `cucumber --publish-quiet -f rerun --dry-run`
  48. Then it should pass with exactly:
  49. """
  50. """
  51. Scenario: Exit code is not zero, regular scenario
  52. Given a file named "features/mixed.feature" with:
  53. """
  54. Feature: Mixed
  55. Scenario:
  56. Given this step fails
  57. Scenario:
  58. Given this step is undefined
  59. Scenario:
  60. Given this step is pending
  61. Scenario:
  62. Given this step passes
  63. """
  64. And a file named "features/all_good.feature" with:
  65. """
  66. Feature: All good
  67. Scenario:
  68. Given this step passes
  69. """
  70. When I run `cucumber --publish-quiet -f rerun --strict`
  71. Then it should fail with exactly:
  72. """
  73. features/mixed.feature:3:6:9
  74. """
  75. Scenario: Exit code is not zero, scenario outlines
  76. For details see https://github.com/cucumber/cucumber/issues/57
  77. Given a file named "features/one_passing_one_failing.feature" with:
  78. """
  79. Feature: One passing example, one failing example
  80. Scenario Outline:
  81. Given this step <status>
  82. Examples:
  83. | status |
  84. | passes |
  85. | fails |
  86. """
  87. When I run `cucumber -f rerun`
  88. Then it should fail with:
  89. """
  90. features/one_passing_one_failing.feature:9
  91. """
  92. Scenario: Exit code is not zero, failing background
  93. Given a file named "features/failing_background.feature" with:
  94. """
  95. Feature: Failing background sample
  96. Background:
  97. Given this step fails
  98. Scenario: failing background
  99. Then this step passes
  100. Scenario: another failing background
  101. Then this step passes
  102. """
  103. When I run `cucumber -f rerun`
  104. Then it should fail with:
  105. """
  106. features/failing_background.feature:6:9
  107. """
  108. Scenario: Exit code is not zero, failing background with scenario outline
  109. Given a file named "features/failing_background_outline.feature" with:
  110. """
  111. Feature: Failing background sample with scenario outline
  112. Background:
  113. Given this step fails
  114. Scenario Outline:
  115. Then this step <status>
  116. Examples:
  117. | status |
  118. | passes |
  119. | passes |
  120. """
  121. When I run `cucumber features/failing_background_outline.feature -r features -f rerun`
  122. Then it should fail with:
  123. """
  124. features/failing_background_outline.feature:11:12
  125. """
  126. Scenario: Exit code is not zero, scenario outlines with expand
  127. For details see https://github.com/cucumber/cucumber/issues/503
  128. Given a file named "features/one_passing_one_failing.feature" with:
  129. """
  130. Feature: One passing example, one failing example
  131. Scenario Outline:
  132. Given this step <status>
  133. Examples:
  134. | status |
  135. | passes |
  136. | fails |
  137. """
  138. When I run `cucumber --expand -f rerun`
  139. Then it should fail with:
  140. """
  141. features/one_passing_one_failing.feature:9
  142. """

No Description

Contributors (1)