1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00
capybara-webkit/lib/capybara/driver/webkit/node.rb

63 lines
956 B
Ruby
Raw Normal View History

2011-02-18 22:53:06 -05:00
class Capybara::Driver::Webkit
class Node < Capybara::Driver::Node
def text
invoke "text"
2011-02-18 22:53:06 -05:00
end
def [](name)
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
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