BDD with PageObject

Add a data driven scenario of adding book feature

To see how Cucumber run feature which is data driven, we are going to add one scenario in "buy_book.feature" under "features" folder.

cd features

alt text

Then we need to add following content to it.

Scenario Outline: Consumer can add a book to shopping cart
    Given I open "http://www.amazon.com/"
    When I search for ""
    And I open the first book
    And I add the first book to shopping cart
    Then I should see the book in my shopping cart
    Examples:
    | book             |
    | The Lean Startup |
    | Steve Jobs       |

alt text