Skip to content
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

Support JUnit step property #460

Open
ledmonster opened this issue Dec 12, 2024 · 0 comments
Open

Support JUnit step property #460

ledmonster opened this issue Dec 12, 2024 · 0 comments

Comments

@ledmonster
Copy link

ledmonster commented Dec 12, 2024

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant