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.

message.feature 2.0 kB

2 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. Feature: Message output formatter
  2. This formatter emits a stream of Newline-Delimited JSON (NDJSON) documents
  3. as events occur during the test run.
  4. You can read more about the message protocol [here](https://github.com/cucumber/common/tree/main/messages).
  5. Background:
  6. Given a file named "features/my_feature.feature" with:
  7. """
  8. Feature: Some feature
  9. Scenario Outline: a scenario
  10. Given a <status> step
  11. Examples:
  12. | status |
  13. | passed |
  14. | failed |
  15. """
  16. Scenario: it produces NDJSON messages
  17. When I run `cucumber features/my_feature.feature --format message`
  18. Then output should be valid NDJSON
  19. And messages types should be:
  20. """
  21. meta
  22. source
  23. gherkinDocument
  24. pickle
  25. pickle
  26. testCase
  27. testCase
  28. testRunStarted
  29. testCaseStarted
  30. testStepStarted
  31. testStepFinished
  32. testCaseFinished
  33. testCaseStarted
  34. testStepStarted
  35. testStepFinished
  36. testCaseFinished
  37. testRunFinished
  38. """
  39. Scenario: it sets "testRunFinished"."success" to false if something failed
  40. Given a file named "features/steps.rb" with:
  41. """
  42. Given('a passed step') {}
  43. Given('a failed step') { fail }
  44. """
  45. When I run `cucumber features/my_feature.feature --format message`
  46. Then output should be valid NDJSON
  47. And the output should contain:
  48. """
  49. {"testRunFinished":{"success":false
  50. """
  51. Scenario: it sets "testRunFinished"."success" to true if nothing failed
  52. Given a file named "features/my_feature.feature" with:
  53. """
  54. Feature: Some feature
  55. Scenario Outline: a scenario
  56. Given a passed step
  57. """
  58. And a file named "features/steps.rb" with:
  59. """
  60. Given('a passed step') {}
  61. """
  62. When I run `cucumber features/my_feature.feature --format message`
  63. Then output should be valid NDJSON
  64. And the output should contain:
  65. """
  66. {"testRunFinished":{"success":true
  67. """

No Description

Contributors (1)