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

Before hook exception reported as skipped instead of fail #87

Closed
wswebcreation opened this issue Jun 2, 2019 · 4 comments
Closed

Before hook exception reported as skipped instead of fail #87

wswebcreation opened this issue Jun 2, 2019 · 4 comments
Assignees
Labels

Comments

@wswebcreation
Copy link
Collaborator

Environment (please complete the following information):

  • multiple-cucumber-html-reporter: 1.11.6
  • Node.js version: 10.15.0
  • NPM version: 6.8.0
  • Platform name and version: MacOs
  • Cucucmber version: 5.1.0

Config of multiple-cucumber-html-reporter
Using protractor-multiple-cucumber-html-reporter-plugin

Describe the bug
When error occurs in Before hook the report shows an error on before but in summary it shows as 'skipped'

To Reproduce
Steps to reproduce the behavior:
declare Before hook that return error:

Before(function (scenario, done) {
   done('error');
}

Expected behavior
Report should show the Scenario as error but shows the Scenario as Skipped

Log

[
  {
    "keyword": "Feature",
    "name": "demo feature",
    "line": 1,
    "id": "demo-feature",
    "tags": [],
    "uri": "e2e/demo.feature",
    "elements": [
      {
        "id": "demo-feature;demo-scenario",
        "keyword": "Scenario",
        "line": 3,
        "name": "demo scenario",
        "tags": [
          {
            "name": "@debug",
            "line": 2
          }
        ],
        "type": "scenario",
        "steps": [
          {
            "keyword": "Before",
            "hidden": true,
            "match": {
              "location": "e2e/steps/common.steps.ts:31"
            },
            "result": {
              "status": "failed",
              "duration": 3000000,
              "error_message": "Error: blabla\n    at World.<anonymous> (e2e/steps/common.steps.ts:32:10)"
            }
          },
          {
            "arguments": [],
            "keyword": "Given ",
            "line": 4,
            "name": "TODO",
            "match": {
              "location": "e2e/steps/common.steps.ts:95"
            },
            "result": {
              "status": "skipped"
            }
          },
          {
            "keyword": "After",
            "hidden": true,
            "match": {
              "location": "e2e/steps/common.steps.ts:34"
            },
            "result": {
              "status": "passed",
              "duration": 426000000
            },
            "embeddings": [
            ]
          },
          {
            "keyword": "After",
            "hidden": true,
            "match": {
              "location": "node_modules/protractor-cucumber-framework/lib/resultsCapturer.js:26"
            },
            "result": {
              "status": "passed",
              "duration": 1000000
            }
          }
        ]
      }
    ]
  }
]
@wswebcreation wswebcreation self-assigned this Jun 2, 2019
@wswebcreation
Copy link
Collaborator Author

Closing this one because it works as expected

image

@ofirmgr
Copy link

ofirmgr commented Jun 3, 2019

I don't understand why you call this is "works as expected". If the "Before" method fails then the whole Scenario should be fail as well but it is marked as skipped

@wswebcreation
Copy link
Collaborator Author

Hmm, you are right, sorry, I'll fix this

@wswebcreation
Copy link
Collaborator Author

wswebcreation commented Jun 3, 2019

I released version 1.11.8 https://github.com/wswebcreation/multiple-cucumber-html-reporter/releases/tag/v1.11.8 to fix this problem.

I also updated the example repo, check https://wswebcreation.github.io/multiple-cucumber-html-reporter/browsers/index.html

Going to close the issue now

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

No branches or pull requests

2 participants