-
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.
* Some minor documentation updates * Initial commit of the changes needed to integrsate ssaucelabs to the framework * Fixing some codacy complaints * Removing Codacy * Configuring SonarCloud * Fixing travis * Addressing SonarCloud issues and switching up project badges * Fixing some unit test issued * Moving ITs to Ts * Adding some more tests for the webdriver utils * Adding more tests * Removing some unneeded comments * Adding saucelabs username to build badge
- Loading branch information
1 parent
3ab6a09
commit 39f9a92
Showing
54 changed files
with
1,407 additions
and
548 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"acceptInsecureCerts": true, | ||
"strictFileInteractability": true, | ||
"capturePerformance": true, | ||
"extendedDebugging": false, | ||
"recordLogs": true, | ||
"recordScreenshots": true, | ||
"recordVideo": true, | ||
"saucePlatform": "WINDOWS_10", | ||
"browserName": "CHROME", | ||
"browserVersion": "LATEST", | ||
"pageLoadStrategy": "NORMAL", | ||
"seleniumVersion": "3.7.1", | ||
"sauceLabsRemoteGridUrl": "https://ondemand.saucelabs.com/wd/hub", | ||
"unhandledPromptBehaviour": "DISMISS" | ||
} |
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,4 @@ | ||
#!/usr/bin/env sh | ||
|
||
curl https://www.gov.uk/bank-holidays.json --output src/main/resources/bank-holidays.json | ||
echo "STEVE STEVE STEVE" | ||
ls src/main/resources |
9 changes: 9 additions & 0 deletions
9
src/main/java/uk/co/evoco/exceptions/SauceLabsCredentialsException.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,9 @@ | ||
package uk.co.evoco.exceptions; | ||
|
||
public class SauceLabsCredentialsException extends Exception { | ||
|
||
public SauceLabsCredentialsException() { | ||
super("Tried to get credentials from system variable SAUCE_USERNAME and SAUCE_ACCESS_KEY but could not find them"); | ||
throw new RuntimeException("Can't execute against SauceLabs without valid credentials being provided, see stack trace from SauceLabsCredentialsException"); | ||
} | ||
} |
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
57 changes: 57 additions & 0 deletions
57
src/main/java/uk/co/evoco/tests/BaseAbstractSauceLabsTest.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,57 @@ | ||
package uk.co.evoco.tests; | ||
|
||
import org.junit.jupiter.api.AfterEach; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.openqa.selenium.support.events.EventFiringWebDriver; | ||
import uk.co.evoco.exceptions.SauceLabsCredentialsException; | ||
import uk.co.evoco.webdriver.WebDriverListener; | ||
import uk.co.evoco.webdriver.configuration.TestConfigHelper; | ||
import uk.co.evoco.webdriver.configuration.driver.ConfiguredDriver; | ||
import uk.co.evoco.webdriver.configuration.driver.ConfiguredSauceLabsGridDriver; | ||
|
||
import java.io.IOException; | ||
|
||
/** | ||
* BaseAbstractTest to handle things that testers shouldn't need to worry about (like starting up a WebDriver instance | ||
* and getting everything in the right space for consumers to run tests that are correctly configured etc). | ||
*/ | ||
public abstract class BaseAbstractSauceLabsTest { | ||
|
||
protected EventFiringWebDriver webDriver; | ||
|
||
/** | ||
* This will run before every test class. | ||
* This method gets the configuration and constructs the WebDriver instance, the screenshot | ||
* directory and the makes these items accessible. | ||
*/ | ||
@BeforeAll | ||
public static void beforeAll() { | ||
// Do nothing | ||
} | ||
|
||
/** | ||
* This will run before EVERY @Test that extends this class | ||
* The method will create a new instance of WebDriver and a browser and open Google.com | ||
* This ensures we always have a fresh browser window and a guaranteed starting point | ||
* @throws IOException if results directory isn't created or config file cannot be found | ||
*/ | ||
@BeforeEach | ||
public void setUp() throws SauceLabsCredentialsException { | ||
ConfiguredDriver sauceLabsDriver = new ConfiguredSauceLabsGridDriver(); | ||
this.webDriver = new EventFiringWebDriver(sauceLabsDriver.getRemoteDriver()); | ||
this.webDriver.register(new WebDriverListener()); | ||
this.webDriver.get(TestConfigHelper.get().getBaseUrl()); | ||
this.webDriver.manage().window().maximize(); | ||
} | ||
|
||
/** | ||
* This will run after EVERY @Test that extends this class | ||
* The method will close the current browser and WebDriver instance down | ||
* This ensures we have cleaned up after ourselves (this happens even if the test fails) | ||
*/ | ||
@AfterEach | ||
public void tearDown() { | ||
this.webDriver.quit(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
import java.net.URL; | ||
|
||
public class GridConfig { | ||
|
||
private URL gridUrl; | ||
|
||
/** | ||
|
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 |
---|---|---|
|
@@ -5,5 +5,6 @@ | |
*/ | ||
public enum RunType { | ||
LOCAL, | ||
GRID | ||
GRID, | ||
SAUCELABS | ||
} |
Oops, something went wrong.