Skip to content

Commit

Permalink
naming was fixed + bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
TikhomirovSergey committed Dec 24, 2016
1 parent 5177f52 commit 028dbd6
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 24 deletions.
2 changes: 1 addition & 1 deletion google-style.xml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
</module>
<module name="AbbreviationAsWordInName">
<property name="ignoreFinal" value="false"/>
<property name="allowedAbbreviationLength" value="5"/>
<property name="allowedAbbreviationLength" value="8"/>
</module>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="VariableDeclarationUsageDistance"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import static io.appium.java_client.pagefactory.utils.WebDriverUnpackUtility
.unpackWebDriverFromSearchContext;

import com.google.common.collect.ImmutableList;

import io.appium.java_client.HasSessionDetails;
import io.appium.java_client.MobileElement;
import io.appium.java_client.TouchableElement;
Expand Down Expand Up @@ -58,22 +60,9 @@
*/
public class AppiumFieldDecorator implements FieldDecorator {

private static final List<Class<? extends WebElement>> availableElementClasses =
new ArrayList<Class<? extends WebElement>>() {
private static final long serialVersionUID = 1L;

{
add(WebElement.class);
add(RemoteWebElement.class);
add(MobileElement.class);
add(TouchableElement.class);
add(AndroidElement.class);
add(IOSElement.class);
add(WindowsElement.class);
}

};

private static final List<Class<? extends WebElement>> availableElementClasses = ImmutableList.of(WebElement.class,
RemoteWebElement.class, MobileElement.class, TouchableElement.class, AndroidElement.class,
IOSElement.class, WindowsElement.class);
public static long DEFAULT_IMPLICITLY_WAIT_TIMEOUT = 1;
public static TimeUnit DEFAULT_TIMEUNIT = TimeUnit.SECONDS;
private final WebDriver originalDriver;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ private static By buildMobileBy(LocatorGroupStrategy locatorGroupStrategy, Annot
}

if (isIOSXcuit()) {
iOSXcuitFindBy[] xCuitFindByArray = annotatedElement.getAnnotationsByType(iOSXcuitFindBy.class);
iOSXCUITFindBy[] xCuitFindByArray = annotatedElement.getAnnotationsByType(iOSXCUITFindBy.class);
if (xCuitFindByArray != null && xCuitFindByArray.length > 0) {
return buildMobileBy(howToUseLocators != null ? howToUseLocators.windowsAutomation() : null,
return buildMobileBy(howToUseLocators != null ? howToUseLocators.iOSXCUITAutomation() : null,
xCuitFindByArray);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,11 @@
* or the searching by all possible locators.
*/
LocatorGroupStrategy windowsAutomation() default LocatorGroupStrategy.CHAIN;

/**
* @return the strategy which defines how to use locators which are described by
* the {@link iOSXCUITFindBy} annotation. These annotations can define the chained searching
* or the searching by all possible locators.
*/
LocatorGroupStrategy iOSXCUITAutomation() default LocatorGroupStrategy.CHAIN;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.TYPE})
@Repeatable(iOSXcuitFindBySet.class)
public @interface iOSXcuitFindBy {
@Repeatable(iOSXCUITFindBySet.class)
public @interface iOSXCUITFindBy {

/**
* The NSPredicate class is used to define logical conditions used to constrain
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
import java.lang.annotation.Target;

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

0 comments on commit 028dbd6

Please sign in to comment.