File tree Expand file tree Collapse file tree
src/test/java/io/appium/java_client Expand file tree Collapse file tree 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,15 @@ 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 ;
23+ if (result .size () == 0 ) {
24+ return null ;
3125 }
26+
27+ return result ;
3228 }).size ());
3329 }
3430}
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