Skip to content

Commit 4e47690

Browse files
Merge pull request #717 from TikhomirovSergey/master
#714 FIX
2 parents 3c776c7 + feb1efb commit 4e47690

File tree

4 files changed

+18
-28
lines changed

4 files changed

+18
-28
lines changed

build.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ apply plugin: 'signing'
88
apply plugin: 'maven-publish'
99

1010
group 'io.appium'
11-
version '5.0.1'
11+
version '5.0.2'
1212

1313
repositories {
1414
jcenter()
@@ -38,7 +38,7 @@ configurations {
3838
}
3939

4040
dependencies {
41-
ecj 'org.eclipse.jdt.core.compiler:ecj:4.5.1'
41+
ecj 'org.eclipse.jdt.core.compiler:ecj:4.6.1'
4242
}
4343

4444
compileJava {
@@ -54,14 +54,18 @@ compileJava {
5454
]
5555
}
5656

57-
ext.seleniumVersion = '[3.5.2,3.5.2]'
57+
ext.seleniumVersion = '[3.5.3,3.5.3]'
5858

5959
dependencies {
6060
compile ("org.seleniumhq.selenium:selenium-java:${seleniumVersion}") {
6161
force = true
6262

6363
exclude module: 'cglib'
6464
exclude group: 'com.google.code.gson'
65+
exclude module: 'phantomjsdriver'
66+
exclude module: 'htmlunit-driver'
67+
exclude group: 'net.sourceforge.htmlunit'
68+
6569
}
6670
compile ("org.seleniumhq.selenium:selenium-support:${seleniumVersion}") {
6771
force = true

src/main/java/io/appium/java_client/pagefactory/AppiumElementLocator.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
import static io.appium.java_client.pagefactory.ThrowableUtil.isStaleElementReferenceException;
2222

2323

24-
import com.google.common.base.Function;
25-
2624
import io.appium.java_client.pagefactory.locator.CacheableLocator;
2725

2826
import org.openqa.selenium.By;
@@ -38,6 +36,7 @@
3836
import java.util.ArrayList;
3937
import java.util.List;
4038
import java.util.concurrent.TimeUnit;
39+
import java.util.function.Function;
4140
import java.util.function.Supplier;
4241

4342
class AppiumElementLocator implements CacheableLocator {
Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package io.appium.java_client.android;
22

33
import static org.junit.Assert.assertNotEquals;
4+
import static org.openqa.selenium.By.id;
45

5-
import com.google.common.base.Function;
66

77
import org.junit.Test;
88

9-
import org.openqa.selenium.WebDriver;
109
import org.openqa.selenium.support.ui.WebDriverWait;
1110

1211
import java.util.List;
@@ -17,18 +16,11 @@ public void openNotification() throws Exception {
1716
driver.closeApp();
1817
driver.openNotifications();
1918
WebDriverWait wait = new WebDriverWait(driver, 20);
20-
assertNotEquals(0, wait.until(new Function<WebDriver, List<AndroidElement>>() {
21-
@Override
22-
public List<AndroidElement> apply(WebDriver input) {
23-
List<AndroidElement> result = driver
24-
.findElementsById("com.android.systemui:id/carrier_label");
19+
assertNotEquals(0, wait.until(input -> {
20+
List<AndroidElement> result = input
21+
.findElements(id("com.android.systemui:id/carrier_label"));
2522

26-
if (result.size() == 0) {
27-
return null;
28-
}
29-
30-
return result;
31-
}
23+
return result.isEmpty() ? null : result;
3224
}).size());
3325
}
3426
}

src/test/java/io/appium/java_client/ios/IOSElementTest.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
import static org.junit.Assert.assertEquals;
66
import static org.junit.Assert.assertThat;
77

8-
import com.google.common.base.Function;
98

109
import org.junit.FixMethodOrder;
1110
import org.junit.Test;
1211
import org.junit.runners.MethodSorters;
1312
import org.openqa.selenium.By;
14-
import org.openqa.selenium.WebDriver;
1513
import org.openqa.selenium.WebElement;
1614
import org.openqa.selenium.support.ui.WebDriverWait;
1715

@@ -32,15 +30,12 @@ public class IOSElementTest extends UICatalogIOSTest {
3230

3331
WebDriverWait wait = new WebDriverWait(driver, 20);
3432

35-
IOSElement slider = (IOSElement) wait.until(new Function<WebDriver, List<WebElement>>() {
36-
@Override
37-
public List<WebElement> apply(WebDriver input) {
38-
List<WebElement> result = input.findElements(By.className("UIASlider"));
39-
if (result.size() == 0) {
40-
return null;
41-
}
42-
return result;
33+
IOSElement slider = (IOSElement) wait.until(input -> {
34+
List<WebElement> result = input.findElements(By.className("UIASlider"));
35+
if (result.size() == 0) {
36+
return null;
4337
}
38+
return result;
4439
}).get(1);
4540
slider.setValue("0%");
4641
assertEquals("0%", slider.getAttribute("value"));

0 commit comments

Comments
 (0)