Skip to content

5.0.0 finalization. Removal of obsolete code. #660

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

Merged
merged 1 commit into from
Jun 23, 2017
Merged
Show file tree
Hide file tree
Changes from all 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
127 changes: 0 additions & 127 deletions src/main/java/io/appium/java_client/AppiumDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
import org.openqa.selenium.By;
import org.openqa.selenium.Capabilities;
import org.openqa.selenium.DeviceRotation;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.Point;
import org.openqa.selenium.ScreenOrientation;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverException;
Expand Down Expand Up @@ -208,131 +206,6 @@ public List<T> findElementsByXPath(String using) {
return executeMethod;
}

/**
* This method is deprecated and it is going to be removed soon.
*/
@Deprecated
public void tap(int fingers, WebElement element, int duration) {
MultiTouchAction multiTouch = new MultiTouchAction(this);

for (int i = 0; i < fingers; i++) {
TouchAction tap = new TouchAction(this);
multiTouch.add(tap.press(element).waitAction(duration).release());
}

multiTouch.perform();
}

/**
* This method is deprecated and it is going to be removed soon.
*/
@Deprecated
public void tap(int fingers, int x, int y, int duration) {
MultiTouchAction multiTouch = new MultiTouchAction(this);

for (int i = 0; i < fingers; i++) {
TouchAction tap = new TouchAction(this);
multiTouch.add(tap.press(x,y).waitAction(duration).release());
}
multiTouch.perform();
}

/**
* This method is deprecated. It is going to be removed
*/
@Deprecated
public void swipe(int startx, int starty, int endx, int endy, int duration) {
//does nothing
}

/**
* This method is deprecated and it is going to be removed soon.
*/
@Deprecated
public void pinch(WebElement el) {
MultiTouchAction multiTouch = new MultiTouchAction(this);

Dimension dimensions = el.getSize();
Point upperLeft = el.getLocation();
Point center = new Point(upperLeft.getX() + dimensions.getWidth() / 2,
upperLeft.getY() + dimensions.getHeight() / 2);
int yOffset = center.getY() - upperLeft.getY();

TouchAction action0 =
new TouchAction(this).press(el, center.getX(), center.getY() - yOffset).moveTo(el)
.release();
TouchAction action1 =
new TouchAction(this).press(el, center.getX(), center.getY() + yOffset).moveTo(el)
.release();

multiTouch.add(action0).add(action1).perform();
}

/**
* This method is deprecated and it is going to be removed soon.
*/
@Deprecated
public void pinch(int x, int y) {
MultiTouchAction multiTouch = new MultiTouchAction(this);

int scrHeight = this.manage().window().getSize().getHeight();
int yOffset = 100;

if (y - 100 < 0) {
yOffset = y;
} else if (y + 100 > scrHeight) {
yOffset = scrHeight - y;
}

TouchAction action0 = new TouchAction(this).press(x, y - yOffset).moveTo(x, y).release();
TouchAction action1 = new TouchAction(this).press(x, y + yOffset).moveTo(x, y).release();

multiTouch.add(action0).add(action1).perform();
}

/**
* This method is deprecated and it is going to be removed soon.
*/
@Deprecated
public void zoom(WebElement el) {
MultiTouchAction multiTouch = new MultiTouchAction(this);

Dimension dimensions = el.getSize();
Point upperLeft = el.getLocation();
Point center = new Point(upperLeft.getX() + dimensions.getWidth() / 2,
upperLeft.getY() + dimensions.getHeight() / 2);
int yOffset = center.getY() - upperLeft.getY();

TouchAction action0 = new TouchAction(this).press(center.getX(), center.getY())
.moveTo(el, center.getX(), center.getY() - yOffset).release();
TouchAction action1 = new TouchAction(this).press(center.getX(), center.getY())
.moveTo(el, center.getX(), center.getY() + yOffset).release();

multiTouch.add(action0).add(action1).perform();
}

/**
* This method is deprecated and it is going to be removed soon.
*/
@Deprecated
public void zoom(int x, int y) {
MultiTouchAction multiTouch = new MultiTouchAction(this);

int scrHeight = this.manage().window().getSize().getHeight();
int yOffset = 100;

if (y - 100 < 0) {
yOffset = y;
} else if (y + 100 > scrHeight) {
yOffset = scrHeight - y;
}

TouchAction action0 = new TouchAction(this).press(x, y).moveTo(0, -yOffset).release();
TouchAction action1 = new TouchAction(this).press(x, y).moveTo(0, yOffset).release();

multiTouch.add(action0).add(action1).perform();
}

