Skip to content

Commit befa115

Browse files
Increased test coverage
1 parent 1d86df0 commit befa115

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/test/java/io/appium/java_client/pagefactory_tests/XCUITModeTest.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import io.appium.java_client.ios.AppXCUITTest;
3232
import io.appium.java_client.pagefactory.AppiumFieldDecorator;
3333
import io.appium.java_client.pagefactory.HowToUseLocators;
34+
import io.appium.java_client.pagefactory.iOSFindBy;
3435
import io.appium.java_client.pagefactory.iOSXCUITFindBy;
3536
import org.junit.Before;
3637
import org.junit.FixMethodOrder;
@@ -72,6 +73,20 @@ public class XCUITModeTest extends AppXCUITTest {
7273
@iOSXCUITFindBy(className = "XCUIElementTypeSlider")
7374
private MobileElement slider;
7475

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+
7590
/**
7691
* The setting up.
7792
*/
@@ -106,6 +121,18 @@ public class XCUITModeTest extends AppXCUITTest {
106121
assertEquals("50%", slider.getAttribute("Value"));
107122
}
108123

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+
109136
@Test public void findElementByXUISelectorTest() {
110137
assertNotNull(gesture.getText());
111138
}

0 commit comments

Comments
 (0)