2011-02-18 22:53:06 -05:00
|
|
|
class Capybara::Driver::Webkit
|
|
|
|
class Node < Capybara::Driver::Node
|
|
|
|
def text
|
2011-02-25 23:39:29 -05:00
|
|
|
invoke "text"
|
2011-02-18 22:53:06 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def [](name)
|
2011-02-25 23:39:29 -05:00
|
|
|
invoke "attribute", name
|
2011-02-18 22:53:06 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def value
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def set(value)
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def select_option
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def unselect_option
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def click
|
2011-02-26 15:18:11 -05:00
|
|
|
invoke "click"
|
2011-02-18 22:53:06 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def drag_to(element)
|
2011-02-26 16:08:14 -05:00
|
|
|
trigger('mousedown')
|
|
|
|
element.trigger('mousemove')
|
|
|
|
element.trigger('mouseup')
|
2011-02-18 22:53:06 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def tag_name
|
2011-02-26 14:55:40 -05:00
|
|
|
invoke "tagName"
|
2011-02-18 22:53:06 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def visible?
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def path
|
|
|
|
raise NotSupportedByDriverError
|
|
|
|
end
|
|
|
|
|
|
|
|
def trigger(event)
|
2011-02-26 15:50:45 -05:00
|
|
|
invoke "trigger", event
|
2011-02-18 22:53:06 -05:00
|
|
|
end
|
2011-02-25 00:15:08 -05:00
|
|
|
|
2011-02-25 23:39:29 -05:00
|
|
|
def invoke(name, *args)
|
|
|
|
browser.command "Node", name, native, *args
|
2011-02-25 00:15:08 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def browser
|
|
|
|
driver.browser
|
|
|
|
end
|
2011-02-18 22:53:06 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|