Created
February 6, 2012 19:48
-
-
Save nhajratw/1754368 to your computer and use it in GitHub Desktop.
Example of using page objects with radio buttons + wait
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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