-
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.
Features/fixes/changes: - BaseAbstractTest - amended to as the config is now a singleton - u.c.e.w.configuration.Configured* - added interface and implementations for each driver to allow us to use the grid configuration that comes from the config file and only to download the binaries if we're local - ConfigurationLoader - removed some of the options for the builder so we can use it in the TestConfigManager singleton - TestConfigManger - a singleton to make the configuration available anywhere and to only have one instance of it - GridConfig - data model to represent the object in the config file - RunType - enum for local or grid runs - WebDriverConfig - some additiona fields for exception tolerance, grid, run type and generic test config - ClickUtils - a tolerant click that handles the exceptions passed in the config file and retries once - RadioButtonUtils - methods to select radio buttons by visible labels - JavaScriptUtils - added method to handle running javascript on a specific WebElement - WindowUtils - added scrollIntoView method (which uses new methods in JavaScriptUtils) - SelectBoxUtils - making itemByIndex work not on 0 based numbers (so that the argument can be presented logically i.e. 1 instead of 0) - WebDriverBuilder - refactored after the introduction of ConfgiuredDrivers and a TestConfigManager - WebDriverListener - a few fixes for screenshots - found issue #13 here - Dates - added a method for getting todays date Test (see issue #7): - Added more unit tests - Added integration tests for browser driver loading locally - these tests are platorm dependant (mac or windows) because of the browsers. They depend on the browsers being installed - Added integration test for the helper utilities - Added a small sample web app that is embedded with jetty to allow us to have a sample HTML page to test the helper utilites in bad situations, this is still WIP, and is dependant on port 4442 being open. Dependencies: - Added jetty-server and jetty-servlet (probably need to remove jetty-servlet (see issue #14) - Added surefire plugin to run integration tests - these can now be ran on `mvn verify`
- Loading branch information
1 parent
81350a3
commit 588b4ac
Showing
44 changed files
with
1,029 additions
and
66 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,4 +47,5 @@ bin | |
|
||
*.csv | ||
|
||
script/dist | ||
script/dist | ||
logs/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
{ | ||
"browser": "chrome", | ||
"baseUrl": "https://www.yahoo.com", | ||
"timeout": "30" | ||
"timeout": "30", | ||
"headless": true, | ||
"testConfig": { | ||
"sample": "sample text" | ||
}, | ||
"gridConfig": { | ||
"url": "http://localhost:4444/wd/hub" | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
src/main/java/uk/co/evoco/webdriver/configuration/GridConfig.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,19 @@ | ||
package uk.co.evoco.webdriver.configuration; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.net.MalformedURLException; | ||
import java.net.URL; | ||
|
||
public class GridConfig { | ||
private URL gridUrl; | ||
|
||
public URL getGridUrl() { | ||
return gridUrl; | ||
} | ||
|
||
@JsonProperty("url") | ||
public void setGridUrl(String gridUrl) throws MalformedURLException { | ||
this.gridUrl = new URL(gridUrl); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/uk/co/evoco/webdriver/configuration/RunType.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,6 @@ | ||
package uk.co.evoco.webdriver.configuration; | ||
|
||
public enum RunType { | ||
LOCAL, | ||
GRID | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/uk/co/evoco/webdriver/configuration/TestConfigManager.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 uk.co.evoco.webdriver.configuration; | ||
|
||
public class TestConfigManager { | ||
|
||
private static TestConfigManager testConfigManager; | ||
private WebDriverConfig webDriverConfig; | ||
|
||
private TestConfigManager() { | ||
this.webDriverConfig = new ConfigurationLoader() | ||
.decideWhichConfigurationToUse() | ||
.build(); | ||
} | ||
|
||
public static TestConfigManager getInstance() { | ||
if(null == testConfigManager) { | ||
testConfigManager = new TestConfigManager(); | ||
} | ||
return testConfigManager; | ||
} | ||
|
||
public WebDriverConfig getWebDriverConfig() { | ||
return webDriverConfig; | ||
} | ||
} |
Oops, something went wrong.