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
{{ message }}
Repository navigation
[BUG] Incorrect serialization failure message in Junit reporter #12944
Hello everyone 🎭✋🏻! I found incorrect junit reporter serialization work;
when the test fails I expect the "failure message" field in the xml file to contain the error text, but it contains the test header:
Dmitry Gozman (@dgozman), i know about this, but attribute message parsed for results in pipeline azure devops, and on screenshot field "Error message" not contain error message, it just a test title:
Activity
dgozman commentedon Mar 22, 2022
MoMentuMRace (@Gornostalev) The actual failure should be a text node child of the
<failure>tag:Is that text missing for you?
Gornostalev commentedon Mar 22, 2022
Dmitry Gozman (@dgozman), i know about this, but attribute message parsed for results in pipeline azure devops, and on screenshot field "Error message" not contain error message, it just a test title:

dgozman commentedon Mar 22, 2022
Thank you for the screenshot, this makes sense.
Ideally, we would make the following improvements:
<error>element for thrown errors, and<failure>element forexpectfailures.error.nameintype=""attribute for errors.message=""attribute.expect.toBeintype=""attribute.message=""attribute.Adds test info to error messages in JUnit reporter
fix(junit): use actual error message in failure attributes and distin…
vazidmansuri005 commentedon Feb 22, 2026
Hey Dmitry Gozman (@dgozman) 👋
I've opened a PR to fix this: #39350
Following your guidance from the comments above:
expect) →<failure>with matcher name intype=""(e.g.,expect.toBe) and actual error message inmessage=""<error>with error class intype=""(e.g.,Error,TypeError) and error message inmessage=""errors=""counter now reflects actual thrown error count instead of hardcoded0This also addresses #39193 (distinguishing
<error>from<failure>elements).Happy to address any feedback!
fix(junit): use actual error message in failure attributes and distin…
fix(junit): use actual error message in failure attributes and distin…