The Git tag for this section is cucumber-data-tables.
Let's quickly look at one more feature of Cucumber that you can use within your tests: data tables. We'll write another test that will pass in our system, before we move on to new functionalities in the next chapter:
- Create a new feature file called features/drawing.feature. Write out the following content. It contains a set of instructions to draw a square using a Logo function. You'll note I'm using a small side length of 10; that's to make sure the animation occurs quickly:
Feature: Drawing
A user can draw shapes by entering commands at the prompt.
Scenario: Drawing functions
Given the user navigated to the application page
When the user enters the following instructions at the prompt:
| to drawsquare |
| repeat 4 [ forward 10 right 90 ] |
...