Skip to content

Request: extend JUnit report #1120

@jimivdw

Description

@jimivdw

I've recently added the JUnit report to my (GitLab) CI pipeline. It works great, but I'd like for it to provide a bit more info on which exact test is which and what is failing (in case of a failure).

Current output:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="BackstopJS" tests="3" failures="1" errors="1" skipped="0">
    <testcase classname="mySelector" name=" ›› MyLabel">
      <failure message="Design deviation ›› MyLabel (mySelector) component"/>
      <error message="Design deviation ›› MyLabel (mySelector) component"/>
    </testcase>
    <testcase classname="mySelector" name=" ›› MyLabelWithDifferentViewports"/>
    <testcase classname="mySelector" name=" ›› MyLabelWithDifferentViewports"/>
  </testsuite>
</testsuites>

I'd like to see the following additions:

  • Include viewport label in testcase name
  • Include selector in testcase name
  • Include mis match percentage in failure & error message
  • Include dimension difference in failure & error message

The output could then look something like:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
  <testsuite name="BackstopJS" tests="3" failures="1" errors="1" skipped="0">
    <testcase classname="mySelector" name="MyLabel ›› mySelector ›› myViewport">
      <failure message="Design deviation (0.42%, w: 3, h: 14) ›› MyLabel ›› mySelector ›› myViewport"/>
      <error message="Design deviation (0.42%, w: 3, h: 14) ›› MyLabel ›› mySelector ›› myViewport"/>
    </testcase>
    <testcase classname="mySelector" name=" MyLabelWithDifferentViewports ›› mySelector ›› myViewport"/>
    <testcase classname="mySelector" name=" MyLabelWithDifferentViewports ›› mySelector ›› myOtherViewport"/>
  </testsuite>
</testsuites>

I'd be happy to submit a PR for this if that would speed up things. I could also add configuration toggles for some/all of these changes if you'd like to keep the current default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions