-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed as not planned
Closed as not planned
Copy link
Description
Hello,
I'm using DynamicTest with @TestFactory all works as expected except xml report generated during execution with console launcher.
The test name set during execution is not propagated to name attribute of testcase node in xml report.
...
String testName = "Test " + index + " - " + page.page();
return DynamicTest.dynamicTest(testName, () -> {
assertAll(
() -> assertTrue(test(), page.page())
);
});<testcase name="dynamicTests()[17]" classname="foo.bar.ClassName" time="0.001">
<system-out><![CDATA[
unique-id: [engine:junit-jupiter]/[class:foo.bar.ClassName]/[test-factory:dynamicTests()]/[dynamic-test:#17]
display-name: Test 17 - page.asp
]]></system-out>
</testcase>as you can see display-name is correct in CDATA, but attribute is not updated with display name name="dynamicTests()[17]"
expected
<testcase name="Test 17 - page.asp" classname="foo.bar.ClassName" time="0.001">
<system-out><![CDATA[
unique-id: [engine:junit-jupiter]/[class:foo.bar.ClassName]/[test-factory:dynamicTests()]/[dynamic-test:#17]
display-name: Test 17 - page.asp
]]></system-out>
</testcase>I was trying to use TestReporter.publishEntry
Stream<DynamicTest> dynamicTests(TestReporter testReporter)
It didn't work out either.
Context
- Used versions
junit-platform-console-standalone-1.11.4.jar - JRE 23