-
Notifications
You must be signed in to change notification settings - Fork 179
Description
Hi all,
I am using jasmine-reporters for generating XML reports for protractor E2E tests which are then being used to create HTML reports. There seems to be a bug in the implementation. So, I have a test suite with 3 test cases, of which 2 test cases are success and 1 test case fails. On running the tests with the JUnitXmlReporter
, I am getting the following XML node for the particular testsuite.
<testsuite name="Ingestion" timestamp="2022-02-20T02:59:46" hostname="localhost" time="98.866" errors="0" tests="3" skipped="0" disabled="0" failures="3">
<testcase classname="Ingestion" name="should ingest file type 1" time="25.266"/>
<testcase classname="Ingestion" name="should ingest file type 2" time="26.258"/>
<testcase classname="Ingestion" name="should ingest file type 3" time="13.548">
<failure type="toBeTruthy" message="Expected false to be truthy."><![CDATA[
]]></failure>
<failure type="exception" message="Failed: No element found using locator: By(xpath, //section[@data-test="sample-classification"]//mat-select//div//span)"><![CDATA[
]]></failure>
<failure type="exception" message="Failed: element click intercepted: Element <button _ngcontent-keo-c276="" data-test="close-dialog" mat-icon-button="" class="mat-focus-indicator mat-icon-button mat-button-base" style="margin-bottom: 5px;">...</button> is not clickable at point (1366, 102). Other element would receive the click: <section _ngcontent-keo-c276="" class="wrapper active ng-star-inserted" style=""></section>
(Session info: chrome=97.0.4692.71)
(Driver info: chromedriver=97.0.4692.71 (adefa7837d02a07a604c1e6eff0b3a09422ab88d-refs/branch-heads/4692@{#1247}),platform=Linux 3.10.0-1160.49.1.el7.x86_64 x86_64)"><![CDATA[
]]></failure>
</testcase>
</testsuite>
So, as visible, two of the three tests have succeeded, however, since the failed test case has 3 failure nodes under it, so the testsuite
tag shows the failures
attribute as 3, which is an incorrect representation, that gets carried on to my HTML report. I think this line 279 in the file junit_reporter.js
is causing this bug.
if (isFailed(spec)) { spec._suite._failures += spec.failedExpectations.length; }
Do let me know if this is by design or is an issue that could potentially be fixed, thanks.