O'Reilly logo

Python Testing Cookbook by Greg L. Turnquist

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing a testable story with Robot

As discussed earlier in this chapter, Robot Framework lets us use defined custom keywords.

This gives us the ability to structure keywords in any style. In this recipe, we will define custom keywords that implement the BDD Given-When-Then style of specification.

Getting ready

  1. We first need to activate our virtualenv setup.
  2. For this recipe, we will use the shopping cart application.
  3. Next, we need to install Robot Framework, as shown in the previous sections of this chapter.

How to do it...

The following steps will explore how to write a BDD Given-When-Then style acceptance test.

  1. Create a new file called recipe40.html to contain our HTML tables.
  2. Create a story file in HTML with an opening statement.
  3. Add a table with several ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required