Skip to content

Instantly share code, notes, and snippets.

@nickboyce
Created May 1, 2012 09:42
Show Gist options
  • Save nickboyce/2566849 to your computer and use it in GitHub Desktop.
Save nickboyce/2566849 to your computer and use it in GitHub Desktop.
context "searching" do
before(:all) do
@driver.navigate.to "http://www.easyart.com"
# find <input name="searchquery">
@driver.find_element(name: "searchquery").send_keys("cheese")
# find <input id="search-button"> and click it
@driver.find_element(id: "search-button").click
# wait until the title starts with "cheese"
@wait.until { @driver.find_element(tag_name: "h1").text.downcase.start_with? "cheese" }
end
it "should be able to search for cheese prints" do
# check the title of the page
@driver.find_element(tag_name: "h1").text.should == "cheese art prints and posters"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment