-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Support for test case properties #238
Comments
Hey thanks for submitting a feature request! This is something I also have wanted for a very long time, however it does not exist the junit spec we have always abided by. We could make this an optional thing, perhaps. If you weren't aware, jest-junit already supports test properties but it is at the test suite level not the test case level. |
@palmerj3 Thanks for the feedback. Yes, the suggestion is for the test case level, as this is useful to include additional details for each test, e.g. to reference screenshots to explain test failures and to document test properties such as the severity etc. As many testing tools can read test case properties, this is helpful for Jest users so they can get better test reports in various tools. I understand that this is not in the original Jenkins XSD, but there's no real 'standard' for the JUnit XML format, and various tools have extended the format specifically for test case properties. Jenkins is also just one tool that supports this format, and their XSD is quite outdated as I've found out. Just as an example, frameworks like I agree that the properties should be optional. Either via an additional config option, or simply based on whether the developer has added any properties. E.g. if no properties have been added, the I hope this makes sense! |
Any news on this issue? |
+1 for this feature! |
Hello there,
I would like to suggest adding support for properties on a test case level. As more and more tools such as CI and test management tools support test case properties, and as it can be very useful to include additional test attributes for tests, I think it would be a great addition for the Jest JUnit reporter.
This is also supported by various other test frameworks such as
pytest
orPlaywright
, as well as reporting and test management tools such as Testmo.Properties for test cases
Here is an example of what test case properties look like in the resulting XML file. This is the same format as supported for the
testsuite
element, just below thetestcase
element:You can also find additional details on this format here as well as a full XML example file.
Possible API
I'm not sure what the best API would look like in Jest JUnit, but the API should ideally support multiple properties with the same name. Maybe something like this:
The text was updated successfully, but these errors were encountered: