Skip to content

Commit 4191dc6

Browse files
sbt-sidochenko-vvsbt-sidochenko-vv
authored andcommitted
Add support for linkText and partialLinkText serch locators to @SelendroidFindBy annotation
1 parent 0c2f13d commit 4191dc6

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ By getBy(Annotation annotation) {
8888
By getBy(Annotation annotation) {
8989
return By.xpath(getValue(annotation, this));
9090
}
91+
},
92+
BYLINKTEXT("linkText") {
93+
@Override
94+
By getBy(Annotation annotation) {
95+
return By.linkText(getValue(annotation, this));
96+
}
97+
},
98+
BYPARTIALLINKTEXT("partialLinkText") {
99+
@Override
100+
By getBy(Annotation annotation) {
101+
return By.partialLinkText(getValue(annotation, this));
102+
}
91103
};
92104

93105
private final String valueName;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@
2121
String className() default "";
2222
String tagName() default "";
2323
String xpath() default "";
24+
String linkText() default "";
25+
String partialLinkText() default "";
2426
}

0 commit comments

Comments
 (0)