forked from serenity-bdd/serenity-core
-
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
18 changed files
with
92 additions
and
99 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
96 changes: 46 additions & 50 deletions
96
.../src/main/java/net/serenitybdd/core/webdriver/driverproviders/HTMLUnitDriverProvider.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,50 +1,46 @@ | ||
//package net.serenitybdd.core.webdriver.driverproviders; | ||
// | ||
//import net.serenitybdd.core.buildinfo.DriverCapabilityRecord; | ||
//import net.serenitybdd.core.di.WebDriverInjectors; | ||
//import net.serenitybdd.core.webdriver.driverproviders.webdrivermanager.WebDriverManagerSetup; | ||
//import net.thucydides.core.fixtureservices.FixtureProviderService; | ||
//import net.thucydides.core.steps.StepEventBus; | ||
//import net.thucydides.core.util.EnvironmentVariables; | ||
//import net.thucydides.core.webdriver.CapabilityEnhancer; | ||
//import net.thucydides.core.webdriver.SupportedWebDriver; | ||
//import net.thucydides.core.webdriver.stubs.WebDriverStub; | ||
//import org.openqa.selenium.Capabilities; | ||
//import org.openqa.selenium.MutableCapabilities; | ||
//import org.openqa.selenium.WebDriver; | ||
//import org.openqa.selenium.htmlunit.HtmlUnitDriver; | ||
//import org.openqa.selenium.remote.DesiredCapabilities; | ||
//import org.openqa.selenium.safari.SafariDriver; | ||
//import org.openqa.selenium.safari.SafariOptions; | ||
// | ||
///** | ||
// * HTMLUnit provider. | ||
// * Experimental: used mostly for testing. | ||
// */ | ||
//public class HTMLUnitDriverProvider implements DriverProvider { | ||
// | ||
// private final DriverCapabilityRecord driverProperties; | ||
// | ||
// private final FixtureProviderService fixtureProviderService; | ||
// | ||
// public HTMLUnitDriverProvider(FixtureProviderService fixtureProviderService) { | ||
// this.fixtureProviderService = fixtureProviderService; | ||
// this.driverProperties = WebDriverInjectors.getInjector().getInstance(DriverCapabilityRecord.class); | ||
// } | ||
// | ||
// @Override | ||
// public WebDriver newInstance(String options, EnvironmentVariables environmentVariables) { | ||
// if (StepEventBus.getParallelEventBus().webdriverCallsAreSuspended()) { | ||
// return new WebDriverStub(); | ||
// } | ||
// | ||
// CapabilityEnhancer enhancer = new CapabilityEnhancer(environmentVariables, fixtureProviderService); | ||
// MutableCapabilities capabilities = new DesiredCapabilities(); | ||
// capabilities.setCapability("browserName","htmlunit"); | ||
// capabilities = enhancer.enhanced(capabilities, SupportedWebDriver.HTMLUNIT); | ||
// | ||
// WebDriver driver = new HtmlUnitDriver(capabilities); | ||
// driverProperties.registerCapabilities("htmlunit", capabilitiesToProperties(capabilities)); | ||
// return driver; | ||
// } | ||
//} | ||
package net.serenitybdd.core.webdriver.driverproviders; | ||
|
||
import net.serenitybdd.core.buildinfo.DriverCapabilityRecord; | ||
import net.serenitybdd.core.di.WebDriverInjectors; | ||
import net.thucydides.core.fixtureservices.FixtureProviderService; | ||
import net.thucydides.core.steps.StepEventBus; | ||
import net.thucydides.core.util.EnvironmentVariables; | ||
import net.thucydides.core.webdriver.CapabilityEnhancer; | ||
import net.thucydides.core.webdriver.SupportedWebDriver; | ||
import net.thucydides.core.webdriver.stubs.WebDriverStub; | ||
import org.openqa.selenium.MutableCapabilities; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.remote.DesiredCapabilities; | ||
import org.openqa.selenium.htmlunit.HtmlUnitDriver; | ||
|
||
/** | ||
* HTMLUnit provider. | ||
* Experimental: used mostly for testing. | ||
*/ | ||
public class HTMLUnitDriverProvider implements DriverProvider { | ||
|
||
private final DriverCapabilityRecord driverProperties; | ||
|
||
private final FixtureProviderService fixtureProviderService; | ||
|
||
public HTMLUnitDriverProvider(FixtureProviderService fixtureProviderService) { | ||
this.fixtureProviderService = fixtureProviderService; | ||
this.driverProperties = WebDriverInjectors.getInjector().getInstance(DriverCapabilityRecord.class); | ||
} | ||
|
||
@Override | ||
public WebDriver newInstance(String options, EnvironmentVariables environmentVariables) { | ||
if (StepEventBus.getParallelEventBus().webdriverCallsAreSuspended()) { | ||
return new WebDriverStub(); | ||
} | ||
|
||
CapabilityEnhancer enhancer = new CapabilityEnhancer(environmentVariables, fixtureProviderService); | ||
MutableCapabilities capabilities = new DesiredCapabilities(); | ||
capabilities.setCapability("browserName", "htmlunit"); | ||
capabilities = enhancer.enhanced(capabilities, SupportedWebDriver.HTMLUNIT); | ||
|
||
WebDriver driver = new HtmlUnitDriver(capabilities); | ||
driverProperties.registerCapabilities("htmlunit", capabilitiesToProperties(capabilities)); | ||
return driver; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,6 @@ void sample_test() { | |
@Nested | ||
class Nested_Test_Cases { | ||
|
||
|
||
@Test | ||
void sample_nested_test() { | ||
} | ||
|
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
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