Skip to content

Commit 6b48519

Browse files
authored
feat: add iOS related find by annotations for tvOS (#1456)
1 parent fc814ed commit 6b48519

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/java/io/appium/java_client/pagefactory/DefaultElementByBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ protected By buildMobileNativeBy() {
170170
getBys(AndroidFindBy.class, AndroidFindBys.class, AndroidFindAll.class));
171171
}
172172

173-
if (isIOSXcuit() || isIOS()) {
173+
if (isIOSXcuit() || isIOS() || isTvOS()) {
174174
return buildMobileBy(howToUseLocatorsOptional.map(HowToUseLocators::iOSXCUITAutomation).orElse(null),
175175
getBys(iOSXCUITFindBy.class, iOSXCUITFindBys.class, iOSXCUITFindAll.class));
176176
}

src/main/java/io/appium/java_client/pagefactory/bys/builder/AppiumByBuilder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import static io.appium.java_client.remote.AutomationName.IOS_XCUI_TEST;
2020
import static io.appium.java_client.remote.MobilePlatform.ANDROID;
2121
import static io.appium.java_client.remote.MobilePlatform.IOS;
22+
import static io.appium.java_client.remote.MobilePlatform.TVOS;
2223
import static io.appium.java_client.remote.MobilePlatform.WINDOWS;
2324

2425
import org.openqa.selenium.By;
@@ -178,6 +179,10 @@ protected boolean isIOS() {
178179
return IOS.equalsIgnoreCase(platform);
179180
}
180181

182+
protected boolean isTvOS() {
183+
return TVOS.equalsIgnoreCase(platform);
184+
}
185+
181186
protected boolean isIOSXcuit() {
182187
return isIOS() && IOS_XCUI_TEST.equalsIgnoreCase(automation);
183188
}

0 commit comments

Comments
 (0)