-
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.
Added reading of single value via annotation
- Loading branch information
1 parent
92581cb
commit 564868d
Showing
11 changed files
with
99 additions
and
20 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
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
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
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
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
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
29 changes: 29 additions & 0 deletions
29
.../io/toolisticon/pogen4selenium/processor/pageobject/ExtractDataValueWrapperExtension.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,5 +1,34 @@ | ||
package io.toolisticon.pogen4selenium.processor.pageobject; | ||
|
||
import io.toolisticon.aptk.annotationwrapper.api.CustomCodeMethod; | ||
import io.toolisticon.pogen4selenium.api.By; | ||
import io.toolisticon.pogen4selenium.api.ExtractDataValue; | ||
|
||
public class ExtractDataValueWrapperExtension { | ||
|
||
@CustomCodeMethod(ExtractDataValue.class) | ||
public static String getFinalMethodCall(ExtractDataValueWrapper extractDataValueWrapper) { | ||
|
||
String command = ( | ||
extractDataValueWrapper.by() == By.ELEMENT ? | ||
extractDataValueWrapper.value() + "Element" | ||
: "getDriver().findElement(By." + extractDataValueWrapper.by().getCorrespondingByMethodName() + "(\"" + extractDataValueWrapper.value() + "\"))" | ||
) | ||
+ "."; | ||
|
||
switch (extractDataValueWrapper.kind()) { | ||
case ATTRIBUTE: | ||
case CSS_VALUE: { | ||
|
||
return command + extractDataValueWrapper.kind().getElementMethodName() + "(\"" + extractDataValueWrapper.name() + "\");"; | ||
} | ||
default: { | ||
|
||
return command + extractDataValueWrapper.kind().getElementMethodName() + "();"; | ||
} | ||
} | ||
|
||
|
||
} | ||
|
||
} |
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
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
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
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