Skip to content

Commit

Permalink
Change appium node to inherit from selenium
Browse files Browse the repository at this point in the history
  • Loading branch information
sbonebrake committed Sep 23, 2014
1 parent a5c95e5 commit 96c72dd
Showing 1 changed file with 1 addition and 41 deletions.
42 changes: 1 addition & 41 deletions lib/appium_capybara/driver/appium/node.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
module Appium::Capybara
class Appium::Capybara::Node < Capybara::Driver::Node
def [](name)
native.attribute(name.to_s)
rescue Selenium::WebDriver::Error::WebDriverError
nil
end

class Appium::Capybara::Node < Capybara::Selenium::Node
def value
native.value
end
Expand All @@ -27,50 +21,16 @@ def send_keys(value)
native.send_keys(value.to_s)
end

def click
native.click
end

def long_press
action = Appium::TouchAction.new
action.long_press(element: native, duration: 2000)
action.perform
end

def tag_name
native.tag_name
end

def visible?
displayed = native.displayed?
displayed && displayed != "false"
end

def selected?
selected = native.selected?
selected && selected != "false"
end

def disabled?
!native.enabled?
end

def find_xpath(locator)
native.find_elements(:xpath, locator).map { |n| self.class.new(driver, n) }
end

def find_css(locator)
native.find_elements(:css, locator).map { |n| self.class.new(driver, n) }
end

def find_custom(finder, locator)
native.find_elements(finder, locator).map { |n| self.class.new(driver, n) }
end

def ==(other)
native == other.native
end

def inspect
%(#<#{self.class} name="#{name}">)
end
Expand Down

0 comments on commit 96c72dd

Please sign in to comment.