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.007155" name="Simple Addition"> <testcase classname="Simple Addition" name="Addition of single digit numbers" time="0.004885"> <system-out/> <system-err/> </testcase> <testcase classname="Simple Addition" name="Addition of double digit numbers" time="0.002270"> <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.008325" name="Tabulated maths"> <testcase classname="Tabulated maths" name="Addition from a table (outline example : | 1 | 2 | 3 |)" time="0.002288"> <system-out/> <system-err/> </testcase> <testcase classname="Tabulated maths" name="Addition from a table (outline example : | 10 | 20 | 30 |)" time="0.002005"> <system-out/> <system-err/> </testcase> <testcase classname="Tabulated maths" name="Addition from a table (outline example : | 22 | 33 | 55 |)" time="0.002334"> <system-out/> <system-err/> </testcase> <testcase classname="Tabulated maths" name="Addition from a table (outline example : | 22 | 33 | 55 |)" time="0.001698"> <system-out/> <system-err/> </testcase> <system-out> <![CDATA[]]> </system-out> <system-err> <![CDATA[]]> </system-err> </testsuite>