You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm testing out the junit reporter with Cypress, and there are some weird behaviors with regards to the root suite, especially when using nested suites.
The root suite seems to be empty, and ends up being named `` (empty string) even if I have set rootSuiteName. This seems to be because `fullSuiteTitle()` assumes the passed-in suite is not the root itself: `var title = [ suite.title ];`
If I set useFullSuiteTitle to true, there's no way to omit the root name, because the || operator overrides the empty string:
<testsuitename=""tests="0">
</testsuite>
<testsuitename="Root Suite -- Outer1 -- InnerA"tests="3">
<testcasename="Bad"classname="Root Suite Outer1 InnerA">…</testcase>
</testsuite>
Full spew, with "useFullSuiteTitle": true:
<?xml version="1.0" encoding="UTF-8"?>
<testsuitesname="Mocha Tests"time="1.1380"tests="12"failures="4"skipped="4">
<testsuitename=""timestamp="2022-02-03T01:13:51"tests="0"file="cypress/integration/sample.test.ts"time="0.0000"failures="0">
</testsuite>
<testsuitename="Root Suite -- Outer1"timestamp="2022-02-03T01:13:51"tests="0"time="0.0000"failures="0">
</testsuite>
<testsuitename="Root Suite -- Outer1 -- InnerA"timestamp="2022-02-03T01:13:51"tests="3"time="0.2290"failures="1">
<testcasename="Bad"time="0.0000"classname="Outer1 InnerA Bad">
<failuremessage="expected false to be true"type="AssertionError"><![CDATA[AssertionError: expected false to be true at Context.eval (http://localhost:3001/__cypress/tests?p=cypress/integration/sample.test.ts:98:52)]]></failure>
</testcase>
<testcasename="Good"time="0.0290"classname="Outer1 InnerA Good">
</testcase>
</testsuite>
<testsuitename="Root Suite -- Outer1 -- InnerB"timestamp="2022-02-03T01:13:51"tests="3"time="0.2310"failures="1">
<testcasename="Bad"time="0.0000"classname="Outer1 InnerB Bad">
<failuremessage="expected false to be true"type="AssertionError"><![CDATA[AssertionError: expected false to be true at Context.eval (http://localhost:3001/__cypress/tests?p=cypress/integration/sample.test.ts:104:32)]]></failure>
</testcase>
<testcasename="Good"time="0.0240"classname="Outer1 InnerB Good">
</testcase>
</testsuite>
<testsuitename="Root Suite -- Outer2"timestamp="2022-02-03T01:13:52"tests="0"time="0.0000"failures="0">
</testsuite>
<testsuitename="Root Suite -- Outer2 -- InnerA"timestamp="2022-02-03T01:13:52"tests="3"time="0.2290"failures="1">
<testcasename="Bad"time="0.0000"classname="Outer2 InnerA Bad">
<failuremessage="expected false to be true"type="AssertionError"><![CDATA[AssertionError: expected false to be true at Context.eval (http://localhost:3001/__cypress/tests?p=cypress/integration/sample.test.ts:112:52)]]></failure>
</testcase>
<testcasename="Good"time="0.0260"classname="Outer2 InnerA Good">
</testcase>
</testsuite>
<testsuitename="Root Suite -- Outer2 -- InnerB"timestamp="2022-02-03T01:13:52"tests="3"time="0.2880"failures="1">
<testcasename="Bad"time="0.0000"classname="Outer2 InnerB Bad">
<failuremessage="expected false to be true"type="AssertionError"><![CDATA[AssertionError: expected false to be true at Context.eval (http://localhost:3001/__cypress/tests?p=cypress/integration/sample.test.ts:117:52)]]></failure>
</testcase>
<testcasename="Good"time="0.0280"classname="Outer2 InnerB Good">
</testcase>
</testsuite>
</testsuites>
Full spew, with "useFullSuiteTitle": false:
<?xml version="1.0" encoding="UTF-8"?>
<testsuitesname="Mocha Tests"time="1.1570"tests="12"failures="4"skipped="4">
<testsuitename="Root Suite"timestamp="2022-02-03T01:14:37"tests="0"file="cypress/integration/sample.test.ts"time="0.0000"failures="0">
</testsuite>
<testsuitename="Outer1"timestamp="2022-02-03T01:14:38"tests="0"time="0.0000"failures="0">
</testsuite>
<testsuitename="InnerA"timestamp="2022-02-03T01:14:38"tests="3"time="0.2420"failures="1">
<testcasename="Bad"time="0.0000"classname="Outer1 InnerA Bad">
<failuremessage="expected false to be true"type="AssertionError"><![CDATA[AssertionError: expected false to be true at Context.eval (http://localhost:3001/__cypress/tests?p=cypress/integration/sample.test.ts:98:52)]]></failure>
</testcase>
<testcasename="Good"time="0.0270"classname="Outer1 InnerA Good">
</testcase>
</testsuite>
<testsuitename="InnerB"timestamp="2022-02-03T01:14:38"tests="3"time="0.2220"failures="1">
<testcasename="Bad"time="0.0000"classname="Outer1 InnerB Bad">
<failuremessage="expected false to be true"type="AssertionError"><![CDATA[AssertionError: expected false to be true at Context.eval (http://localhost:3001/__cypress/tests?p=cypress/integration/sample.test.ts:104:32)]]></failure>
</testcase>
<testcasename="Good"time="0.0220"classname="Outer1 InnerB Good">
</testcase>
</testsuite>
<testsuitename="Outer2"timestamp="2022-02-03T01:14:38"tests="0"time="0.0000"failures="0">
</testsuite>
<testsuitename="InnerA"timestamp="2022-02-03T01:14:38"tests="3"time="0.2300"failures="1">
<testcasename="Bad"time="0.0000"classname="Outer2 InnerA Bad">
<failuremessage="expected false to be true"type="AssertionError"><![CDATA[AssertionError: expected false to be true at Context.eval (http://localhost:3001/__cypress/tests?p=cypress/integration/sample.test.ts:112:52)]]></failure>
</testcase>
<testcasename="Good"time="0.0270"classname="Outer2 InnerA Good">
</testcase>
</testsuite>
<testsuitename="InnerB"timestamp="2022-02-03T01:14:38"tests="3"time="0.3020"failures="1">
<testcasename="Bad"time="0.0000"classname="Outer2 InnerB Bad">
<failuremessage="expected false to be true"type="AssertionError"><![CDATA[AssertionError: expected false to be true at Context.eval (http://localhost:3001/__cypress/tests?p=cypress/integration/sample.test.ts:117:52)]]></failure>
</testcase>
<testcasename="Good"time="0.0340"classname="Outer2 InnerB Good">
</testcase>
</testsuite>
</testsuites>
The text was updated successfully, but these errors were encountered:
I'm testing out the junit reporter with Cypress, and there are some weird behaviors with regards to the root suite, especially when using nested suites.
The root suite seems to be empty, and ends up being named `` (empty string) even if I have set
rootSuiteName
. This seems to be because `fullSuiteTitle()` assumes the passed-in suite is not the root itself: `var title = [ suite.title ];`If I set
useFullSuiteTitle
totrue
, there's no way to omit the root name, because the||
operator overrides the empty string:Given this sample test:
Assuming the config:
What I expect (though the last piece of the classname is redundant):
What I get:
Full spew, with
"useFullSuiteTitle": true
:Full spew, with
"useFullSuiteTitle": false
:The text was updated successfully, but these errors were encountered: