February 2018
Intermediate to advanced
406 pages
9h 52m
English
In Cucumber you write tests as a series of steps using a minimal language called Gherkin. An individual Cucumber test is called a Scenario, and a group of them is called a Feature.
Let’s take the Capybara integration test from the last section and convert it to Cucumber. Cucumber feature files go in the features directory and typically end in .feature. Here is features_add_task.feature:
| | Feature: Adding a task |
| | |
| | Background: |
| | Given a project |
| | |
| | Scenario: I can add and change the priority of a new task |
| | When I visit the project page |
| | And I complete the new task form |
| | Then I am back on the project page |
| | And I see the new task is last in the list |
| | When I click to move the ... |