Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Deprecate touch actions #1569

Merged
merged 4 commits into from
Oct 31, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/main/java/io/appium/java_client/PerformsTouchActions.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@
import java.util.List;
import java.util.Map;

/**
* Touch actions are deprecated.
* Please use W3C Actions instead or the corresponding
* extension methods for the driver (if available).
* Check
* - https://www.youtube.com/watch?v=oAJ7jwMNFVU
* - https://appiumpro.com/editions/30-ios-specific-touch-action-methods
* - https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api
* for more details.
*/
@Deprecated
@SuppressWarnings({"unchecked", "rawtypes"})
public interface PerformsTouchActions extends ExecutesMethod {
/**
* Performs a chain of touch actions, which together can be considered an
Expand Down Expand Up @@ -53,9 +65,9 @@ default TouchAction performTouchAction(TouchAction touchAction) {
*
* @param multiAction the MultiTouchAction object to perform.
*/
default void performMultiTouchAction(MultiTouchAction multiAction) {
default MultiTouchAction performMultiTouchAction(MultiTouchAction multiAction) {
Map<String, List<Object>> parameters = multiAction.getParameters();
execute(PERFORM_MULTI_TOUCH, parameters);
multiAction.clearActions();
return multiAction.clearActions();
}
}
10 changes: 10 additions & 0 deletions src/main/java/io/appium/java_client/TouchAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,17 @@
* action.press(element).waitAction(300).moveTo(element1).release().perform();
* Calling perform() sends the action command to the Mobile Driver. Otherwise,
* more and more actions can be chained.
*
* Touch actions are deprecated.
* Please use W3C Actions instead or the corresponding
* extension methods for the driver (if available).
* Check
* - https://www.youtube.com/watch?v=oAJ7jwMNFVU
* - https://appiumpro.com/editions/30-ios-specific-touch-action-methods
* - https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api
* for more details.
*/
@Deprecated
public class TouchAction<T extends TouchAction<T>> implements PerformsActions<T> {

protected ImmutableList.Builder<ActionParameter> parameterBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@
import io.appium.java_client.TouchAction;


/**
* Touch actions are deprecated.
* Please use W3C Actions instead or the corresponding
* extension methods for the driver (if available).
* Check
* - https://www.youtube.com/watch?v=oAJ7jwMNFVU
* - https://appiumpro.com/editions/30-ios-specific-touch-action-methods
* - https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api
* for more details.
*/
@Deprecated
public class AndroidTouchAction extends TouchAction<AndroidTouchAction> {

public AndroidTouchAction(PerformsTouchActions performsTouchActions) {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/io/appium/java_client/ios/IOSDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@

/**
* iOS driver implementation.
*
*/
public class IOSDriver extends AppiumDriver implements
SupportsContextSwitching,
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/io/appium/java_client/ios/IOSTouchAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@
import io.appium.java_client.touch.offset.ElementOption;
import io.appium.java_client.touch.offset.PointOption;

/**
* Touch actions are deprecated.
* Please use W3C Actions instead or the corresponding
* extension methods for the driver (if available).
* Check
* - https://www.youtube.com/watch?v=oAJ7jwMNFVU
* - https://appiumpro.com/editions/30-ios-specific-touch-action-methods
* - https://appiumpro.com/editions/29-automating-complex-gestures-with-the-w3c-actions-api
* for more details.
*/
@Deprecated
public class IOSTouchAction extends TouchAction<IOSTouchAction> {

public IOSTouchAction(PerformsTouchActions performsTouchActions) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/io/appium/java_client/mac/Mac2Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.appium.java_client.mac;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.PerformsTouchActions;
import io.appium.java_client.internal.CapabilityHelpers;
import io.appium.java_client.remote.AutomationName;
import io.appium.java_client.remote.MobileCapabilityType;
Expand All @@ -43,6 +44,7 @@
* @since Appium 1.20.0
*/
public class Mac2Driver extends AppiumDriver implements
PerformsTouchActions,
CanRecordScreen {
public Mac2Driver(HttpCommandExecutor executor, Capabilities capabilities) {
super(executor, prepareCaps(capabilities));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.HidesKeyboardWithKeyName;
import io.appium.java_client.PerformsTouchActions;
import io.appium.java_client.screenrecording.CanRecordScreen;
import io.appium.java_client.service.local.AppiumDriverLocalService;
import io.appium.java_client.service.local.AppiumServiceBuilder;
Expand All @@ -30,6 +31,7 @@
import java.net.URL;

public class WindowsDriver extends AppiumDriver implements
PerformsTouchActions,
PressesKeyCode,
HidesKeyboardWithKeyName,
CanRecordScreen {
Expand Down