Skip to content

Instantly share code, notes, and snippets.

@liangzan
Created April 7, 2010 07:04
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 liangzan/358616 to your computer and use it in GitHub Desktop.
Save liangzan/358616 to your computer and use it in GitHub Desktop.
def find_button(text)
button = $browser.element_by_xpath(%\//input[@value="#{text}"]\)
raise "button #{text} not found" unless button
button
end
Then /^I should not see button "([^\"]+)"$/ do |text|
button = find_button(text) rescue nil
button.should be_nil
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment