michaelleeallen / mocha-junit-reporter

A JUnit XML reporter for mocha.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generate XML with skipped testcases

adrianraszka opened this issue · comments

In Cypress with BDD I can tag scenarios with @Skip, what makes them counted as pending specs.
However mocha-junit-reporter does not list in XML those scenarios, even tho they are counted in

Im trying to get from test result this:

<?xml version="1.0" encoding="UTF-8"?> <testsuites name="Mocha Tests" time="3.4040" tests="2" failures="0" skipped="1"> <testsuite name="Root Suite" timestamp="2022-08-18T14:17:14" tests="0" file="cypress/scenarios/ParaBank/ParaBank_Navigation.feature" time="0.0000" failures="0"> </testsuite> <testsuite name="User can use navigation buttons" timestamp="2022-08-18T14:17:14" tests="3" time="3.4040" failures="2"> <testcase name="User can use navigation buttons @skip" time="0.0000" classname="@skip"> <skipped></skipped> </testcase> <testcase name="User can use navigation buttons PASSED" time="3.4040" classname="PASSED"> </testcase> </testsuite> </testsuites>
Not this:

<?xml version="1.0" encoding="UTF-8"?> <testsuites name="Mocha Tests" time="8.5680" tests="2" failures="0" skipped="1"> <testsuite name="Root Suite" timestamp="2022-08-18T14:39:02" tests="0" file="cypress/scenarios/ParaBank/ParaBank_Navigation.feature" time="0.0000" failures="0"> </testsuite> <testsuite name="User can use navigation buttons" timestamp="2022-08-18T14:39:02" tests="3" time="7.9800" failures="1"> <testcase name="User can use navigation buttons PASSED" time="3.4600" classname="PASSED"> </testcase> </testsuite> </testsuites>

I need it to properly separate in TestRail reports passed, failed, and not implemented tests.

I agree. Skipped tests should be part of the report. I can try having a look to see where that may be missing when I have a bit more time

Have you tried setting the includePending option as true?

I don't have anymore any code to check your solution. Did it worked for you? I could try testing it on the weekend.