Class: Webrat::Locators::AreaLocator
- Inherits:
-
Locator
show all
- Defined in:
- lib/webrat/core/locators/area_locator.rb
Overview
Instance Method Summary
collapse
Methods inherited from Locator
#initialize, #locate!
Instance Method Details
#area_element ⇒ Object
12
13
14
15
16
17
|
# File 'lib/webrat/core/locators/area_locator.rb', line 12
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
|
#area_elements ⇒ Object
23
24
25
|
# File 'lib/webrat/core/locators/area_locator.rb', line 23
def area_elements
Webrat::XML.xpath_search(@dom, Area.xpath_search)
end
|
#error_message ⇒ Object
27
28
29
|
# File 'lib/webrat/core/locators/area_locator.rb', line 27
def error_message
"Could not find area with name #{@value}"
end
|
8
9
10
|
# File 'lib/webrat/core/locators/area_locator.rb', line 8
def locate
Area.load(@session, area_element)
end
|
19
20
21
|
# File 'lib/webrat/core/locators/area_locator.rb', line 19
def matcher
/#{Regexp.escape(@value.to_s)}/i
end
|