Skip to content

Commit

Permalink
feat: add iOS related find by annotations for tvOS (#1456)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuCocoa authored Mar 24, 2021
1 parent fc814ed commit 6b48519
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ protected By buildMobileNativeBy() {
getBys(AndroidFindBy.class, AndroidFindBys.class, AndroidFindAll.class));
}

if (isIOSXcuit() || isIOS()) {
if (isIOSXcuit() || isIOS() || isTvOS()) {
return buildMobileBy(howToUseLocatorsOptional.map(HowToUseLocators::iOSXCUITAutomation).orElse(null),
getBys(iOSXCUITFindBy.class, iOSXCUITFindBys.class, iOSXCUITFindAll.class));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static io.appium.java_client.remote.AutomationName.IOS_XCUI_TEST;
import static io.appium.java_client.remote.MobilePlatform.ANDROID;
import static io.appium.java_client.remote.MobilePlatform.IOS;
import static io.appium.java_client.remote.MobilePlatform.TVOS;
import static io.appium.java_client.remote.MobilePlatform.WINDOWS;

import org.openqa.selenium.By;
Expand Down Expand Up @@ -178,6 +179,10 @@ protected boolean isIOS() {
return IOS.equalsIgnoreCase(platform);
}

protected boolean isTvOS() {
return TVOS.equalsIgnoreCase(platform);
}

protected boolean isIOSXcuit() {
return isIOS() && IOS_XCUI_TEST.equalsIgnoreCase(automation);
}
Expand Down

0 comments on commit 6b48519

Please sign in to comment.