Skip to content

Instantly share code, notes, and snippets.

@nhajratw
Created February 6, 2012 19:48
Show Gist options
  • Save nhajratw/1754368 to your computer and use it in GitHub Desktop.
Save nhajratw/1754368 to your computer and use it in GitHub Desktop.
Example of using page objects with radio buttons + wait
class TypeTab
include PageObject
radio_button(:premium_offer_yes, {:name => 'premium-offer', :value => 'true'})
radio_button(:premium_offer_no, {:name => 'premium-offer', :value => 'false'})
# doesn't seem to work in a block
def non_working_select_data
premium_offer_yes_element.when_visible do
# do something useful
end
end
# works fine this way
def working_select_data
premium_offer_yes_element.when_visible
# do useful stuff
end
end
HTML:
<input type="radio" class="premium-offer" name="premium-offer" checked="checked" value="true">
<input type="radio" class="premium-offer" name="premium-offer" value="false">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment