2010-07-09 14:08:33 -04:00
|
|
|
module Capybara
|
|
|
|
module Driver
|
|
|
|
class Node
|
2010-07-15 14:55:12 -04:00
|
|
|
attr_reader :driver, :native
|
2010-07-09 14:08:33 -04:00
|
|
|
|
2010-07-15 14:55:12 -04:00
|
|
|
def initialize(driver, native)
|
2010-07-09 14:08:33 -04:00
|
|
|
@driver = driver
|
2010-07-15 14:55:12 -04:00
|
|
|
@native = native
|
2010-07-09 14:08:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def text
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def [](name)
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def value
|
2010-07-09 21:11:54 -04:00
|
|
|
raise NotImplementedError
|
2010-07-09 14:08:33 -04:00
|
|
|
end
|
|
|
|
|
2012-09-17 08:48:13 -04:00
|
|
|
# @param value String or Array. Array is only allowed if node has 'multiple' attribute
|
2010-07-09 14:08:33 -04:00
|
|
|
def set(value)
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
2010-08-14 07:42:53 -04:00
|
|
|
def select_option
|
2010-07-09 14:08:33 -04:00
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
2010-08-14 07:42:53 -04:00
|
|
|
def unselect_option
|
2010-07-09 14:08:33 -04:00
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def click
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def drag_to(element)
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def tag_name
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def visible?
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
2010-12-23 13:38:44 -05:00
|
|
|
def checked?
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def selected?
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
2013-01-29 04:46:56 -05:00
|
|
|
def disabled?
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
2010-07-09 14:08:33 -04:00
|
|
|
def path
|
|
|
|
raise NotSupportedByDriverError
|
|
|
|
end
|
|
|
|
|
|
|
|
def trigger(event)
|
|
|
|
raise NotSupportedByDriverError
|
|
|
|
end
|
2010-07-10 10:34:33 -04:00
|
|
|
|
|
|
|
def inspect
|
2012-06-21 07:26:33 -04:00
|
|
|
%(#<#{self.class} tag="#{tag_name}" path="#{path}">)
|
2010-07-10 10:34:33 -04:00
|
|
|
rescue NotSupportedByDriverError
|
2012-06-21 07:26:33 -04:00
|
|
|
%(#<#{self.class} tag="#{tag_name}">)
|
2010-07-10 10:34:33 -04:00
|
|
|
end
|
2012-11-19 21:57:09 -05:00
|
|
|
|
|
|
|
def ==(other)
|
|
|
|
raise NotSupportedByDriverError
|
|
|
|
end
|
2010-07-09 14:08:33 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|