Skip to content

Commit

Permalink
Add test for json correctly populating the description from a feature
Browse files Browse the repository at this point in the history
  • Loading branch information
jsa34 committed Dec 1, 2024
1 parent d527a67 commit cb9983e
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions tests/feature/test_cucumber_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_step_trace(pytester):
"""
@feature-tag
Feature: One passing scenario, one failing scenario
This is a feature description
@scenario-passing-tag
Scenario: Passing
Expand Down Expand Up @@ -116,108 +117,108 @@ def test_passing_outline():
assert result.ret
expected = [
{
"description": "",
"description": "This is a feature description",
"elements": [
{
"description": "",
"id": "test_passing",
"keyword": "Scenario",
"line": 5,
"line": 6,
"name": "Passing",
"steps": [
{
"keyword": "Given",
"line": 6,
"line": 7,
"match": {"location": ""},
"name": "a passing step",
"result": {"status": "passed", "duration": OfType(int)},
},
{
"keyword": "And",
"line": 7,
"line": 8,
"match": {"location": ""},
"name": "some other passing step",
"result": {"status": "passed", "duration": OfType(int)},
},
],
"tags": [{"name": "scenario-passing-tag", "line": 4}],
"tags": [{"name": "scenario-passing-tag", "line": 5}],
"type": "scenario",
},
{
"description": "",
"id": "test_failing",
"keyword": "Scenario",
"line": 10,
"line": 11,
"name": "Failing",
"steps": [
{
"keyword": "Given",
"line": 11,
"line": 12,
"match": {"location": ""},
"name": "a passing step",
"result": {"status": "passed", "duration": OfType(int)},
},
{
"keyword": "And",
"line": 12,
"line": 13,
"match": {"location": ""},
"name": "a failing step",
"result": {"error_message": OfType(str), "status": "failed", "duration": OfType(int)},
},
],
"tags": [{"name": "scenario-failing-tag", "line": 9}],
"tags": [{"name": "scenario-failing-tag", "line": 10}],
"type": "scenario",
},
{
"description": "",
"keyword": "Scenario Outline",
"tags": [{"line": 14, "name": "scenario-outline-passing-tag"}],
"tags": [{"line": 15, "name": "scenario-outline-passing-tag"}],
"steps": [
{
"line": 16,
"line": 17,
"match": {"location": ""},
"result": {"status": "passed", "duration": OfType(int)},
"keyword": "Given",
"name": "type str and value hello",
}
],
"line": 15,
"line": 16,
"type": "scenario",
"id": "test_passing_outline[str-hello]",
"name": "Passing outline",
},
{
"description": "",
"keyword": "Scenario Outline",
"tags": [{"line": 14, "name": "scenario-outline-passing-tag"}],
"tags": [{"line": 15, "name": "scenario-outline-passing-tag"}],
"steps": [
{
"line": 16,
"line": 17,
"match": {"location": ""},
"result": {"status": "passed", "duration": OfType(int)},
"keyword": "Given",
"name": "type int and value 42",
}
],
"line": 15,
"line": 16,
"type": "scenario",
"id": "test_passing_outline[int-42]",
"name": "Passing outline",
},
{
"description": "",
"keyword": "Scenario Outline",
"tags": [{"line": 14, "name": "scenario-outline-passing-tag"}],
"tags": [{"line": 15, "name": "scenario-outline-passing-tag"}],
"steps": [
{
"line": 16,
"line": 17,
"match": {"location": ""},
"result": {"status": "passed", "duration": OfType(int)},
"keyword": "Given",
"name": "type float and value 1.0",
}
],
"line": 15,
"line": 16,
"type": "scenario",
"id": "test_passing_outline[float-1.0]",
"name": "Passing outline",
Expand Down

0 comments on commit cb9983e

Please sign in to comment.