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.

using_descriptions.feature 2.5 kB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. Feature: Using descriptions to give features context
  2. When writing your feature files its very helpful to use description
  3. text at the beginning of the feature file, to write a preamble to the
  4. feature describing clearly exactly what the feature does.
  5. You can also write descriptions attached to individual scenarios - see
  6. the examples below for how this can be used.
  7. It's possible to have your descriptions run over more than one line,
  8. and you can have blank lines too. As long as you don't start a line
  9. with a Given, When, Then, Background:, Scenario: or similar, you're
  10. fine: otherwise Gherkin will start to pay attention.
  11. Background:
  12. Given the standard step definitions
  13. Scenario: Everything with a description
  14. Given a file named "features/test.feature" with:
  15. """
  16. Feature: descriptions everywhere
  17. We can put a useful description here of the feature, which can
  18. span multiple lines.
  19. Background:
  20. We can also put in descriptions showing what the background is
  21. doing.
  22. Given this step passes
  23. Scenario: I'm a scenario with a description
  24. You can also put descriptions in front of individual scenarios.
  25. Given this step passes
  26. Scenario Outline: I'm a scenario outline with a description
  27. Scenario outlines can have descriptions.
  28. Given this step <state>
  29. Examples: Examples
  30. Specific examples for an outline are allowed to have
  31. descriptions, too.
  32. | state |
  33. | passes |
  34. """
  35. When I run `cucumber -q`
  36. Then the stderr should not contain anything
  37. Then it should pass with exactly:
  38. """
  39. Feature: descriptions everywhere
  40. We can put a useful description here of the feature, which can
  41. span multiple lines.
  42. Background:
  43. We can also put in descriptions showing what the background is
  44. doing.
  45. Given this step passes
  46. Scenario: I'm a scenario with a description
  47. You can also put descriptions in front of individual scenarios.
  48. Given this step passes
  49. Scenario Outline: I'm a scenario outline with a description
  50. Scenario outlines can have descriptions.
  51. Given this step <state>
  52. Examples: Examples
  53. Specific examples for an outline are allowed to have
  54. descriptions, too.
  55. | state |
  56. | passes |
  57. 2 scenarios (2 passed)
  58. 4 steps (4 passed)
  59. """

No Description

Contributors (1)