Skip to Main Content
Cucumber Recipes
book

Cucumber Recipes

by Ian Dees, Matt Wynne, Aslak Hellesoy
February 2013
Intermediate to advanced content levelIntermediate to advanced
272 pages
5h 45m
English
Pragmatic Bookshelf
Content preview from Cucumber Recipes
Recipe 2Generate an RTF Report with a Custom Formatter

Problem

You need the results of your tests to be in a specific format that’s not one of the ones built into Cucumber. For instance, you might need everything typeset in a word processing document or sent to a network service.

Ingredients

  • A Ruby 1.9--compatible update to an old RTF generation library, called clbustos-rtf[16]

  • A word processor for viewing your report

Solution

In situations where you need a specific kind of output, you can write a custom formatter,[17] which is a simple Ruby class that generates the output format you need. All of Cucumber’s built-in formatters—such as HTML and PDF—use the same technique.

This recipe will show you how to write a formatter to generate a minimal ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Cucumber Cookbook

Cucumber Cookbook

Shankar Garg
Basiswissen Softwaretest , 6th Edition

Basiswissen Softwaretest , 6th Edition

Andreas Spillner, Tilo Linz
React Cookbook

React Cookbook

David Griffiths, Dawn Griffiths

Publisher Resources

ISBN: 9781941222607Errata