Skip to content

Commit cb8a80e

Browse files
Merge pull request #548 from TikhomirovSergey/master
Updated dependencies
2 parents 0009641 + 149ab84 commit cb8a80e

File tree

7 files changed

+41
-98
lines changed

7 files changed

+41
-98
lines changed

README.md

+13-68
Original file line numberDiff line numberDiff line change
@@ -7,75 +7,17 @@
77

88
This is the Java language binding for writing Appium Tests, conforms to [Mobile JSON Wire Protocol](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md)
99

10-
[How to install it and to use it](https://github.com/appium/java-client/blob/master/docs/Installing-the-project.md)
11-
1210
[API docs](http://appium.github.io/java-client/)
1311

14-
###Structure###
15-
16-
There is an abstract `io.appium.java_client.AppiumDriver` class which extends `org.openqa.selenium.remote.RemoteWebDriver`
17-
from the Selenium Java Client. The `io.appium.java_client.AppiumDriver` class contains all methods shared by iOS and Android.
18-
`io.appium.java_client.ios.IOSDriver` and `io.appium.java_client.android.AndroidDriver` both extend `io.appium.java_client.AppiumDriver`
19-
and provide more methods, and specific implementations for some methods.
20-
21-
In the same way, `io.appium.java_client.ios.IOSElement` and `io.appium.java_client.android.AndroidElement` both are subclasses of
22-
`io.appium.java_client.MobileElement`
23-
24-
25-
###Added functions###
26-
More can be found in the docs, but here's a quick list of features which this project has added to the usual selenium binding.
27-
28-
29-
- startActivity()
30-
- resetApp()
31-
- getAppStringMap()
32-
- pressKeyCode()
33-
- longPressKeyCode()
34-
- longPressKey()
35-
- currentActivity()
36-
- getDeviceTime()
37-
- pullFile()
38-
- pushFile()
39-
- pullFolder()
40-
- replaceValue()
41-
- hideKeyboard()
42-
- runAppInBackground()
43-
- performTouchAction()
44-
- performMultiTouchAction()
45-
- tap()
46-
- swipe()
47-
- pinch()
48-
- zoom()
49-
- isAppInstalled()
50-
- installApp()
51-
- removeApp()
52-
- launchApp()
53-
- closeApp()
54-
- endTestCoverage()
55-
- isLocked()
56-
- shake()
57-
- getSessionDetails()
58-
- openNotifications()
59-
- Context Switching: .context(), .getContextHandles(), getContext())
60-
- setConnection(), getConnection()
61-
- ignoreUnimportantViews(), getSettings()
62-
- toggleLocationServices()
63-
- lockDevice()
64-
- unlockDevice()
65-
66-
Locators:
67-
- findElementByAccessibilityId()
68-
- findElementsByAccessibilityId()
69-
- findElementByIosUIAutomation()
70-
- findElementsByIosUIAutomation()
71-
- findElementByAndroidUIAutomator()
72-
- findElementsByAndroidUIAutomator()
73-
74-
### Features and other interesting information###
75-
76-
You can get it on [WIKI](https://github.com/appium/java-client/wiki)
77-
78-
## Changelog#
12+
###Features and other interesting information###
13+
14+
[Tech stack](https://github.com/appium/java-client/blob/master/docs/Tech-stack.md)
15+
16+
[How to install the project](https://github.com/appium/java-client/blob/master/docs/Installing-the-project.md)
17+
18+
[WIKI](https://github.com/appium/java-client/wiki)
19+
20+
##Changelog##
7921
*5.0.0 (under construction yet)*
8022
- **[MAJOR ENHANCEMENT]**: Migration to Java 8. Epic: [#399](https://github.com/appium/java-client/issues/399)
8123
- API with default implementation. PR [#470](https://github.com/appium/java-client/pull/470)
@@ -156,7 +98,6 @@ You can get it on [WIKI](https://github.com/appium/java-client/wiki)
15698

15799
- [ENHANCEMENT] Added the ability to set UiAutomator Congfigurator values. [#410](https://github.com/appium/java-client/pull/410).
158100
[#477](https://github.com/appium/java-client/pull/477).
159-
- **[UPDATE]** to Selenium 3.0. [#489](https://github.com/appium/java-client/pull/489)
160101
- [ENHANCEMENT]. Additional methods which perform device rotation were implemented. [#489](https://github.com/appium/java-client/pull/489). [#439](https://github.com/appium/java-client/pull/439). But it works for iOS in XCUIT mode and for Android in UIAutomator2 mode only. The feature request: [#7131](https://github.com/appium/appium/issues/7131)
161102
- [ENHANCEMENT]. TouchID Implementation (iOS Sim Only). Details: [#509](https://github.com/appium/java-client/pull/509)
162103
- [ENHANCEMENT]. The ability to use port, ip and log file as server arguments was provided. Feature request: [#521](https://github.com/appium/java-client/issues/521). Fixes: [#522](https://github.com/appium/java-client/issues/522), [#524](https://github.com/appium/java-client/issues/524).
@@ -183,6 +124,10 @@ You can get it on [WIKI](https://github.com/appium/java-client/wiki)
183124
- `IOSMobileCapabilityType#WEB_DRIVER_AGENT_URL`
184125
- `IOSMobileCapabilityType#KEYCHAIN_PATH`
185126
- `MobileCapabilityType#CLEAR_SYSTEM_FILES`
127+
- **[UPDATE]** to Selenium 3.0.1.
128+
- **[UPDATE]** to Spring Framework 4.3.5.RELEASE.
129+
- **[UPDATE]** to AspectJ weaver 1.8.10.
130+
186131

187132

188133
*4.1.2*

build.gradle

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ apply plugin: 'checkstyle'
66
apply plugin: 'signing'
77

88
group 'io.appium'
9-
version '5.0.0-SNAPSHOT'
9+
version '5.0.0-BETA1'
1010

1111
repositories {
1212
jcenter()
@@ -50,19 +50,19 @@ compileJava {
5050
}
5151

5252
dependencies {
53-
compile('org.seleniumhq.selenium:selenium-java:3.0.0'){
53+
compile('org.seleniumhq.selenium:selenium-java:3.0.1'){
5454
exclude module: 'cglib'
5555
exclude group: 'com.google.code.gson'
5656
}
57-
compile 'com.google.code.gson:gson:2.7'
57+
compile 'com.google.code.gson:gson:2.8.0'
5858
compile 'org.apache.httpcomponents:httpclient:4.5.2'
59-
compile 'com.google.guava:guava:19.0'
59+
compile 'com.google.guava:guava:20.0'
6060
compile 'cglib:cglib:3.2.4'
6161
compile 'commons-validator:commons-validator:1.5.1'
62-
compile 'org.apache.commons:commons-lang3:3.4'
62+
compile 'org.apache.commons:commons-lang3:3.5'
6363
compile 'commons-io:commons-io:2.5'
64-
compile 'org.springframework:spring-context:4.3.2.RELEASE'
65-
compile 'org.aspectj:aspectjweaver:1.8.9'
64+
compile 'org.springframework:spring-context:4.3.5.RELEASE'
65+
compile 'org.aspectj:aspectjweaver:1.8.10'
6666

6767
testCompile 'junit:junit:4.12'
6868
}

src/main/java/io/appium/java_client/PerformsActions.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package io.appium.java_client;
1818

19-
public interface PerformsActions<T extends PerformsActions> {
19+
public interface PerformsActions<T extends PerformsActions<T>> {
2020

2121
T perform();
2222
}

src/main/java/io/appium/java_client/service/local/AppiumDriverLocalService.java

+8-14
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public final class AppiumDriverLocalService extends DriverService {
4848
private final TimeUnit timeUnit;
4949
private final ReentrantLock lock = new ReentrantLock(true); //uses "fair" thread ordering policy
5050
private final ListOutputStream stream = new ListOutputStream().add(System.out);
51+
private final URL url;
5152

5253

5354

@@ -64,6 +65,7 @@ public final class AppiumDriverLocalService extends DriverService {
6465
this.nodeJSEnvironment = nodeJSEnvironment;
6566
this.startupTimeout = startupTimeout;
6667
this.timeUnit = timeUnit;
68+
this.url = new URL(String.format(URL_MASK, this.ipAddress, this.nodeJSPort));
6769
}
6870

6971
public static AppiumDriverLocalService buildDefaultService() {
@@ -78,11 +80,7 @@ public static AppiumDriverLocalService buildService(AppiumServiceBuilder builder
7880
* @return The base URL for the managed appium server.
7981
*/
8082
@Override public URL getUrl() {
81-
try {
82-
return new URL(String.format(URL_MASK, ipAddress, nodeJSPort));
83-
} catch (MalformedURLException e) {
84-
throw new RuntimeException(e);
85-
}
83+
return url;
8684
}
8785

8886
@Override public boolean isRunning() {
@@ -101,22 +99,18 @@ public static AppiumDriverLocalService buildService(AppiumServiceBuilder builder
10199
return true;
102100
} catch (UrlChecker.TimeoutException e) {
103101
return false;
102+
} catch (MalformedURLException e) {
103+
throw new AppiumServerHasNotBeenStartedLocallyException(e.getMessage(), e);
104104
}
105105
} finally {
106106
lock.unlock();
107107
}
108108

109109
}
110110

111-
private void ping(long time, TimeUnit timeUnit) throws UrlChecker.TimeoutException {
112-
URL url = getUrl();
113-
try {
114-
URL status = new URL(url.toString() + "/status");
115-
new UrlChecker().waitUntilAvailable(time, timeUnit, status);
116-
} catch (MalformedURLException e) {
117-
throw new RuntimeException(
118-
"There is something wrong with the URL " + url.toString().toString() + "/status");
119-
}
111+
private void ping(long time, TimeUnit timeUnit) throws UrlChecker.TimeoutException, MalformedURLException {
112+
URL status = new URL(url.toString() + "/status");
113+
new UrlChecker().waitUntilAvailable(time, timeUnit, status);
120114
}
121115

122116
/**

src/test/java/io/appium/java_client/localserver/ThreadSafetyTest.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,27 @@
44
import static org.junit.Assert.assertTrue;
55

66
import io.appium.java_client.service.local.AppiumDriverLocalService;
7+
import io.appium.java_client.service.local.AppiumServerHasNotBeenStartedLocallyException;
78
import org.junit.Test;
89

910
public class ThreadSafetyTest {
1011

1112
private final AppiumDriverLocalService service = AppiumDriverLocalService.buildDefaultService();
1213
private final Action run = new Action() {
13-
@Override Object perform() {
14+
@Override protected Object perform() {
1415
service.start();
1516
return "OK";
1617
}
1718
};
1819
private final Action run2 = run.clone();
1920
private final Action isRunning = new Action() {
20-
@Override Object perform() {
21+
@Override protected Object perform() {
2122
return service.isRunning();
2223
}
2324
};
2425
private final Action isRunning2 = isRunning.clone();
2526
private final Action stop = new Action() {
26-
@Override Object perform() {
27+
@Override protected Object perform() {
2728
service.stop();
2829
return "OK";
2930
}
@@ -198,13 +199,13 @@ public class ThreadSafetyTest {
198199

199200

200201
private abstract static class Action implements Cloneable {
201-
abstract Object perform();
202+
protected abstract Object perform();
202203

203204
public Action clone() {
204205
try {
205206
return (Action) super.clone();
206207
} catch (Throwable t) {
207-
throw new RuntimeException(t);
208+
throw new AppiumServerHasNotBeenStartedLocallyException(t.getMessage(), t);
208209
}
209210
}
210211
}

src/test/java/io/appium/java_client/pagefactory_tests/GenericTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static class MockWebDriver implements WebDriver {
2828

2929
@Override
3030
public void get(String url) {
31-
31+
System.out.print(url);
3232
}
3333

3434
@Override
@@ -58,12 +58,12 @@ public String getPageSource() {
5858

5959
@Override
6060
public void close() {
61-
61+
System.out.print("Closed");
6262
}
6363

6464
@Override
6565
public void quit() {
66-
66+
System.out.print("Died");
6767
}
6868

6969
@Override

src/test/java/io/appium/java_client/pagefactory_tests/SelendroidModeTest.java

+3
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ public class SelendroidModeTest {
186186

187187
@Test public void findBySelendroidLinkTextTest() {
188188
assertEquals("Accessibility", textLink.getText());
189+
}
189190

191+
@Test public void findBySelendroidPartialLinkTextTest() {
192+
assertEquals("Accessibility", textPartialLink.getText());
190193
}
191194
}

0 commit comments

Comments
 (0)