Sha256: 74c4f0ccd5142aacb7a853607cf30f7b982aa84a8dcdbd2b96936eddd9d0be4a
Contents?: true
Size: 785 Bytes
Versions: 49
Compression:
Stored size: 785 Bytes
Contents
require "webrat/core/locators/locator" module Webrat module Locators class AreaLocator < Locator # :nodoc: def locate Area.load(@session, area_element) end def area_element area_elements.detect do |area_element| Webrat::XML.attribute(area_element, "title") =~ matcher || Webrat::XML.attribute(area_element, "id") =~ matcher end end def matcher /#{Regexp.escape(@value.to_s)}/i end def area_elements Webrat::XML.xpath_search(@dom, Area.xpath_search) end def error_message "Could not find area with name #{@value}" end end def find_area(id_or_title) #:nodoc: AreaLocator.new(@session, dom, id_or_title).locate! end end end
Version data entries
49 entries across 49 versions & 21 rubygems