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 20Test Scala Code

Problem

You want to test Scala code from Cucumber.

Ingredients

  • Cucumber-JVM,[125] a Cucumber implementation in Java that can test code in any JVM language

  • Cucumber-Scala, support for Scala that ships with Cucumber-JVM

  • JUnit[126] for running your tests

  • Maven[127] for installing these libraries

Solution

Cucumber-JVM is an implementation of the Cucumber test framework written in Java. With it, you can test code written in Scala and other popular JVM languages.

In this recipe, we’re going to create a simple stock broker class in Scala and test it from Cucumber.

Setup

First, download and extract the latest Maven 3 .zip file for your platform.[128] Next, create pom.xml, the build script for your project, with the following ...

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