lib/page-object/platforms/selenium/page_object.rb in page-object-0.2.3 vs lib/page-object/platforms/selenium/page_object.rb in page-object-0.2.4
- old
+ new
@@ -112,10 +112,26 @@
def refresh
@browser.navigate.refresh
end
#
+ # platform method to go back to the previous page
+ # See PageObject#back
+ #
+ def back
+ @browser.navigate.back
+ end
+
+ #
+ # platform method to go forward to the next page
+ # See PageObject#forward
+ #
+ def forward
+ @browser.navigate.forward
+ end
+
+ #
# platform method to get the value stored in a text field
# See PageObject::Accessors#text_field
#
def text_field_value_for(identifier)
how, what, frame_identifiers = parse_identifiers(identifier, Elements::TextField, 'input', :type => 'text')
@@ -559,11 +575,11 @@
def supported_identifier(identifier, tag, additional)
return false if identifier[:index]
return false if identifier[:text] and tag == 'input' and additional[:type] == 'hidden'
return false if identifier[:href] and tag == 'a'
- return false if identifier[:text] and tag == 'div'
- return false if identifier[:text] and tag == 'td'
+ return false if identifier[:text] and ['div', 'span', 'td'].include? tag
+ return false if identifier[:value] and tag == 'input' and additional[:type] == 'submit'
true
end
def switch_to_frame(frame_identifiers)
if not frame_identifiers.nil?