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.

dry_run.feature 3.3 kB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. Feature: Dry Run
  2. Dry run gives you a way to quickly scan your features without actually running them.
  3. - Invokes formatters without executing the steps.
  4. - This also omits the loading of your support/env.rb file if it exists.
  5. Scenario: With a failing step
  6. Given a file named "features/test.feature" with:
  7. """
  8. Feature: test
  9. Scenario:
  10. Given this step fails
  11. """
  12. And the standard step definitions
  13. When I run `cucumber --dry-run --publish-quiet`
  14. Then it should pass with exactly:
  15. """
  16. Feature: test
  17. Scenario: # features/test.feature:2
  18. Given this step fails # features/step_definitions/steps.rb:4
  19. 1 scenario (1 skipped)
  20. 1 step (1 skipped)
  21. """
  22. Scenario: With message formatter
  23. Given a file named "features/test.feature" with:
  24. """
  25. Feature: test
  26. Scenario:
  27. Given this step passes
  28. """
  29. And the standard step definitions
  30. When I run `cucumber --dry-run --publish-quiet --format message`
  31. Then it should pass
  32. And output should be valid NDJSON
  33. And the output should contain NDJSON with key "status" and value "SKIPPED"
  34. Scenario: In strict mode
  35. Given a file named "features/test.feature" with:
  36. """
  37. Feature: test
  38. Scenario:
  39. Given this step fails
  40. """
  41. And the standard step definitions
  42. When I run `cucumber --dry-run --strict --publish-quiet`
  43. Then it should pass with exactly:
  44. """
  45. Feature: test
  46. Scenario: # features/test.feature:2
  47. Given this step fails # features/step_definitions/steps.rb:4
  48. 1 scenario (1 skipped)
  49. 1 step (1 skipped)
  50. """
  51. Scenario: In strict mode with an undefined step
  52. Given a file named "features/test.feature" with:
  53. """
  54. Feature: test
  55. Scenario:
  56. Given this step is undefined
  57. """
  58. When I run `cucumber --dry-run --strict`
  59. Then it should fail with:
  60. """
  61. Feature: test
  62. Scenario: # features/test.feature:2
  63. Given this step is undefined # features/test.feature:3
  64. Undefined step: "this step is undefined" (Cucumber::Core::Test::Result::Undefined)
  65. features/test.feature:3:in `this step is undefined'
  66. Undefined Scenarios:
  67. cucumber features/test.feature:2 # Scenario:
  68. 1 scenario (1 undefined)
  69. 1 step (1 undefined)
  70. """
  71. Scenario: With BeforeAll and AfterAll hooks
  72. Given a file named "features/test.feature" with:
  73. """
  74. Feature:
  75. Scenario:
  76. Given this step passes
  77. """
  78. And the standard step definitions
  79. And a file named "features/step_definitions/support.rb" with:
  80. """
  81. BeforeAll do
  82. raise "BeforeAll hook error has been raised"
  83. end
  84. AfterAll do
  85. raise "AfterAll hook error has been raised"
  86. end
  87. """
  88. When I run `cucumber features/test.feature --publish-quiet --dry-run`
  89. Then it should pass with exactly:
  90. """
  91. Feature:
  92. Scenario: # features/test.feature:2
  93. Given this step passes # features/step_definitions/steps.rb:1
  94. 1 scenario (1 skipped)
  95. 1 step (1 skipped)
  96. """

No Description

Contributors (1)