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 1Compare and Transform Tables of Data

Problem

Your tests are in English, but your data is in HTML. What you and your stakeholders call a last name, your app calls customer_name_last. What you call February 24, your app calls 2012-02-24T10:24:57-08:00. You need to translate between the two.

Ingredients

  • Ast::Table,[13] Cucumber’s table-crunching workhorse

  • Ruby’s built-in BigDecimal for representing currencies[14]

Solution

In this recipe, we’ll assume we’re getting data from our app using a GUI automation library or web scraping framework. The data will be in whatever format the behind-the-scenes API provides. This format may be grisly, so we don’t want it in our human-readable Cucumber tests.

How do we address this mismatch between ...

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