Skip to content

Scenario outline reporting #18

@vincent-psarga

Description

@vincent-psarga

When reporting a scenario outline, the steps from all the examples are mixed inside one single element.
I have this scenario that I can execute with both Behat and Cucumber:

screen shot 2018-07-26 at 16 52 11

When running the example with Behat, I get one element with four steps:

     {  
        "id":"messages-are-based-on-language;support-internationalisation",
        "tags":[  
           {  
              "name":"@priority-medium"
           }
        ],
        "keyword":"Scenario Outline",
        "name":"Messages are based on language",
        "line":8,
        "description":"",
        "type":"outline",
        "steps":[  
           {  
              "keyword":"When",
              "name":"I start the coffee machine using language \"en\"",
              "line":9,
              "match":{  
                 "location":""
              },
              "result":{  
                 "status":"passed",
                 "error_message":null,
                 "duration":102000000
              },
              "arguments":[  

              ]
           },
           {  
              "keyword":"Then",
              "name":"message \"Ready\" should be displayed",
              "line":10,
              "match":{  
                 "location":""
              },
              "result":{  
                 "status":"passed",
                 "error_message":null,
                 "duration":102000000
              },
              "arguments":[  

              ]
           },
           {  
              "keyword":"When",
              "name":"I start the coffee machine using language \"fr\"",
              "line":9,
              "match":{  
                 "location":""
              },
              "result":{  
                 "status":"passed",
                 "error_message":null,
                 "duration":103000000
              },
              "arguments":[  

              ]
           },
           {  
              "keyword":"Then",
              "name":"message \"Pret\" should be displayed",
              "line":10,
              "match":{  
                 "location":""
              },
              "result":{  
                 "status":"passed",
                 "error_message":null,
                 "duration":103000000
              },
              "arguments":[  

              ]
           }
        ],
        "examples":[  

        ]
     }

When running the same scenario in Cucumber, each example will generate its own "element" in the JSON output, each element having two steps:

{
    "id": "support-internationalisation;messages-are-based-on-language;;2",
    "keyword": "Scenario Outline",
    "name": "Messages are based on language",
    "description": "",
    "line": 18,
    "type": "scenario",
    "steps": [
      {
        "keyword": "When ",
        "name": "I start the coffee machine using language \"en\"",
        "line": 18,
        "comments": [
          {
            "value": "# Well, sometimes, you just get a coffee.",
            "line": 12
          }
        ],
        "match": {
          "location": "features/step_definitions/step_definitions.rb:6"
        },
        "result": {
          "status": "passed",
          "duration": 23000
        }
      },
      {
        "keyword": "Then ",
        "name": "message \"Ready\" should be displayed",
        "line": 18,
        "match": {
          "location": "features/step_definitions/step_definitions.rb:14"
        },
        "result": {
          "status": "passed",
          "duration": 48000
        }
      }
    ]
  },
  {
    "id": "support-internationalisation;messages-are-based-on-language;;3",
    "keyword": "Scenario Outline",
    "name": "Messages are based on language",
    "description": "",
    "line": 19,
    "type": "scenario",
    "steps": [
      {
        "keyword": "When ",
        "name": "I start the coffee machine using language \"fr\"",
        "line": 19,
        "comments": [
          {
            "value": "# Well, sometimes, you just get a coffee.",
            "line": 12
          }
        ],
        "match": {
          "location": "features/step_definitions/step_definitions.rb:6"
        },
        "result": {
          "status": "passed",
          "duration": 62000
        }
      },
      {
        "keyword": "Then ",
        "name": "message \"Pret\" should be displayed",
        "line": 19,
        "match": {
          "location": "features/step_definitions/step_definitions.rb:14"
        },
        "result": {
          "status": "passed",
          "duration": 56000
        }
      }
    ]
  }

When all steps are in the same element, it's really hard to find from which example it originated and display the results correctly.

If you need more explanations on the bug I'd be happy to answer them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions