Skip to content

Commit 0426176

Browse files
Merge pull request appium#382 from TikhomirovSergey/master
appium#379 fix appium#371 fix
2 parents f2bc6bf + 5f6d567 commit 0426176

4 files changed

Lines changed: 22 additions & 3 deletions

File tree

pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@
6868
<groupId>net.lingala.zip4j</groupId>
6969
<artifactId>zip4j</artifactId>
7070
<version>1.3.2</version>
71+
<scope>test</scope>
7172
</dependency>
7273
<dependency>
7374
<groupId>commons-io</groupId>
7475
<artifactId>commons-io</artifactId>
75-
<version>2.1</version>
76+
<version>2.5</version>
7677
</dependency>
7778
</dependencies>
7879
<packaging>jar</packaging>

src/main/java/io/appium/java_client/MobileCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public class MobileCommand {
6262
public static final String TOGGLE_LOCATION_SERVICES = "toggleLocationServices";
6363
public static final String GET_DEVICE_TIME = "getDeviceTime";
6464
public static final String UNLOCK = "unlock";
65-
static final Map<String, CommandInfo> commandRepository = getMobileCommands();
65+
public static final Map<String, CommandInfo> commandRepository = getMobileCommands();
6666

6767
static CommandInfo getC(String url) {
6868
return new CommandInfo(url, HttpMethod.GET);

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,14 @@ enum Strategies {
8484
return By
8585
.partialLinkText(getValue(annotation, this));
8686
}
87-
};
87+
},
88+
BYNSPREDICATE("nsPredicate") {
89+
@Override By getBy(Annotation annotation) {
90+
return MobileBy
91+
.IosNsPredicateString(getValue(annotation, this));
92+
}
93+
}
94+
;
8895

8996
private final String valueName;
9097

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,15 @@
6565
* It is a xpath to the target element.
6666
*/
6767
String xpath() default "";
68+
69+
/**
70+
* This parameter makes perform the searching by iOS NSPredicate.
71+
* This locator strategy is available in XCUITest Driver mode.
72+
* Documentation to read:
73+
* https://github.com/appium/java-client/blob/master/docs/
74+
* Installing-xcuitest-driver.md
75+
*
76+
* https://github.com/appium/appium-xcuitest-driver/blob/master/README.md
77+
*/
78+
String nsPredicate() default "";
6879
}

0 commit comments

Comments
 (0)