appium / appium_capybara

Gem enabling appium support in capybara
40 stars 35 forks source link

Gesture cannot be processed correctly #35

Closed NikitaSmall closed 5 years ago

NikitaSmall commented 6 years ago

Good day,

We use appium, capybara, and this gem to test iOS application. The problem is that we can't use gestures (touch action especially) in our tests. We tried to perform it like this:

current_driver = Capybara.current_session.driver
Appium::TouchAction.new(current_driver).tap(x: 45, y: 110, duration: 1000).release.perform

But we got this error:

NoMethodError:
       undefined method `touch_actions' for #<Appium::Capybara::Driver:0x007f8575e1a760>

Do you have any other options to fire this action on?

More details about initialization:

Nothing really specific. We initialize driver like this:

# options is a hash of capabilities.
options = {
  caps: {
    platformName: 'ios',
    deviceName: 'iPhone X',
    platformVersion: '11.0',
    automationName: 'XCUITest',
    app: path_to_app
  }
}
Capybara.register_driver(:appium_ios) do |app|
    Appium::Capybara::Driver.new(app, options)
end

Capybara.default_driver = :appium_ios
KazuCocoa commented 6 years ago

@NikitaSmall Could you attach the following versions?

In addition, XCUITest haven't support Appium::TouchAction.new yet.

genious234 commented 5 years ago

I am using capybara and appium driver Appium::TouchAction.new(current_driver) is working fine for uiautomator2 tests.

KazuCocoa commented 5 years ago

thanks 👍 Will close this for now. Please create a new one