gauge icon indicating copy to clipboard operation
gauge copied to clipboard

"failedScenariosCount" is invalid in the json-report

Open osandadeshan opened this issue 6 years ago • 3 comments

This is the json report for my execution. result.zip At the end of the file, it shows; "beforeSuiteHookFailure": null, "afterSuiteHookFailure": null, "passedSpecsCount": 14, "failedSpecsCount": 1, "skippedSpecsCount": 0, "passedScenariosCount": 45, "failedScenariosCount": 0, "skippedScenariosCount": 0 Here "failedSpecsCount": 1 and "failedScenariosCount": 0. But the actual scenario failures are 1. This is the error for that failure ` Errors:

        [Parse Error] C:\Program Files (x86)\Jenkins\workspace\MaxSoft IntelliAPI\specs\Other\Form-Data Example.spec:20 Dynamic param  could not be resolved, Missing file: C:/client_id.txt => '   |client_id    |    |'
      
        [Parse Error] C:\Program Files (x86)\Jenkins\workspace\MaxSoft IntelliAPI\specs\Other\Form-Data Example.spec:21 Dynamic param  could not be resolved, Missing file: C:/client_secret.txt => '   |client_secret||'
      
        [Parse Error] C:\Program Files (x86)\Jenkins\workspace\MaxSoft IntelliAPI\specs\Other\Form-Data Example.spec:22 Dynamic param  could not be resolved, Missing file: C:/refresh_token.txt => '   |refresh_token||'
      

`

This is the html-report screenshot image

HTML report also not identified the failure scenario, it also shows failure scenarios are 0

Gauge version

Gauge version: 1.0.5
Commit Hash: 562f036

Plugins

flash (0.0.1)
html-report (4.0.8)
java (0.7.2)
js (2.3.5)
json-report (0.3.1)
screenshot (0.0.1)
spectacle (0.1.3)
xml-report (0.2.1)

osandadeshan avatar Jun 27 '19 16:06 osandadeshan

Ref: https://github.com/getgauge-contrib/json-report/issues/9

osandadeshan avatar Jun 27 '19 16:06 osandadeshan

@osandadeshan I could replicate your issue. We will be working on a fix soon.

The issue happens when there is a Prase Error in the specification. The spec is marked as failed. But the Scenario count does not reflect that, cause the Spec could not be parsed, so there was no scenario to execute of that spec.

Now, what should be the behavior in such scenarios or the current behavior is ok?

/cc @getgauge/core

BugDiver avatar Jun 28 '19 05:06 BugDiver

@BugDiver I think the behavior for the Parse Error scenarios should be marked as "Skipped". Since it is not a test failure and the test will not try to run even.

osandadeshan avatar Jun 28 '19 06:06 osandadeshan