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