Skip to content

Commit 028dbd6

Browse files
naming was fixed + bugfix
1 parent 5177f52 commit 028dbd6

File tree

6 files changed

+20
-24
lines changed

6 files changed

+20
-24
lines changed

google-style.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
</module>
159159
<module name="AbbreviationAsWordInName">
160160
<property name="ignoreFinal" value="false"/>
161-
<property name="allowedAbbreviationLength" value="5"/>
161+
<property name="allowedAbbreviationLength" value="8"/>
162162
</module>
163163
<module name="OverloadMethodsDeclarationOrder"/>
164164
<module name="VariableDeclarationUsageDistance"/>

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

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import static io.appium.java_client.pagefactory.utils.WebDriverUnpackUtility
2222
.unpackWebDriverFromSearchContext;
2323

24+
import com.google.common.collect.ImmutableList;
25+
2426
import io.appium.java_client.HasSessionDetails;
2527
import io.appium.java_client.MobileElement;
2628
import io.appium.java_client.TouchableElement;
@@ -58,22 +60,9 @@
5860
*/
5961
public class AppiumFieldDecorator implements FieldDecorator {
6062

61-
private static final List<Class<? extends WebElement>> availableElementClasses =
62-
new ArrayList<Class<? extends WebElement>>() {
63-
private static final long serialVersionUID = 1L;
64-
65-
{
66-
add(WebElement.class);
67-
add(RemoteWebElement.class);
68-
add(MobileElement.class);
69-
add(TouchableElement.class);
70-
add(AndroidElement.class);
71-
add(IOSElement.class);
72-
add(WindowsElement.class);
73-
}
74-
75-
};
76-
63+
private static final List<Class<? extends WebElement>> availableElementClasses = ImmutableList.of(WebElement.class,
64+
RemoteWebElement.class, MobileElement.class, TouchableElement.class, AndroidElement.class,
65+
IOSElement.class, WindowsElement.class);
7766
public static long DEFAULT_IMPLICITLY_WAIT_TIMEOUT = 1;
7867
public static TimeUnit DEFAULT_TIMEUNIT = TimeUnit.SECONDS;
7968
private final WebDriver originalDriver;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ private static By buildMobileBy(LocatorGroupStrategy locatorGroupStrategy, Annot
177177
}
178178

179179
if (isIOSXcuit()) {
180-
iOSXcuitFindBy[] xCuitFindByArray = annotatedElement.getAnnotationsByType(iOSXcuitFindBy.class);
180+
iOSXCUITFindBy[] xCuitFindByArray = annotatedElement.getAnnotationsByType(iOSXCUITFindBy.class);
181181
if (xCuitFindByArray != null && xCuitFindByArray.length > 0) {
182-
return buildMobileBy(howToUseLocators != null ? howToUseLocators.windowsAutomation() : null,
182+
return buildMobileBy(howToUseLocators != null ? howToUseLocators.iOSXCUITAutomation() : null,
183183
xCuitFindByArray);
184184
}
185185
}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,11 @@
5050
* or the searching by all possible locators.
5151
*/
5252
LocatorGroupStrategy windowsAutomation() default LocatorGroupStrategy.CHAIN;
53+
54+
/**
55+
* @return the strategy which defines how to use locators which are described by
56+
* the {@link iOSXCUITFindBy} annotation. These annotations can define the chained searching
57+
* or the searching by all possible locators.
58+
*/
59+
LocatorGroupStrategy iOSXCUITAutomation() default LocatorGroupStrategy.CHAIN;
5360
}

src/main/java/io/appium/java_client/pagefactory/iOSXcuitFindBy.java renamed to src/main/java/io/appium/java_client/pagefactory/iOSXCUITFindBy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
import java.lang.annotation.Target;
2424

2525
@Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.TYPE})
26-
@Repeatable(iOSXcuitFindBySet.class)
27-
public @interface iOSXcuitFindBy {
26+
@Repeatable(iOSXCUITFindBySet.class)
27+
public @interface iOSXCUITFindBy {
2828

2929
/**
3030
* The NSPredicate class is used to define logical conditions used to constrain

src/main/java/io/appium/java_client/pagefactory/iOSXcuitFindBySet.java renamed to src/main/java/io/appium/java_client/pagefactory/iOSXCUITFindBySet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
import java.lang.annotation.Target;
2323

2424
@Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.TYPE})
25-
public @interface iOSXcuitFindBySet {
25+
public @interface iOSXCUITFindBySet {
2626
/**
27-
* @return an array of {@link io.appium.java_client.pagefactory.iOSXcuitFindBy} which builds a sequence of
27+
* @return an array of {@link iOSXCUITFindBy} which builds a sequence of
2828
* the chained searching for elements or a set of possible locators
2929
*/
30-
iOSXcuitFindBy[] value();
30+
iOSXCUITFindBy[] value();
3131
}

0 commit comments

Comments
 (0)