From d6507082f86a875a24c0e2714de303a6cec2c564 Mon Sep 17 00:00:00 2001 From: Hleb Halkouski Date: Fri, 21 Apr 2017 11:32:53 +0300 Subject: [PATCH 1/2] Made some pagefactory classes public --- .../java_client/pagefactory/AppiumElementLocatorFactory.java | 2 +- .../java_client/pagefactory/DefaultElementByBuilder.java | 4 ++-- .../io/appium/java_client/pagefactory/WidgetByBuilder.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/appium/java_client/pagefactory/AppiumElementLocatorFactory.java b/src/main/java/io/appium/java_client/pagefactory/AppiumElementLocatorFactory.java index 1b9c8ebe1..074c00f0c 100644 --- a/src/main/java/io/appium/java_client/pagefactory/AppiumElementLocatorFactory.java +++ b/src/main/java/io/appium/java_client/pagefactory/AppiumElementLocatorFactory.java @@ -26,7 +26,7 @@ import java.lang.reflect.AnnotatedElement; import java.lang.reflect.Field; -class AppiumElementLocatorFactory implements CacheableElementLocatorFactory { +public class AppiumElementLocatorFactory implements CacheableElementLocatorFactory { private final SearchContext searchContext; private final TimeOutDuration timeOutDuration; private final WebDriver originalWebDriver; diff --git a/src/main/java/io/appium/java_client/pagefactory/DefaultElementByBuilder.java b/src/main/java/io/appium/java_client/pagefactory/DefaultElementByBuilder.java index 77ca9b614..7b8daf458 100644 --- a/src/main/java/io/appium/java_client/pagefactory/DefaultElementByBuilder.java +++ b/src/main/java/io/appium/java_client/pagefactory/DefaultElementByBuilder.java @@ -34,9 +34,9 @@ import java.util.Map; import java.util.Optional; -class DefaultElementByBuilder extends AppiumByBuilder { +public class DefaultElementByBuilder extends AppiumByBuilder { - protected DefaultElementByBuilder(String platform, String automation) { + public DefaultElementByBuilder(String platform, String automation) { super(platform, automation); } diff --git a/src/main/java/io/appium/java_client/pagefactory/WidgetByBuilder.java b/src/main/java/io/appium/java_client/pagefactory/WidgetByBuilder.java index 02247f1f8..a59493cc1 100644 --- a/src/main/java/io/appium/java_client/pagefactory/WidgetByBuilder.java +++ b/src/main/java/io/appium/java_client/pagefactory/WidgetByBuilder.java @@ -28,9 +28,9 @@ import java.util.List; import java.util.Optional; -class WidgetByBuilder extends DefaultElementByBuilder { +public class WidgetByBuilder extends DefaultElementByBuilder { - protected WidgetByBuilder(String platform, String automation) { + public WidgetByBuilder(String platform, String automation) { super(platform, automation); } From 019e748fd6eb22ac560ac186384a3e5597ba8cf6 Mon Sep 17 00:00:00 2001 From: Hleb Halkouski Date: Fri, 21 Apr 2017 16:03:28 +0300 Subject: [PATCH 2/2] add javadoc to AppiumElementLocatorFactory --- .../pagefactory/AppiumElementLocatorFactory.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/io/appium/java_client/pagefactory/AppiumElementLocatorFactory.java b/src/main/java/io/appium/java_client/pagefactory/AppiumElementLocatorFactory.java index 074c00f0c..819bdb263 100644 --- a/src/main/java/io/appium/java_client/pagefactory/AppiumElementLocatorFactory.java +++ b/src/main/java/io/appium/java_client/pagefactory/AppiumElementLocatorFactory.java @@ -32,6 +32,15 @@ public class AppiumElementLocatorFactory implements CacheableElementLocatorFacto private final WebDriver originalWebDriver; private final AppiumByBuilder builder; + /** + * Creates a new mobile element locator factory. + * + * @param searchContext The context to use when finding the element + * @param timeOutDuration is a POJO which contains timeout parameters for the element to be searched + * @param originalWebDriver is an instance of WebDriver that is going to be used by a proxied element + * @param builder is handler of Appium-specific page object annotations + */ + public AppiumElementLocatorFactory(SearchContext searchContext, TimeOutDuration timeOutDuration, WebDriver originalWebDriver, AppiumByBuilder builder) { this.searchContext = searchContext;