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
|
|
|
|
|
2013-02-17 08:46:37 -05:00
|
|
|
def all_text
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def visible_text
|
2010-07-09 14:08:33 -04:00
|
|
|
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
|
2013-05-10 12:55:17 -04:00
|
|
|
|
|
|
|
def right_click
|
|
|
|
raise NotImplmentedError
|
|
|
|
end
|
|
|
|
|
|
|
|
def double_click
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
2013-02-25 13:37:25 -05:00
|
|
|
def hover
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
2010-07-09 14:08:33 -04:00
|
|
|
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
|
2013-03-08 22:50:27 -05:00
|
|
|
raise NotSupportedByDriverError, 'Capybara::Driver::Node#path'
|
2010-07-09 14:08:33 -04:00
|
|
|
end
|
2013-02-17 08:46:37 -05:00
|
|
|
|
2010-07-09 14:08:33 -04:00
|
|
|
def trigger(event)
|
2013-03-08 22:50:27 -05:00
|
|
|
raise NotSupportedByDriverError, 'Capybara::Driver::Node#trigger'
|
2010-07-09 14:08:33 -04:00
|
|
|
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}">)
|
2014-04-22 12:06:34 -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)
|
2013-03-08 22:50:27 -05:00
|
|
|
raise NotSupportedByDriverError, 'Capybara::Driver::Node#=='
|
2012-11-19 21:57:09 -05:00
|
|
|
end
|
2010-07-09 14:08:33 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|