|
31 | 31 | import io.appium.java_client.ios.AppXCUITTest; |
32 | 32 | import io.appium.java_client.pagefactory.AppiumFieldDecorator; |
33 | 33 | import io.appium.java_client.pagefactory.HowToUseLocators; |
| 34 | +import io.appium.java_client.pagefactory.iOSFindBy; |
34 | 35 | import io.appium.java_client.pagefactory.iOSXCUITFindBy; |
35 | 36 | import org.junit.Before; |
36 | 37 | import org.junit.FixMethodOrder; |
@@ -72,6 +73,20 @@ public class XCUITModeTest extends AppXCUITTest { |
72 | 73 | @iOSXCUITFindBy(className = "XCUIElementTypeSlider") |
73 | 74 | private MobileElement slider; |
74 | 75 |
|
| 76 | + @iOSFindBy(id = "locationStatus") |
| 77 | + private MobileElement locationStatus; |
| 78 | + |
| 79 | + @HowToUseLocators(iOSAutomation = CHAIN) |
| 80 | + @iOSFindBy(id = "TestApp") @iOSXCUITFindBy(iOSNsPredicate = "name BEGINSWITH 'contact'") |
| 81 | + private MobileElement contactAlert; |
| 82 | + |
| 83 | + @HowToUseLocators(iOSAutomation = ALL_POSSIBLE) |
| 84 | + @iOSFindBy(uiAutomator = ".elements()[0]") |
| 85 | + @iOSXCUITFindBy(iOSNsPredicate = "name BEGINSWITH 'location'") |
| 86 | + private MobileElement locationAlert; |
| 87 | + |
| 88 | + |
| 89 | + |
75 | 90 | /** |
76 | 91 | * The setting up. |
77 | 92 | */ |
@@ -106,6 +121,18 @@ public class XCUITModeTest extends AppXCUITTest { |
106 | 121 | assertEquals("50%", slider.getAttribute("Value")); |
107 | 122 | } |
108 | 123 |
|
| 124 | + @Test public void pageObjectChainingTest() { |
| 125 | + assertTrue(contactAlert.isDisplayed()); |
| 126 | + } |
| 127 | + |
| 128 | + @Test public void findElementByIdTest() { |
| 129 | + assertTrue(locationStatus.isDisplayed()); |
| 130 | + } |
| 131 | + |
| 132 | + @Test public void nativeSelectorTest() { |
| 133 | + assertTrue(locationAlert.isDisplayed()); |
| 134 | + } |
| 135 | + |
109 | 136 | @Test public void findElementByXUISelectorTest() { |
110 | 137 | assertNotNull(gesture.getText()); |
111 | 138 | } |
|
0 commit comments