Class: Webrat::Locators::FieldByIdLocator
- Inherits:
-
Locator
show all
- Defined in:
- lib/webrat/core/locators/field_by_id_locator.rb
Overview
Instance Method Summary
collapse
Methods inherited from Locator
#initialize, #locate!
Instance Method Details
#error_message ⇒ Object
26
27
28
|
# File 'lib/webrat/core/locators/field_by_id_locator.rb', line 26
def error_message
"Could not find field with id #{@value.inspect}"
end
|
#field_element ⇒ Object
12
13
14
15
16
17
18
19
20
|
# File 'lib/webrat/core/locators/field_by_id_locator.rb', line 12
def field_element
field_elements.detect do |field_element|
if @value.is_a?(Regexp)
field_element["id"] =~ @value
else
field_element["id"] == @value.to_s
end
end
end
|
#field_elements ⇒ Object
22
23
24
|
# File 'lib/webrat/core/locators/field_by_id_locator.rb', line 22
def field_elements
@dom.xpath(*Field.xpath_search)
end
|
8
9
10
|
# File 'lib/webrat/core/locators/field_by_id_locator.rb', line 8
def locate
Field.load(@session, field_element)
end
|