File tree 4 files changed +18
-28
lines changed
main/java/io/appium/java_client/pagefactory
test/java/io/appium/java_client
4 files changed +18
-28
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ apply plugin: 'signing'
8
8
apply plugin : ' maven-publish'
9
9
10
10
group ' io.appium'
11
- version ' 5.0.1 '
11
+ version ' 5.0.2 '
12
12
13
13
repositories {
14
14
jcenter()
@@ -38,7 +38,7 @@ configurations {
38
38
}
39
39
40
40
dependencies {
41
- ecj ' org.eclipse.jdt.core.compiler:ecj:4.5 .1'
41
+ ecj ' org.eclipse.jdt.core.compiler:ecj:4.6 .1'
42
42
}
43
43
44
44
compileJava {
@@ -54,14 +54,18 @@ compileJava {
54
54
]
55
55
}
56
56
57
- ext. seleniumVersion = ' [3.5.2 ,3.5.2 ]'
57
+ ext. seleniumVersion = ' [3.5.3 ,3.5.3 ]'
58
58
59
59
dependencies {
60
60
compile (" org.seleniumhq.selenium:selenium-java:${ seleniumVersion} " ) {
61
61
force = true
62
62
63
63
exclude module : ' cglib'
64
64
exclude group : ' com.google.code.gson'
65
+ exclude module : ' phantomjsdriver'
66
+ exclude module : ' htmlunit-driver'
67
+ exclude group : ' net.sourceforge.htmlunit'
68
+
65
69
}
66
70
compile (" org.seleniumhq.selenium:selenium-support:${ seleniumVersion} " ) {
67
71
force = true
Original file line number Diff line number Diff line change 21
21
import static io .appium .java_client .pagefactory .ThrowableUtil .isStaleElementReferenceException ;
22
22
23
23
24
- import com .google .common .base .Function ;
25
-
26
24
import io .appium .java_client .pagefactory .locator .CacheableLocator ;
27
25
28
26
import org .openqa .selenium .By ;
38
36
import java .util .ArrayList ;
39
37
import java .util .List ;
40
38
import java .util .concurrent .TimeUnit ;
39
+ import java .util .function .Function ;
41
40
import java .util .function .Supplier ;
42
41
43
42
class AppiumElementLocator implements CacheableLocator {
Original file line number Diff line number Diff line change 1
1
package io .appium .java_client .android ;
2
2
3
3
import static org .junit .Assert .assertNotEquals ;
4
+ import static org .openqa .selenium .By .id ;
4
5
5
- import com .google .common .base .Function ;
6
6
7
7
import org .junit .Test ;
8
8
9
- import org .openqa .selenium .WebDriver ;
10
9
import org .openqa .selenium .support .ui .WebDriverWait ;
11
10
12
11
import java .util .List ;
@@ -17,18 +16,11 @@ public void openNotification() throws Exception {
17
16
driver .closeApp ();
18
17
driver .openNotifications ();
19
18
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" ));
25
22
26
- if (result .size () == 0 ) {
27
- return null ;
28
- }
29
-
30
- return result ;
31
- }
23
+ return result .isEmpty () ? null : result ;
32
24
}).size ());
33
25
}
34
26
}
Original file line number Diff line number Diff line change 5
5
import static org .junit .Assert .assertEquals ;
6
6
import static org .junit .Assert .assertThat ;
7
7
8
- import com .google .common .base .Function ;
9
8
10
9
import org .junit .FixMethodOrder ;
11
10
import org .junit .Test ;
12
11
import org .junit .runners .MethodSorters ;
13
12
import org .openqa .selenium .By ;
14
- import org .openqa .selenium .WebDriver ;
15
13
import org .openqa .selenium .WebElement ;
16
14
import org .openqa .selenium .support .ui .WebDriverWait ;
17
15
@@ -32,15 +30,12 @@ public class IOSElementTest extends UICatalogIOSTest {
32
30
33
31
WebDriverWait wait = new WebDriverWait (driver , 20 );
34
32
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 ;
43
37
}
38
+ return result ;
44
39
}).get (1 );
45
40
slider .setValue ("0%" );
46
41
assertEquals ("0%" , slider .getAttribute ("value" ));
You can’t perform that action at this time.
0 commit comments