Class: Locator::Element::FormElement

Inherits:
Locator::Element show all
Defined in:
lib/locator/element/form_element.rb

Direct Known Subclasses

Input, Select, TextArea

Instance Attribute Summary

Attributes inherited from Locator::Element

#attributes, #css, #locatables, #name

Instance Method Summary collapse

Methods inherited from Locator::Element

#all, #locate, #xpath

Constructor Details

#initialize(name, attributes = {}) ⇒ FormElement

Returns a new instance of FormElement.



4
5
6
7
8
# File 'lib/locator/element/form_element.rb', line 4

def initialize(name, attributes = {})
  attributes[:matches] ||= []
  attributes[:matches] << :name
  super
end

Instance Method Details

#lookup(dom, selector, attributes) ⇒ Object



10
11
12
# File 'lib/locator/element/form_element.rb', line 10

def lookup(dom, selector, attributes)
  super(dom, selector, attributes) + LabeledElement.new(name).send(:lookup, dom, selector, attributes.dup)
end