1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00
teamcapybara--capybara/lib/capybara/driver/node.rb

136 lines
2.7 KiB
Ruby
Raw Normal View History

2016-03-07 16:52:19 -08:00
# frozen_string_literal: true
2018-01-08 12:23:54 -08:00
module Capybara
module Driver
class Node
attr_reader :driver, :native, :initial_cache
def initialize(driver, native, initial_cache = {})
@driver = driver
@native = native
@initial_cache = initial_cache
end
def all_text
raise NotImplementedError
end
def visible_text
raise NotImplementedError
end
def [](name)
raise NotImplementedError
end
def value
2010-07-10 03:11:54 +02:00
raise NotImplementedError
end
def style(styles)
raise NotImplementedError
end
# @param value [String, Array] Array is only allowed if node has 'multiple' attribute
# @param options [Hash] Driver specific options for how to set a value on a node
2016-08-17 16:14:39 -07:00
def set(value, **options)
raise NotImplementedError
end
def select_option
raise NotImplementedError
end
def unselect_option
raise NotImplementedError
end
2018-05-17 14:45:53 -07:00
def click(keys = [], **options)
raise NotImplementedError
end
2018-05-17 14:45:53 -07:00
def right_click(keys = [], **options)
raise NotImplementedError
end
2018-05-17 14:45:53 -07:00
def double_click(keys = [], **options)
raise NotImplementedError
end
def send_keys(*args)
raise NotImplementedError
end
2013-02-25 10:37:25 -08:00
def hover
raise NotImplementedError
end
def drag_to(element)
raise NotImplementedError
end
def drop(*args)
raise NotImplementedError
end
def scroll_by(x, y)
raise NotImplementedError
end
def scroll_to(element, alignment, position = nil)
raise NotImplementedError
end
def tag_name
raise NotImplementedError
end
def visible?
raise NotImplementedError
end
def obscured?
raise NotImplementedError
end
def checked?
raise NotImplementedError
end
def selected?
raise NotImplementedError
end
2013-01-29 09:46:56 +00:00
def disabled?
raise NotImplementedError
end
def readonly?
!!self[:readonly]
end
def multiple?
!!self[:multiple]
end
def path
raise NotSupportedByDriverError, 'Capybara::Driver::Node#path'
end
def trigger(event)
raise NotSupportedByDriverError, 'Capybara::Driver::Node#trigger'
end
def inspect
%(#<#{self.class} tag="#{tag_name}" path="#{path}">)
rescue NotSupportedByDriverError
%(#<#{self.class} tag="#{tag_name}">)
end
def ==(other)
raise NotSupportedByDriverError, 'Capybara::Driver::Node#=='
end
end
end
end