4.10. Step - 08 : Output formats

As described later in Help about Cucumber, Cucumber can generate various output formats.

Now let’s run Cucumber.

cucumber \
  --format html \
  --out ../run/07-regex-for-steps/07-regex-for-steps.07_cucumber_formats.html \
  --format junit \
  --out ../run/07-regex-for-steps/07-regex-for-steps.07_cucumber_formats_xml

The above command would generate:

  • A HTML file in ../run/07-regex-for-steps/07-regex-for-steps.07_cucumber_formats.html

  • JUnit XML Files in the folder ../run/07-regex-for-steps/07-regex-for-steps.07_cucumber_formats_xml. These JUnit format which can be picked up by jenkins and such other tools.

    • TEST-features-simple-addition.xml:

      Reports for the simple addition.

      <?xml version="1.0" encoding="UTF-8"?>
      <testsuite failures="0" errors="0" skipped="0" tests="2" time="0.005706" name="Simple Addition">
      <testcase classname="Simple Addition" name="Addition of single digit numbers" time="0.004068">
        <system-out/>
        <system-err/>
      </testcase>
      <testcase classname="Simple Addition" name="Addition of double digit numbers" time="0.001639">
        <system-out/>
        <system-err/>
      </testcase>
        <system-out>
          <![CDATA[]]>
        </system-out>
        <system-err>
          <![CDATA[]]>
        </system-err>
      </testsuite>
      
    • TEST-features-table-addition.xml

      Reports for the tabulated entries:

      <?xml version="1.0" encoding="UTF-8"?>
      <testsuite failures="0" errors="0" skipped="0" tests="4" time="0.008933" name="Tabulated maths">
      <testcase classname="Tabulated maths" name="Addition from a table (outline example : | 1 | 2 | 3 |)" time="0.002604">
        <system-out/>
        <system-err/>
      </testcase>
      <testcase classname="Tabulated maths" name="Addition from a table (outline example : | 10 | 20 | 30 |)" time="0.002084">
        <system-out/>
        <system-err/>
      </testcase>
      <testcase classname="Tabulated maths" name="Addition from a table (outline example : | 22 | 33 | 55 |)" time="0.002075">
        <system-out/>
        <system-err/>
      </testcase>
      <testcase classname="Tabulated maths" name="Addition from a table (outline example : | 22 | 33 | 55 |)" time="0.002171">
        <system-out/>
        <system-err/>
      </testcase>
        <system-out>
          <![CDATA[]]>
        </system-out>
        <system-err>
          <![CDATA[]]>
        </system-err>
      </testsuite>