class LessForm::Form

Attributes

wd[R]

Public Class Methods

new(wd) click to toggle source
# File lib/less-form/form.rb, line 5
def initialize wd
        @wd ||= wd if valid_wd?(wd)
end

Public Instance Methods

button(how, what) click to toggle source
# File lib/less-form/form.rb, line 38
def button how, what
        Button.new locate(how, what)
end
checkbox(how, what) click to toggle source
# File lib/less-form/form.rb, line 30
def checkbox how, what
        Checkbox.new locate(how, what)
end
locate(how, what) click to toggle source
# File lib/less-form/form.rb, line 42
def locate how, what
        @wd.find_element(how ,what)
end
radio(how, what) click to toggle source
# File lib/less-form/form.rb, line 22
def radio how, what
        Radio.new locate(how, what)
end
select(how, what) click to toggle source
# File lib/less-form/form.rb, line 34
def select how, what
        Select.new locate(how, what)
end
table(how, what) click to toggle source
# File lib/less-form/form.rb, line 26
def table how, what
        Table.new locate(how, what)
end
text_area(how, what) click to toggle source
# File lib/less-form/form.rb, line 18
def text_area(how, what)
        TextArea.new(locate(how, what))
end
text_field(how, what) click to toggle source
# File lib/less-form/form.rb, line 14
def text_field(how, what)
        TextField.new(locate(how, what))
end
valid_wd?(wd) click to toggle source
# File lib/less-form/form.rb, line 9
def valid_wd?(wd)
        raise InvalidDriverError unless wd.is_a?(Selenium::WebDriver::Driver)
        true
end