@Override public WebDriver context(String name) {
checkNotNull(name, "Must supply a context name");
execute(DriverCommand.SWITCH_TO_CONTEXT, ImmutableMap.of("name", name));
Expand Down
38 changes: 0 additions & 38 deletions src/main/java/io/appium/java_client/AppiumSetting.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ abstract class DefaultGenericMobileElement<T extends WebElement> extends RemoteW
implements FindsByClassName,
FindsByCssSelector, FindsById,
FindsByLinkText, FindsByName, FindsByTagName, FindsByXPath, FindsByFluentSelector<T>, FindsByAccessibilityId<T>,
ExecutesMethod, TouchableElement<T> {
ExecutesMethod {

@Override public Response execute(String driverCommand, Map<String, ?> parameters) {
return super.execute(driverCommand, parameters);
Expand Down
49 changes: 0 additions & 49 deletions src/main/java/io/appium/java_client/DeviceActionShortcuts.java

This file was deleted.

13 changes: 0 additions & 13 deletions src/main/java/io/appium/java_client/InteractsWithApps.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,6 @@ default void resetApp() {
execute(RESET);
}

/**
* Runs the current app as a background app for the number of seconds
* requested. This is a synchronous method, it returns after the back has
* been returned to the foreground.
* This method is deprecated. Please use {@link #runAppInBackground(Duration)} instead.
*
* @param seconds Number of seconds to run App in background.
*/
@Deprecated
default void runAppInBackground(int seconds) {
runAppInBackground(Duration.ofSeconds(seconds));
}

/**
* Runs the current app as a background app for the time
* requested. This is a synchronous method, it returns after the back has
Expand Down
14 changes: 0 additions & 14 deletions src/main/java/io/appium/java_client/MobileCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -328,20 +328,6 @@ public static ImmutableMap<String, Object> prepareArguments(String[] params,
LONG_PRESS_KEY_CODE, prepareArguments(parameters, values));
}

/**
* This method forms a {@link java.util.Map} of parameters for the
* device locking.
* The method is deprecated. Please use {@link #lockDeviceCommand(Duration)} instead.
*
* @param seconds seconds number of seconds to lock the screen for
* @return a key-value pair. The key is the command name. The value is a
* {@link java.util.Map} command arguments.
*/
@Deprecated
public static Map.Entry<String, Map<String, ?>> lockDeviceCommand(int seconds) {
return lockDeviceCommand(Duration.ofSeconds(seconds));
}

/**
* This method forms a {@link java.util.Map} of parameters for the
* device locking.
Expand Down
41 changes: 0 additions & 41 deletions src/main/java/io/appium/java_client/MobileElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,47 +42,6 @@ public Point getCenter() {
upperLeft.getY() + dimensions.getHeight() / 2);
}

/**
* This method is deprecated and it is going to be removed soon.
*/
@Deprecated
@Override public void tap(int fingers, int duration) {
AppiumDriver.class.cast(parent).tap(fingers, this, duration);
}

/**
* This method is deprecated and it is going to be removed soon.
*/
@Deprecated
@Override public void pinch() {
AppiumDriver.class.cast(parent).pinch(this);
}

/**
* This method is deprecated and it is going to be removed soon.
*/
@Deprecated
@Override public void zoom() {
AppiumDriver.class.cast(parent).zoom(this);
}

/**
* This method does nothing. It is going to be removed.
*/
@Deprecated
@Override public void swipe(SwipeElementDirection direction, int duration) {
direction.swipe(AppiumDriver.class.cast(parent), this, 0, 0, duration);
}

/**
* This method does nothing. It is going to be removed.
*/
@Deprecated
@Override public void swipe(SwipeElementDirection direction, int offsetFromStartBorder,
int offsetFromEndBorder, int duration) throws IllegalCoordinatesException {
direction.swipe(AppiumDriver.class.cast(parent), this, offsetFromStartBorder, offsetFromEndBorder, duration);
}

@Override public List<MobileElement> findElements(By by) {
return super.findElements(by);
}
Expand Down
Loading