BDD with PageObject

Add step definitions to support sample feature

Create "sample.rb" to support sample feature under "features/step_definations" folder:

cd step_definitions

touch sample.rb

alt text

Copy content of previous sample.rb to the new one:

require 'selenium-webdriver'
driver = Selenium::WebDriver.for :firefox
driver.get ""
element = driver.find_element :name => "q"
element.send_keys "Cheese!"
p "Page title is #{driver.title}"
wait = => 10)
wait.until { driver.title.downcase.start_with? "cheese!" }
p "Page title is #{driver.title}"

alt text