-
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
Showing
30 changed files
with
495 additions
and
216 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
24 changes: 24 additions & 0 deletions
24
pogen4selenium-api/src/main/java/io/toolisticon/pogen4selenium/api/ActionImpl.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,24 @@ | ||
package io.toolisticon.pogen4selenium.api; | ||
|
||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.WebElement; | ||
|
||
/** | ||
* The base interface for all actions. | ||
*/ | ||
public interface ActionImpl { | ||
|
||
/** | ||
* Execute action on passed webElement | ||
* @param webElement | ||
*/ | ||
public void executeAction(WebElement webElement); | ||
|
||
/** | ||
* Execute action on element located by locator | ||
* @param locator | ||
*/ | ||
public void executeAction(By locator); | ||
|
||
|
||
} |
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
12 changes: 12 additions & 0 deletions
12
pogen4selenium-api/src/main/java/io/toolisticon/pogen4selenium/api/ActionSideCondition.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,12 @@ | ||
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; | ||
|
||
@Target(ElementType.METHOD) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface ActionSideCondition { | ||
|
||
} |
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
22 changes: 22 additions & 0 deletions
22
...elenium-api/src/main/java/io/toolisticon/pogen4selenium/runtime/DefaultSideCondition.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,22 @@ | ||
package io.toolisticon.pogen4selenium.runtime; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
import org.openqa.selenium.NoSuchElementException; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.WebElement; | ||
|
||
public class DefaultSideCondition implements LocatorCondition { | ||
|
||
@Override | ||
public boolean checkCondition(WebDriver driver, WebElement element) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public Collection<Class<? extends Throwable>> exceptionsToIgnore() { | ||
return Arrays.asList(NoSuchElementException.class); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
pogen4selenium-api/src/main/java/io/toolisticon/pogen4selenium/runtime/LocatorCondition.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,14 @@ | ||
package io.toolisticon.pogen4selenium.runtime; | ||
|
||
import java.util.Collection; | ||
|
||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.WebElement; | ||
|
||
public interface LocatorCondition{ | ||
|
||
boolean checkCondition(WebDriver driver, WebElement element); | ||
|
||
Collection<Class<? extends Throwable>> exceptionsToIgnore(); | ||
|
||
} |
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
36 changes: 36 additions & 0 deletions
36
...nium-api/src/main/java/io/toolisticon/pogen4selenium/runtime/actions/ActionClickImpl.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,36 @@ | ||
package io.toolisticon.pogen4selenium.runtime.actions; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
import org.openqa.selenium.NoSuchElementException; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.support.ui.ExpectedConditions; | ||
|
||
import io.toolisticon.pogen4selenium.runtime.LocatorCondition; | ||
|
||
public class ActionClickImpl extends BaseAction { | ||
|
||
public ActionClickImpl(WebDriver driver, LocatorCondition sideCondition) { | ||
super(driver, sideCondition); | ||
|
||
} | ||
|
||
@Override | ||
public boolean checkCondition(WebDriver driver, WebElement element) { | ||
return element.isDisplayed() && element.isEnabled(); | ||
} | ||
|
||
@Override | ||
public Collection<Class<? extends Throwable>> exceptionsToIgnore() { | ||
return Arrays.asList(NoSuchElementException.class); | ||
} | ||
|
||
|
||
@Override | ||
protected void applyAction(WebElement webElement) { | ||
webElement.click(); | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
...src/main/java/io/toolisticon/pogen4selenium/runtime/actions/ActionMoveToAndClickImpl.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,35 @@ | ||
package io.toolisticon.pogen4selenium.runtime.actions; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
import org.openqa.selenium.NoSuchElementException; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.interactions.Actions; | ||
|
||
import io.toolisticon.pogen4selenium.runtime.LocatorCondition; | ||
|
||
public class ActionMoveToAndClickImpl extends BaseAction { | ||
|
||
|
||
public ActionMoveToAndClickImpl(WebDriver driver, LocatorCondition sideCondition) { | ||
super(driver, sideCondition); | ||
} | ||
|
||
@Override | ||
public boolean checkCondition(WebDriver driver, WebElement element) { | ||
return element.isDisplayed() && element.isEnabled(); | ||
} | ||
|
||
@Override | ||
public Collection<Class<? extends Throwable>> exceptionsToIgnore() { | ||
return Arrays.asList(NoSuchElementException.class); | ||
} | ||
|
||
@Override | ||
protected void applyAction(WebElement webElement) { | ||
new Actions(driver).moveToElement(webElement).pause(300).click().perform(); | ||
} | ||
|
||
} |
44 changes: 44 additions & 0 deletions
44
...nium-api/src/main/java/io/toolisticon/pogen4selenium/runtime/actions/ActionWriteImpl.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,44 @@ | ||
package io.toolisticon.pogen4selenium.runtime.actions; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
import org.openqa.selenium.Keys; | ||
import org.openqa.selenium.NoSuchElementException; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.WebElement; | ||
|
||
import io.toolisticon.pogen4selenium.runtime.LocatorCondition; | ||
|
||
public class ActionWriteImpl extends BaseAction { | ||
|
||
|
||
private final String toSet; | ||
|
||
public ActionWriteImpl(WebDriver driver, LocatorCondition sideCondition, String toSet) { | ||
super(driver, sideCondition); | ||
|
||
this.toSet = toSet; | ||
} | ||
|
||
@Override | ||
public boolean checkCondition(WebDriver driver, WebElement element) { | ||
return element.isDisplayed() && element.isEnabled(); | ||
} | ||
|
||
@Override | ||
public Collection<Class<? extends Throwable>> exceptionsToIgnore() { | ||
return Arrays.asList(NoSuchElementException.class); | ||
} | ||
|
||
@Override | ||
protected void applyAction(WebElement webElement) { | ||
|
||
webElement.click(); | ||
webElement.sendKeys(Keys.CONTROL + "a"); | ||
webElement.sendKeys(Keys.DELETE); | ||
webElement.sendKeys(toSet); | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.