Bump appium java-client to 5.0.3 - #368
Conversation
- Also updated the swipe and tap methods of SeLionAppiumAndroidDriver and SeLionAppiumIOSDriver to use TouchActions -- both methods were removed from appium java-client - Removed no-op rotation methods which now have implmentations in appium java-cient
|
@vikram1711 @elhuang can I also solicit your review of this change set? |
| multiTouch.add(tap.press(x, y).waitAction(Duration.ofMillis(duration)).release()); | ||
| } | ||
| multiTouch.perform(); | ||
| } |
There was a problem hiding this comment.
Can you please confirm if it is multi finger tap or multi tap action or combination of both?
Based on my observation it is behaving like multi finger multi tap action.
Above implementation completely depends on the duration parameter for example if I want to perform a double tap with duration 200ms, this will become two long press actions, but if I perform a double tap action with 30ms then that will be treated as double tap.
My suggestion would be not use raw actions rather use tap action exposed by TouchAction api-
Ex-
MultiTouchAction multiTouch = new MultiTouchAction(driver);
for (int i = 0; i < fingers; i++) {
TouchAction action = new TouchAction(driver);
multiTouch.add(action.tap(element));
}
multiTouch.perform();
There was a problem hiding this comment.
Observation : Most of the methods are expecting WebElement as an argument, so in test first you have to grab the WebElement instance and then only you can invoke these methods. Why can't we follow the same approach we have taken for HTML elements where we are invoking the findElement internally to grab the element reference. I am not sure if that would violate the design of the framework.
| this.tap(1, starty, endx, OPERATION_DURATION_MILLI_SECONDS); | ||
| public void swipe(int startx, int starty, int endx, int endy, int duration) { | ||
| new TouchAction(this).press(startx, starty).waitAction(Duration.ofMillis(duration)).moveTo(endx, endy).release().perform(); | ||
| } |
There was a problem hiding this comment.
endx and endy - these are not absolute x,y value rather they represent the shift in x and y axis. So renaming them to shiftX and shiftY would make more sense
Also, consider a situation where you are swiping a carousel, most of the time you would be interested to go to a certain carousel content. To solve this problem if we can add a swipeCount argument then the author of the test can easily decide how many swipe is needed to go to the desired content, by default it will swipe only once.
| .tap(webElement).release() | ||
| .perform(); | ||
| new TouchAction(this).tap(webElement).release().waitAction(Duration.ofMillis(DOUBLE_TAP_WAIT_TIME)) | ||
| .tap(webElement).release().perform(); |
There was a problem hiding this comment.
I would recommend to use appium provided doubleTap for iOS -
new IOSTouchAction(this).doubleTap(webElement).perform();
|
|
||
| multiTouch.perform(); | ||
| } | ||
|
|
There was a problem hiding this comment.
I still need to test this action before I can comment on it since I am not sure if it is multi finger or multi tap action.
There was a problem hiding this comment.
I believe these are all multi finger actions.
Xin the preceding checkbox, I verify that I am a PayPal employee orI have signed the Contributor License Agreement
Bump appium java-client to 5.0.3
SeLionAppiumIOSDriver to use TouchActions -- both methods were removed
from appium java-client
java-cient