-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b5cb61
commit 9cba18a
Showing
35 changed files
with
1,299 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 13 additions & 2 deletions
15
pogen4selenium-api/src/main/java/io/toolisticon/pogen4selenium/api/By.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
package io.toolisticon.pogen4selenium.api; | ||
|
||
public enum By { | ||
ID, | ||
XPATH | ||
ID("id"), | ||
XPATH("xpath"); | ||
|
||
private final String correspondingByMethodName; | ||
|
||
By(String correspondingByMethodName) { | ||
this.correspondingByMethodName = correspondingByMethodName; | ||
} | ||
|
||
public String getCorrespondingByMethodName() { | ||
return correspondingByMethodName; | ||
} | ||
|
||
} |
8 changes: 5 additions & 3 deletions
8
...isticon/pogen4selenium/api/ReadValue.java → ...sticon/pogen4selenium/api/DataObject.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
package io.toolisticon.pogen4selenium.api; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Target(ElementType.FIELD) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface ReadValue { | ||
String value(); | ||
@Target(value = {ElementType.TYPE}) | ||
@Documented | ||
public @interface DataObject { | ||
|
||
} |
18 changes: 18 additions & 0 deletions
18
pogen4selenium-api/src/main/java/io/toolisticon/pogen4selenium/api/ExtractData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package io.toolisticon.pogen4selenium.api; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Annotation to extract data relative to passed element located by the annotation. | ||
* This annotation must be used inside a {@link PageObject} annotated interface. | ||
* Method must have a non void return type annotated with {@link DataObject} annotation or a list of it. | ||
*/ | ||
@Target(ElementType.METHOD) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface ExtractData { | ||
By by() default By.XPATH; | ||
String value(); | ||
} |
39 changes: 39 additions & 0 deletions
39
pogen4selenium-api/src/main/java/io/toolisticon/pogen4selenium/api/ExtractDataValue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package io.toolisticon.pogen4selenium.api; | ||
|
||
import static java.lang.annotation.ElementType.METHOD; | ||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* This annotation can be used inside interfaces annotated with either {@link PageObject} or {@link DataObject}. | ||
* It allows extraction of single data values as String. | ||
* So annotated method must have return type of String. | ||
*/ | ||
|
||
@Documented | ||
@Retention(RUNTIME) | ||
@Target(METHOD) | ||
public @interface ExtractDataValue { | ||
|
||
By by() default By.XPATH; | ||
|
||
/** The locator string used together with locator configured in by. Be sure to use './/', if your relative xpath locator string starts with '//', otherwise the whole document will be scanned. */ | ||
String value(); | ||
|
||
Kind kind() default Kind.TEXT; | ||
|
||
/** attribute or property name. */ | ||
String name() default ""; | ||
|
||
enum Kind{ | ||
TEXT, | ||
ATTRIBUTE, | ||
CSS_VALUE, | ||
TAG_NAME, | ||
ACCESSIBLE_NAME; | ||
} | ||
|
||
} |
Oops, something went wrong.