gotestsum
gotestsum copied to clipboard
Support JUnit step property
Please support JUnit step property.
See: https://github.com/testmoapp/junitxml?tab=readme-ov-file#steps
Example
<testcase name="testExample" classname="Tests">
<properties>
<property name="step[passed]" value="This is a test step that passed." />
<property name="step[failure]" value="And this step had a failure." />
<property name="step[skipped]" value="This step wasn't executed." />
<property name="step[error]" value="And this step had an error." />
</properties>
</testcase>
I want an option to make 't.Run' to be steps under each test cases.
Expected Behavior
func Test(t *testing.T) {
t.Run("A", func(t *testing.T) {}
t.Run("B", func(t *testing.T) {}
t.Run("C", func(t *testing.T) {
t.Run("D", func(t *testing.T) {}
}
}
generates
<testcase name="Test" classname="test">
<properties>
<property name="step[passed]" value="A" />
<property name="step[passed]" value="B" />
<property name="step[passed]" value="C/D" />
<property name="step[passed]" value="C" />
</properties>
</testcase>
Contributions are welcome! If someone opens a PR for this I can review and merge it.
@ledmonster you should be able to use #522 and a test post-processor to add this where needed
Thank you!!