File tree Expand file tree Collapse file tree 4 files changed +18
-28
lines changed
main/java/io/appium/java_client/pagefactory
test/java/io/appium/java_client Expand file tree Collapse file tree 4 files changed +18
-28
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ apply plugin: 'signing'
88apply plugin : ' maven-publish'
99
1010group ' io.appium'
11- version ' 5.0.1 '
11+ version ' 5.0.2 '
1212
1313repositories {
1414 jcenter()
@@ -38,7 +38,7 @@ configurations {
3838}
3939
4040dependencies {
41- ecj ' org.eclipse.jdt.core.compiler:ecj:4.5 .1'
41+ ecj ' org.eclipse.jdt.core.compiler:ecj:4.6 .1'
4242}
4343
4444compileJava {
@@ -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
5959dependencies {
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
Original file line number Diff line number Diff line change 2121import static io .appium .java_client .pagefactory .ThrowableUtil .isStaleElementReferenceException ;
2222
2323
24- import com .google .common .base .Function ;
25-
2624import io .appium .java_client .pagefactory .locator .CacheableLocator ;
2725
2826import org .openqa .selenium .By ;
3836import java .util .ArrayList ;
3937import java .util .List ;
4038import java .util .concurrent .TimeUnit ;
39+ import java .util .function .Function ;
4140import java .util .function .Supplier ;
4241
4342class AppiumElementLocator implements CacheableLocator {
Original file line number Diff line number Diff line change 11package io .appium .java_client .android ;
22
33import static org .junit .Assert .assertNotEquals ;
4+ import static org .openqa .selenium .By .id ;
45
5- import com .google .common .base .Function ;
66
77import org .junit .Test ;
88
9- import org .openqa .selenium .WebDriver ;
109import org .openqa .selenium .support .ui .WebDriverWait ;
1110
1211import 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}
Original file line number Diff line number Diff line change 55import static org .junit .Assert .assertEquals ;
66import static org .junit .Assert .assertThat ;
77
8- import com .google .common .base .Function ;
98
109import org .junit .FixMethodOrder ;
1110import org .junit .Test ;
1211import org .junit .runners .MethodSorters ;
1312import org .openqa .selenium .By ;
14- import org .openqa .selenium .WebDriver ;
1513import org .openqa .selenium .WebElement ;
1614import 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" ));
You can’t perform that action at this time.
0 commit comments