[junit] Expose the ability to write trait tags in testcase nodes
See original GitHub issueSince record_property is incompatible with the xunit2 family, we should add a fixture or some mechanism to do something similar with the supported trait tag.
Especially now that xunit2 is the default family with the 6.0 release, it would be a useful addition.
Example usage
def test(record_trait):
record_trait("key", "value")
Example output in testcase node
<?xml version="1.0" encoding="utf-8"?>
<testsuites>
<testsuite errors="0" failures="0" hostname="scoria" name="pytest" skipped="0" tests="1" time="4.497"
timestamp="2020-07-24T10:09:52.287953">
<testcase classname="test_example.TestExample" name="test_a" time="4.497">
<traits>
<trait name="key" value="value"/>
</traits>
</testcase>
</testsuite>
</testsuites>
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Tagging and Filtering JUnit Tests - Baeldung
In this article, we saw a way to tag and filter test cases with JUnit 5. We used the Tag annotation and also...
Read more >JUnit 5 User Guide
JUnit Jupiter API for writing tests and extensions. ... Denotes that a method is a template for test cases designed to be invoked...
Read more >Introduction to JUnit: Unit Testing Springboot Services - Adeva
This post will focus on presenting the JUnit framework used within the context of a typical Java project written using the Springboot framework....
Read more >Java Unit Testing with JUnit and TestNG
To run the test case, right-click on the file ⇒ Run as ⇒ JUnit Test. The test result is shown in the JUnit...
Read more >Unit Testing CRUD Endpoints of a Spring Boot Java Web ...
Our testing framework of choice will be JUnit, it provides assertions to ... that the method to which this annotation is attached can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Agreed, and it is trivial to implement: 73172b88d21e0e07757844ceaaae897444cae706
I didn’t open a PR just because I couldn’t find a schema for that version (TBH I didn’t spend too much time searching because I’m short on time now). @maspe36 do you happen to have one handy?
if traits behave the same as properties in junit1, then we should just use the new nodes on the new version