Making Webrat's usage of the #path Nokogiri method work with Hpricot too
This commit is contained in:
parent
54de30032e
commit
01fcd0dea1
@ -43,7 +43,11 @@ module Webrat
|
|||||||
end
|
end
|
||||||
|
|
||||||
def path
|
def path
|
||||||
@element.path
|
if Webrat.configuration.parse_with_nokogiri?
|
||||||
|
@element.path
|
||||||
|
else
|
||||||
|
@element.xpath
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def matches_id?(id)
|
def matches_id?(id)
|
||||||
|
@ -19,7 +19,15 @@ module Webrat
|
|||||||
end
|
end
|
||||||
|
|
||||||
def field_by_element(element, *field_types)
|
def field_by_element(element, *field_types)
|
||||||
fields_by_type(field_types).detect { |possible_field| possible_field.path == element.path }
|
if Webrat.configuration.parse_with_nokogiri?
|
||||||
|
expected_path = element.path
|
||||||
|
else
|
||||||
|
expected_path = element.xpath
|
||||||
|
end
|
||||||
|
|
||||||
|
fields_by_type(field_types).detect do |possible_field|
|
||||||
|
possible_field.path == element.xpath
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_select_option(option_text)
|
def find_select_option(option_text)
|
||||||
|
Loading…
Reference in New Issue
Block a user