Comments (12)
released a new ver which has #50
It wraps TouchAction. thanks, @prashanth-sams !
from appium_capybara.
Where the swipe_down
method?
I could not find it in capybara, too.
https://github.com/teamcapybara/capybara/search?q=swipe_down&type=Code
You can implement the action using below 2 ways.
- Use W3C spec action api via Appium client
- Use TouchAction API
from appium_capybara.
you can ask questions in https://discuss.appium.io , too
from appium_capybara.
@KazuCocoa I have got similar error when running swipe method on Android emulator (Touch Action class)
While debugging i also figured that 'require 'appium_lib' (where the swipe method is in) returns false
I use the following as current_driver
0> Capybara.current_driver => :appium
Also i use the following:
appium_lib (10.3.1)
appium_lib_core (3.2.0)
For iOS - to swipe down i used
Capybara.current_session.driver.browser.execute_script('mobile: scroll', direction: 'down')
It worked, however does not work for Android
from appium_capybara.
What about Appium::TouchAction.new(Capybara.current_driver.current_session)
?
I read the source a bit, and the Capybara.current_driver
returns the symbol of driver name managed in the capybara instance.
from appium_capybara.
@KazuCocoa i tried - it returns
0> Capybara.current_driver.current_session
=> undefined method `current_session' for :appium:Symbol
If i try Appium::TouchAction.new(Capybara.current_session) then it returns
0> Capybara.current_session => #<Capybara::Session>
And in method:
`0> Appium::TouchAction.new(Capybara.current_session).swipe(start_x: 725, start_y: 1555, end_x: 688, end_y: 236, duration: 600).perform
=> undefined method `touch_actions' for #<Capybara::Session>`
from appium_capybara.
Maybe, browser method?
It looks returning driver instance.
from appium_capybara.
The problem is - appium_capybara does not contain swipe method in lib
Only scroll_up
or scroll_down
but they are not working on Android with the error:
0> Capybara.current_session.driver.browser.execute_script('mobile: swipe', direction: 'down') => Unknown mobile command "swipe". Only shell,startLogsBroadcast,stopLogsBroadcast,changePermissions,getPermissions,performEditorAction commands are supported.
from appium_capybara.
ah, I understand.
appium_capybara/lib/appium_capybara/driver/appium/driver.rb
Lines 71 to 79 in d684bc1
Thanks.
That is mobile-command, we call, http://appium.io/docs/en/commands/mobile-command/
It can only work xcuitest and espresso driver.
I guess this issue's goal is updating the logic to w3c actions instead of mobile command to work it for both platforms.
from appium_capybara.
@KazuCocoa , do you have any idea about workaround for Android because we are not able to use any appium methods for now due to my comment above.
Thanks in advance
from appium_capybara.
What about W3C actions?
I'm not familiar with Capybara, but if it can call selenium w3c actions, you probably can call it as same.
In general, @driver.action
returns the basic action instance. The @driver
is Selenium/Appium driver instance. Perhaps, it is browser
in Capybara...
Below is an example to scroll which is used in test code in ruby_lib_core.
def w3c_scroll(driver)
window = driver.window_rect
action_builder = driver.action
input = action_builder.pointer_inputs[0]
action_builder
.move_to_location(window.width / 2, window.width * 8 / 10)
.pointer_down(:left)
.pause(input, 1)
.move_to_location(window.width / 2, window.width / 10)
.pause(input, 1)
.release
.perform
end
https://github.com/appium/ruby_lib_core/blob/fd2cbde5466a144ce8dccfc6cf330b969bcc8fd3/test/functional/common_w3c_actions.rb#L16
http://appium.io/docs/en/commands/interactions/actions/
from appium_capybara.
@KazuCocoa fixed in a pull request for this; maybe it is helpful
#50
from appium_capybara.
Related Issues (20)
- appium_driver.start_driver times out HOT 1
- Appium Capybara not supporting native Capybara web methods HOT 2
- I see "Failure/Error: if e = error()" error while running my TC for android using Ruby + Capybara + Appium + Rspec HOT 8
- update capybara to be able to use webdriver 3+ HOT 1
- Not able to call rotate method HOT 2
- Gesture cannot be processed correctly HOT 3
- Update run time dependency for latest version of capybara HOT 5
- wrong number of arguments (given 2, expected 1) using Capybara 3.x HOT 1
- Issue with Capybara 3.19+?
- Getting 'NoMethodError: undefined method `to_sym' for nil:NilClass' error when using Capybara+SitePrism+Appium+Rspec HOT 11
- Incompatibility with Capybara 3.27 HOT 4
- Cant use hide_keyboard on Android native app HOT 5
- Documentation: Is there any? HOT 3
- Is there a way to add parallel execution on emulators/simulators? HOT 2
- Selenium::WebDriver::Error::InvalidElementStateError: Cannot set the element to 'abc'. Did you interact with the correct element? HOT 6
- W3C actions sends wrong action id HOT 28
- wrong number of arguments (given 1, expected 0), when connect to sauce session HOT 1
- update note HOT 1
- check tag_name in Android
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appium_capybara.