Cuporter

A Cucumber Reporter

Scrapes your feature files to show test counts and tag relationships.

3 Views

  1. Tag Report
    • Tags listed with all features and scenarios associated with them
    • Each scenario shows all of its tags, for simple cross referencing
  2. Feature Report
    • Simple list of all Cucumber features, sorted by name and file name.
    • Collapsable scenario and scenario outline breakdowns
    • Totals, subtotals, scenario numbering
  3. Tree Report
    • Expandy-collapsy jquery.treeview of your features/** dir
    • Same feature data as above
    • Subtotals on folders

4 Output Formats

  1. html
  2. xml
  3. pretty-print text
  4. csv

Splitting the output among multiple formats is supported, so you could run a single report and write it to an html file, a csv file, and show the xml or text on stdout in the terminal.

i18n: Dozens of Languages

Internationalization through the gherkin lanugage file (i18n.yml). Following cucumber’s rules, non-English keywords will be used for any feature file with a ‘# language: <iso-code>’ header on line 1,

A Bunch of Configuration Options

See the help output below for all of the options, which can be supplied in two ways:

  1. Command Line
  2. Yaml File
    • use it to add to or override the program defaults
    • Batch mode: run multiple reports at once simply by specifying an option set for each in cuporter.yml
    • the file name itself is a configurable option
    • See the samples.

option override precedence

  1. Highest Precedence (overrides all): command line
  2. Middle Precedence: yaml file
  3. Lowest Precedence: Cuporter::Config::OptionSet::DEFAULTS

Example Report Output

html samples

See http://twcamper.github.com/cuporter/

xml of single test


<?xml version="1.0" encoding="UTF-8"?>
<xml>
  <body>
    <report view="tag" title="Cucumber Tags" total="1">
      <tag cuke_name="@just_me" total="1">
        <feature cuke_name="Feature: Pretty print report on 3 features" file_path="features/pretty_print.feature" total="1">
          <scenario cuke_name="Scenario: Tag report on everything in fixtures/self_test" tags="@just_me" number="1"/>
        </feature>
      </tag>
    </report>
  </body>
</xml>

numbered pretty text


@failing
   Feature: Abominable Aardvark            @failing, @zoology
   1. Scenario: An Aardvark eats ants
   2. Scenario: Zee Zebra eats zee aardvark
   Feature: Wired                          
   3. Scenario: Everybody's Wired          @failing
      Scenario Outline: Why is everybody so wired?
         Examples: loosely wired
            | arg1 | arg2 |
   4.       | foo  | bar  |
   5.       | shif | fish |
         Examples: tightly wired           @ignore
            | arg1  | arg2  |
   6.       | foo   | bar   |
   7.       | frotz | knurl |
   8. Scenario: Yellow lines
@ignore
   Feature: Wired
      Scenario Outline: Why is everybody so wired?
         Examples: tightly wired
            | arg1  | arg2  |
   1.       | foo   | bar   |
   2.       | frotz | knurl |
@wip
   Feature: HTML formatter
   1. Scenario: Everything in fixtures/self_test
   Feature: not everyone is involved
   2. Scenario: Failure is not an option, people
   Feature: sample
   3. Scenario: And yet another Example
   Feature: search examples
   4. Scenario: Generate PDF with pdf formatter


Install


  

Once installed, you can run $ cuporter anywhere on your system. In any project dir, it will read your features/** by default. If you clone the repo, you can run $ ./bin/cuporter from within it.


Command Lines

help


  

Examples


  #  pretty-print demo report to stdout
  

Dependencies

  1. Nokogiri 1.4.1 or above
    • For all things Nodular: XML document building and XSL transformation into HTML
    • Not tested on earlier versions yet but I’d guess you’ll be fine with anything recent.
    • libxml2 and libxslt are required by this gem, which should handle them smoothly. However, libxml and cousins can at times present installation difficulties in the form of clashes with already-installed C resources. It has to do with very specific lib versioning and installation order issues. It’s not always the same problem, so there’s no prescription for it but Google, unfortunately.
  2. Gherkin 1.0.0 or above
    • For looking up keywords Feature, Scenario, Scenario Outline, and Examples by ISO language code.
  3. jQuery and jQueryTreeview
    • packaged with the gem
    • jquery.treeview relies on image files, so our tree view requires the HTML to link to its resources rather than copying them to the <head>.

Acknowledgements

  • Acknowledgements remain due to the Cucumber HTML formatter, and to the human one, too!.
  • Thanks to everyone involved in Nokogiri, jQuery and the Treeview plugin.