BDD with PageObject

Extract search keyword as a parameter

In "sample.feature", we need to change the step to:

When I search a "Cheese!"

alt text

And in "sample.rb", we need to change the step to:

When /I search a "(.*?)"/ do |keyword|
    element = @driver.find_element :name => "q"
    element.send_keys keyword
    element.submit
end

alt text