Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scenario outline reporting #18

Open
vincent-psarga opened this issue Jul 26, 2018 · 1 comment
Open

Scenario outline reporting #18

vincent-psarga opened this issue Jul 26, 2018 · 1 comment

Comments

@vincent-psarga
Copy link

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.

@robert-tom
Copy link

I have added a pull request to implement this feature
#20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants