Skip to content

Instantly share code, notes, and snippets.

@SihemBouhenniche
Created August 6, 2019 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SihemBouhenniche/a6209830566a169a05c3f90d4d33b9ce to your computer and use it in GitHub Desktop.
Save SihemBouhenniche/a6209830566a169a05c3f90d4d33b9ce to your computer and use it in GitHub Desktop.
Behavior driven design (BDD) example on web applications with cucumber and ruby
When(/^I click on search button$/) do
GoogleHomeHelpers.submit
end
Then(/^I can type "(.+)" in search field$/) do |value|
GoogleHomeHelpers.fill_keyword(value)
end
And(/^I click on first suggestion$/) do
GoogleHomeHelpers.click_first_suggestion
end
When(/^I am on google home page$/) do
NavigationHelpers.load_google_home
end
Then(/^I get "(.+)" in search results$/) do |value|
expect(page).to have_content(value)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment