diff --git a/browse-the-web/src/main/java/net/serenitybdd/screenplay/abilities/BrowseTheWeb.java b/browse-the-web/src/main/java/net/serenitybdd/screenplay/abilities/BrowseTheWeb.java index 9c5b602813..2a07e23606 100644 --- a/browse-the-web/src/main/java/net/serenitybdd/screenplay/abilities/BrowseTheWeb.java +++ b/browse-the-web/src/main/java/net/serenitybdd/screenplay/abilities/BrowseTheWeb.java @@ -58,9 +58,9 @@ public T on(Class pageObjectClass) { @Subscribe public void beginPerformance(ActorBeginsPerformanceEvent performanceEvent) { try { - if (performanceEvent.getName().equals(actor.getName())) { - webdriverManager.setCurrentDriver(getDriver()); - } +// if (performanceEvent.getName().equals(actor.getName())) { +// webdriverManager.setCurrentDriver(getDriver()); +// } } catch(Throwable e) { logger.warn("Failed to notify begin performance event for actor " + performanceEvent.getName(),e); } diff --git a/serenity-core/src/main/java/net/thucydides/core/annotations/TestCaseAnnotations.java b/serenity-core/src/main/java/net/thucydides/core/annotations/TestCaseAnnotations.java index d99af924e1..5263ef4463 100644 --- a/serenity-core/src/main/java/net/thucydides/core/annotations/TestCaseAnnotations.java +++ b/serenity-core/src/main/java/net/thucydides/core/annotations/TestCaseAnnotations.java @@ -44,17 +44,17 @@ public void injectDrivers(final WebdriverManager webdriverManager) { String suffix = ""; for(ManagedWebDriverAnnotatedField webDriverField : webDriverFields) { String driverRootName = isEmpty(webDriverField.getDriver()) ? - webdriverManager.getCurrentDriverName() : webDriverField.getDriver(); + webdriverManager.getCurrentDriverType() : webDriverField.getDriver(); String driverName = driverRootName + suffix; - webDriverField.setValue(testCase, webdriverManager.getWebdriver(driverName)); + webDriverField.setValue(testCase, webdriverManager.getWebdriverByName(driverName)); suffix = nextSuffix(driverCount++); } } private String nextSuffix(int driverCount) { - return ":" + driverCount + 1; + return String.format("%d", driverCount + 1); } /** diff --git a/serenity-core/src/main/java/net/thucydides/core/annotations/locators/SmartAjaxElementLocator.java b/serenity-core/src/main/java/net/thucydides/core/annotations/locators/SmartAjaxElementLocator.java index f6a8b07a9c..96e9f7deba 100644 --- a/serenity-core/src/main/java/net/thucydides/core/annotations/locators/SmartAjaxElementLocator.java +++ b/serenity-core/src/main/java/net/thucydides/core/annotations/locators/SmartAjaxElementLocator.java @@ -147,7 +147,7 @@ public WebElement ajaxFindElement() { } private int getTimeOutInSeconds() { - return (int) ThucydidesWebdriverManager.inThisTestThread().getCurrentImplicitTimeout().in(TimeUnit.SECONDS); + return (int) SerenityWebdriverManager.inThisTestThread().getCurrentImplicitTimeout().in(TimeUnit.SECONDS); } private final static List EMPTY_LIST_OF_WEBELEMENTS = Lists.newArrayList(); diff --git a/serenity-core/src/main/java/net/thucydides/core/guice/ThucydidesModule.java b/serenity-core/src/main/java/net/thucydides/core/guice/ThucydidesModule.java index 2b2f8e1653..fa565558ea 100644 --- a/serenity-core/src/main/java/net/thucydides/core/guice/ThucydidesModule.java +++ b/serenity-core/src/main/java/net/thucydides/core/guice/ThucydidesModule.java @@ -51,7 +51,7 @@ protected void configure() { bind(TemplateManager.class).to(FreeMarkerTemplateManager.class).in(Singleton.class); bind(Configuration.class).to(SystemPropertiesConfiguration.class).in(Singleton.class); bind(IssueTracking.class).to(SystemPropertiesIssueTracking.class).in(Singleton.class); - bind(WebdriverManager.class).to(ThucydidesWebdriverManager.class).in(Singleton.class); + bind(WebdriverManager.class).to(SerenityWebdriverManager.class).in(Singleton.class); bind(BatchManager.class).toProvider(BatchManagerProvider.class).in(Singleton.class); bind(LinkGenerator.class).to(SaucelabsLinkGenerator.class).in(Singleton.class); // bind(ScreenshotProcessor.class).to(SingleThreadScreenshotProcessor.class).in(Singleton.class); diff --git a/serenity-core/src/main/java/net/thucydides/core/steps/BaseStepListener.java b/serenity-core/src/main/java/net/thucydides/core/steps/BaseStepListener.java index 3d5b276e7e..b641fb5e4e 100644 --- a/serenity-core/src/main/java/net/thucydides/core/steps/BaseStepListener.java +++ b/serenity-core/src/main/java/net/thucydides/core/steps/BaseStepListener.java @@ -357,7 +357,7 @@ public void testFinished(final TestOutcome outcome) { private String getDriverUsedInThisTest() { - return ThucydidesWebDriverSupport.getCurrentDriverName();// webdriverManager.getCurrentDriverName(); + return ThucydidesWebDriverSupport.getCurrentDriverName();// webdriverManager.getCurrentDriverType(); } private boolean currentTestIsABrowserTest() { diff --git a/serenity-core/src/main/java/net/thucydides/core/webdriver/ThucydidesWebdriverManager.java b/serenity-core/src/main/java/net/thucydides/core/webdriver/SerenityWebdriverManager.java similarity index 79% rename from serenity-core/src/main/java/net/thucydides/core/webdriver/ThucydidesWebdriverManager.java rename to serenity-core/src/main/java/net/thucydides/core/webdriver/SerenityWebdriverManager.java index e4ff0416e9..8200e434b2 100644 --- a/serenity-core/src/main/java/net/thucydides/core/webdriver/ThucydidesWebdriverManager.java +++ b/serenity-core/src/main/java/net/thucydides/core/webdriver/SerenityWebdriverManager.java @@ -1,6 +1,5 @@ package net.thucydides.core.webdriver; -import com.google.common.base.Optional; import com.google.inject.Inject; import org.apache.commons.lang3.StringUtils; import org.openqa.selenium.WebDriver; @@ -21,9 +20,9 @@ * @author johnsmart * */ -public class ThucydidesWebdriverManager implements WebdriverManager { +public class SerenityWebdriverManager implements WebdriverManager { - private static final ThreadLocal webdriverInstancesThreadLocal = new ThreadLocal(); + private static final ThreadLocal webdriverInstancesThreadLocal = new ThreadLocal<>(); private final WebDriverFactory webDriverFactory; @@ -32,7 +31,7 @@ public class ThucydidesWebdriverManager implements WebdriverManager { private final Set allWebdriverInstances; @Inject - public ThucydidesWebdriverManager(final WebDriverFactory webDriverFactory, final Configuration configuration) { + public SerenityWebdriverManager(final WebDriverFactory webDriverFactory, final Configuration configuration) { this.webDriverFactory = webDriverFactory; this.configuration = configuration; this.allWebdriverInstances = Collections.synchronizedSet(new HashSet()); @@ -80,13 +79,13 @@ public void closeAllCurrentDrivers() { public void closeAllDrivers() { synchronized (allWebdriverInstances) { for(WebDriver driver : allWebdriverInstances) { - closeSafely(driver); + safelyClose(driver); } allWebdriverInstances.clear(); } } - private void closeSafely(WebDriver driver) { + private void safelyClose(WebDriver driver) { try { driver.close(); driver.quit(); @@ -98,7 +97,7 @@ public void resetDriver() { } public WebDriver getWebdriver() { - return currentDriver.or(getThreadLocalWebDriver(configuration, webDriverFactory, inThisTestThread().getCurrentDriverName())); + return instantiatedThreadLocalWebDriver(configuration, webDriverFactory, inThisTestThread().getCurrentDriverName()); } @Override @@ -106,17 +105,14 @@ public WebdriverContext inContext(String context) { return new WebdriverContext(this, context); } - private Optional currentDriver = Optional.absent(); - @Override public void setCurrentDriver(WebDriver driver) { - currentDriver = Optional.fromNullable(driver); inThisTestThread().setCurrentDriverTo(driver); } @Override public void clearCurrentDriver() { - currentDriver = Optional.absent(); + } @Override @@ -125,13 +121,14 @@ public void registerDriver(WebDriver driver) { inThisTestThread().setCurrentDriverTo(driver); } - public String getCurrentDriverName() { - return inThisTestThread().getCurrentDriverName(); + public String getCurrentDriverType() { + return inThisTestThread().getCurrentDriverType(); } public SessionId getSessionId() { - WebDriver driver = getThreadLocalWebDriver(configuration, webDriverFactory, - inThisTestThread().getCurrentDriverName()); + + WebDriver driver = inThisTestThread().getCurrentDriver(); + if(driver instanceof WebDriverFacade){ driver = ((WebDriverFacade) driver).getDriverInstance(); } @@ -142,23 +139,28 @@ public SessionId getSessionId() { } public WebDriver getWebdriver(final String driverName) { - WebDriver activeDriver; - if (StringUtils.isEmpty(driverName)) { - activeDriver = getWebdriver(); - } else { - activeDriver = getThreadLocalWebDriver(configuration, webDriverFactory, driverName); - } + + String name = (StringUtils.isEmpty(driverName)) ? inThisTestThread().getCurrentDriverName() : driverName; + + WebDriver activeDriver = instantiatedThreadLocalWebDriver(configuration, webDriverFactory, name); + registerDriverInGlobalDrivers(activeDriver); + return activeDriver; } + public WebDriver getWebdriverByName(String name) { + return getWebdriver(":" + name); + } + + private void registerDriverInGlobalDrivers(WebDriver activeDriver) { allWebdriverInstances.add(activeDriver); } - private static WebDriver getThreadLocalWebDriver(final Configuration configuration, - final WebDriverFactory webDriverFactory, - final String driver) { + private static WebDriver instantiatedThreadLocalWebDriver(final Configuration configuration, + final WebDriverFactory webDriverFactory, + final String driver) { if (!inThisTestThread().driverIsRegisteredFor(driver)) { diff --git a/serenity-core/src/main/java/net/thucydides/core/webdriver/ThucydidesWebDriverSupport.java b/serenity-core/src/main/java/net/thucydides/core/webdriver/ThucydidesWebDriverSupport.java index fefb2b3e65..6b59158e65 100644 --- a/serenity-core/src/main/java/net/thucydides/core/webdriver/ThucydidesWebDriverSupport.java +++ b/serenity-core/src/main/java/net/thucydides/core/webdriver/ThucydidesWebDriverSupport.java @@ -140,7 +140,7 @@ public static SessionId getSessionId() { } public static String getCurrentDriverName() { - return getWebdriverManager().getCurrentDriverName(); + return getWebdriverManager().getCurrentDriverType(); } public static boolean isDriverInstantiated() { diff --git a/serenity-core/src/main/java/net/thucydides/core/webdriver/WebdriverContext.java b/serenity-core/src/main/java/net/thucydides/core/webdriver/WebdriverContext.java index f01170d5a5..36709a62d8 100644 --- a/serenity-core/src/main/java/net/thucydides/core/webdriver/WebdriverContext.java +++ b/serenity-core/src/main/java/net/thucydides/core/webdriver/WebdriverContext.java @@ -13,14 +13,8 @@ public WebdriverContext(WebdriverManager webdriverManager, String context) { } public WebDriver getWebdriver() { - String driverType = webdriverManager.getCurrentDriverName(); + String driverType = webdriverManager.getCurrentDriverType(); String driverName = driverType + ":" + context; return webdriverManager.getWebdriver(driverName); } - - WebDriver getWebdriver(String driverType) { - String driverName = driverType + ":" + context; - return webdriverManager.getWebdriver(driverName); - } - } diff --git a/serenity-core/src/main/java/net/thucydides/core/webdriver/WebdriverInstances.java b/serenity-core/src/main/java/net/thucydides/core/webdriver/WebdriverInstances.java index d9d0f17143..4f3b8009d9 100644 --- a/serenity-core/src/main/java/net/thucydides/core/webdriver/WebdriverInstances.java +++ b/serenity-core/src/main/java/net/thucydides/core/webdriver/WebdriverInstances.java @@ -36,6 +36,10 @@ public WebDriver getCurrentDriver() { } public String getCurrentDriverName() { + return currentDriver == null ? "" : currentDriver; + } + + public String getCurrentDriverType() { if (getCurrentDriver() == null) { return ""; } @@ -133,7 +137,6 @@ private String driverNameFor(WebDriver driver) { throw new IllegalStateException("No matching driver found in this thread"); } - public final class InstanceRegistration { private final String driverName; @@ -159,4 +162,5 @@ private String normalized(String name) { return name.toLowerCase(); } } + } diff --git a/serenity-core/src/main/java/net/thucydides/core/webdriver/WebdriverManager.java b/serenity-core/src/main/java/net/thucydides/core/webdriver/WebdriverManager.java index 10f95b6eec..3d868aa4a8 100644 --- a/serenity-core/src/main/java/net/thucydides/core/webdriver/WebdriverManager.java +++ b/serenity-core/src/main/java/net/thucydides/core/webdriver/WebdriverManager.java @@ -18,8 +18,9 @@ public interface WebdriverManager { WebdriverContext inContext(String context); WebDriver getWebdriver(String driver); + WebDriver getWebdriverByName(String actorName); - String getCurrentDriverName(); + String getCurrentDriverType(); SessionId getSessionId(); diff --git a/serenity-core/src/test/groovy/net/serenitybdd/core/pages/integration/WhenManagingWebdriverTimeouts.groovy b/serenity-core/src/test/groovy/net/serenitybdd/core/pages/integration/WhenManagingWebdriverTimeouts.groovy index 4afe327a65..2ca4b3a425 100644 --- a/serenity-core/src/test/groovy/net/serenitybdd/core/pages/integration/WhenManagingWebdriverTimeouts.groovy +++ b/serenity-core/src/test/groovy/net/serenitybdd/core/pages/integration/WhenManagingWebdriverTimeouts.groovy @@ -9,7 +9,7 @@ import net.thucydides.core.steps.StepFailure import net.thucydides.core.util.EnvironmentVariables import net.thucydides.core.util.MockEnvironmentVariables import net.thucydides.core.webdriver.StaticTestSite -import net.thucydides.core.webdriver.ThucydidesWebdriverManager +import net.thucydides.core.webdriver.SerenityWebdriverManager import net.thucydides.core.webdriver.exceptions.ElementShouldBeDisabledException import net.thucydides.core.webdriver.exceptions.ElementShouldBeEnabledException import net.thucydides.core.webdriver.exceptions.ElementShouldBeInvisibleException @@ -53,7 +53,7 @@ class WhenManagingWebdriverTimeouts extends Specification { } def cleanup() { - ThucydidesWebdriverManager.inThisTestThread().closeAllDrivers(); + SerenityWebdriverManager.inThisTestThread().closeAllDrivers(); } def StaticSitePage openTestPageUsing(String browser) { diff --git a/serenity-core/src/test/groovy/net/serenitybdd/core/webdriver/WhenUsingWebDriverFacade.groovy b/serenity-core/src/test/groovy/net/serenitybdd/core/webdriver/WhenUsingWebDriverFacade.groovy index a05e935b5b..6f6707b929 100644 --- a/serenity-core/src/test/groovy/net/serenitybdd/core/webdriver/WhenUsingWebDriverFacade.groovy +++ b/serenity-core/src/test/groovy/net/serenitybdd/core/webdriver/WhenUsingWebDriverFacade.groovy @@ -4,16 +4,11 @@ import net.thucydides.core.util.EnvironmentVariables import net.thucydides.core.util.MockEnvironmentVariables import net.thucydides.core.webdriver.SupportedWebDriver import net.thucydides.core.webdriver.SystemPropertiesConfiguration -import net.thucydides.core.webdriver.ThucydidesWebdriverManager -import net.thucydides.core.webdriver.TimeoutStack -import net.thucydides.core.webdriver.WebDriverFacade +import net.thucydides.core.webdriver.SerenityWebdriverManager import net.thucydides.core.webdriver.WebDriverFactory import net.thucydides.core.webdriver.WebdriverInstanceFactory import org.mockito.Mock -import org.mockito.Mockito import org.mockito.MockitoAnnotations -import org.openqa.selenium.WebDriver -import org.openqa.selenium.firefox.FirefoxDriver import org.openqa.selenium.remote.RemoteWebDriver import org.openqa.selenium.remote.SessionId import spock.lang.Specification @@ -52,7 +47,7 @@ class WhenUsingWebDriverFacade extends Specification { given: when(remote.getSessionId()).thenReturn(session) when(webDriverFactory.newInstanceOf(any(SupportedWebDriver.class))).thenReturn(remote) - def manager = new ThucydidesWebdriverManager(webDriverFactory, configuration); + def manager = new SerenityWebdriverManager(webDriverFactory, configuration); when: manager.registerDriver(remote) manager.getSessionId() diff --git a/serenity-core/src/test/groovy/net/thucydides/core/webdriver/WhenOpeningAndClosingBrowserSessions.groovy b/serenity-core/src/test/groovy/net/thucydides/core/webdriver/WhenOpeningAndClosingBrowserSessions.groovy index 0ff4ebd774..4eb6bbaf2d 100644 --- a/serenity-core/src/test/groovy/net/thucydides/core/webdriver/WhenOpeningAndClosingBrowserSessions.groovy +++ b/serenity-core/src/test/groovy/net/thucydides/core/webdriver/WhenOpeningAndClosingBrowserSessions.groovy @@ -51,7 +51,7 @@ class WhenOpeningAndClosingBrowserSessions extends Specification { remote.getCapabilities() >> capabilities environmentVariables.setProperty("webdriver.driver","htmlunit") webDriverFactory = new WebDriverFactory(webdriverInstanceFactory, environmentVariables) - webdriverManager = new ThucydidesWebdriverManager(webDriverFactory, new SystemPropertiesConfiguration(environmentVariables)); + webdriverManager = new SerenityWebdriverManager(webDriverFactory, new SystemPropertiesConfiguration(environmentVariables)); StepEventBus.eventBus.clear() } diff --git a/serenity-core/src/test/java/net/thucydides/core/steps/WhenRecordingStepExecutionResults.java b/serenity-core/src/test/java/net/thucydides/core/steps/WhenRecordingStepExecutionResults.java index be5c42f899..92b238e6ba 100644 --- a/serenity-core/src/test/java/net/thucydides/core/steps/WhenRecordingStepExecutionResults.java +++ b/serenity-core/src/test/java/net/thucydides/core/steps/WhenRecordingStepExecutionResults.java @@ -23,7 +23,6 @@ import net.thucydides.core.webdriver.Configuration; import net.thucydides.core.webdriver.SystemPropertiesConfiguration; import net.thucydides.core.webdriver.ThucydidesWebDriverSupport; -import net.thucydides.core.webdriver.ThucydidesWebdriverManager; import org.junit.*; import org.mockito.Mock; import org.mockito.MockitoAnnotations; diff --git a/serenity-core/src/test/java/net/thucydides/core/webdriver/StaticTestSite.java b/serenity-core/src/test/java/net/thucydides/core/webdriver/StaticTestSite.java index 085d0500de..7924ffb0d8 100644 --- a/serenity-core/src/test/java/net/thucydides/core/webdriver/StaticTestSite.java +++ b/serenity-core/src/test/java/net/thucydides/core/webdriver/StaticTestSite.java @@ -10,7 +10,7 @@ public class StaticTestSite { private WebDriverFactory factory; - private ThucydidesWebdriverManager webdriverManager; + private SerenityWebdriverManager webdriverManager; private EnvironmentVariables environmentVariables; public StaticTestSite() { @@ -20,7 +20,7 @@ public StaticTestSite() { public StaticTestSite(EnvironmentVariables environmentVariables) { this.environmentVariables = environmentVariables; factory = new WebDriverFactory(environmentVariables); - webdriverManager = new ThucydidesWebdriverManager(factory, new SystemPropertiesConfiguration(environmentVariables)); + webdriverManager = new SerenityWebdriverManager(factory, new SystemPropertiesConfiguration(environmentVariables)); } private String homepage = "index.html"; diff --git a/serenity-core/src/test/java/net/thucydides/core/webdriver/WhenManagingWebdriverInstances.java b/serenity-core/src/test/java/net/thucydides/core/webdriver/WhenManagingWebdriverInstances.java index 33707f026e..b9fe75d0b2 100644 --- a/serenity-core/src/test/java/net/thucydides/core/webdriver/WhenManagingWebdriverInstances.java +++ b/serenity-core/src/test/java/net/thucydides/core/webdriver/WhenManagingWebdriverInstances.java @@ -43,7 +43,7 @@ protected FirefoxProfile createNewFirefoxProfile() { configuration = new SystemPropertiesConfiguration(environmentVariables); - webdriverManager = new ThucydidesWebdriverManager(factory, configuration); + webdriverManager = new SerenityWebdriverManager(factory, configuration); webdriverManager.closeAllCurrentDrivers(); } @@ -119,7 +119,7 @@ public void the_default_output_directory_can_be_overrided_via_a_system_property( @Test public void should_close_drivers_in_current_thread() { - ThucydidesWebdriverManager aWebdriverManager = new ThucydidesWebdriverManager(factory, configuration); + SerenityWebdriverManager aWebdriverManager = new SerenityWebdriverManager(factory, configuration); aWebdriverManager.getWebdriver("firefox"); aWebdriverManager.getWebdriver("htmlunit"); aWebdriverManager.getWebdriver("chrome"); @@ -131,7 +131,7 @@ public void should_close_drivers_in_current_thread() { @Test public void should_close_individual_driver_in_current_thread() { - ThucydidesWebdriverManager aWebdriverManager = new ThucydidesWebdriverManager(factory, configuration); + SerenityWebdriverManager aWebdriverManager = new SerenityWebdriverManager(factory, configuration); aWebdriverManager.getWebdriver("firefox"); aWebdriverManager.getWebdriver("htmlunit"); aWebdriverManager.getWebdriver("chrome"); @@ -145,7 +145,7 @@ public void should_close_individual_driver_in_current_thread() { @Test public void should_close_drivers_in_all_threads() { - ThucydidesWebdriverManager aWebdriverManager = new ThucydidesWebdriverManager(factory, configuration); + SerenityWebdriverManager aWebdriverManager = new SerenityWebdriverManager(factory, configuration); aWebdriverManager.getWebdriver("firefox"); aWebdriverManager.getWebdriver("htmlunit"); aWebdriverManager.getWebdriver("chrome"); @@ -157,7 +157,7 @@ public void should_close_drivers_in_all_threads() { @Test public void should_close_drivers_in_all_threads_after_driver_resets() { - ThucydidesWebdriverManager aWebdriverManager = new ThucydidesWebdriverManager(factory, configuration); + SerenityWebdriverManager aWebdriverManager = new SerenityWebdriverManager(factory, configuration); aWebdriverManager.getWebdriver("firefox"); aWebdriverManager.getWebdriver("htmlunit"); aWebdriverManager.getWebdriver("chrome"); diff --git a/serenity-core/src/test/java/net/thucydides/core/webdriver/WhenUsingAWebDriverProxy.java b/serenity-core/src/test/java/net/thucydides/core/webdriver/WhenUsingAWebDriverProxy.java index af8b081259..a64f45e18b 100644 --- a/serenity-core/src/test/java/net/thucydides/core/webdriver/WhenUsingAWebDriverProxy.java +++ b/serenity-core/src/test/java/net/thucydides/core/webdriver/WhenUsingAWebDriverProxy.java @@ -66,7 +66,7 @@ private void initWendriverManager() throws IllegalAccessException, Instantiation environmentVariables.setProperty("webdriver.driver", "phantomjs"); factory = new WebDriverFactory(webdriverInstanceFactory, environmentVariables); - webdriverManager = new ThucydidesWebdriverManager(factory, new SystemPropertiesConfiguration(environmentVariables)); + webdriverManager = new SerenityWebdriverManager(factory, new SystemPropertiesConfiguration(environmentVariables)); } diff --git a/serenity-junit/src/main/java/net/serenitybdd/junit/runners/SerenityRunner.java b/serenity-junit/src/main/java/net/serenitybdd/junit/runners/SerenityRunner.java index c5a5fe8259..aa3eadeb09 100644 --- a/serenity-junit/src/main/java/net/serenitybdd/junit/runners/SerenityRunner.java +++ b/serenity-junit/src/main/java/net/serenitybdd/junit/runners/SerenityRunner.java @@ -136,7 +136,7 @@ public SerenityRunner(final Class klass, final Configuration configuration, final BatchManager batchManager) throws InitializationError { this(klass, - new ThucydidesWebdriverManager(webDriverFactory, configuration), + new SerenityWebdriverManager(webDriverFactory, configuration), configuration, batchManager ); diff --git a/serenity-junit/src/test/groovy/net/thucydides/junit/runners/WhenRunningTestScenarios.groovy b/serenity-junit/src/test/groovy/net/thucydides/junit/runners/WhenRunningTestScenarios.groovy index 836bd094d8..c0f773aac5 100644 --- a/serenity-junit/src/test/groovy/net/thucydides/junit/runners/WhenRunningTestScenarios.groovy +++ b/serenity-junit/src/test/groovy/net/thucydides/junit/runners/WhenRunningTestScenarios.groovy @@ -2,7 +2,7 @@ package net.thucydides.junit.runners import net.thucydides.core.util.MockEnvironmentVariables import net.thucydides.core.webdriver.SystemPropertiesConfiguration -import net.thucydides.core.webdriver.ThucydidesWebdriverManager +import net.thucydides.core.webdriver.SerenityWebdriverManager import net.thucydides.core.webdriver.WebDriverFactory import net.thucydides.core.webdriver.WebdriverInstanceFactory import net.thucydides.samples.* @@ -16,7 +16,6 @@ import spock.lang.Unroll import java.nio.file.Path import java.nio.file.Paths -import java.util.concurrent.TimeUnit import static net.thucydides.core.model.TestResult.* import static net.thucydides.junit.runners.TestOutcomeChecks.resultsFrom @@ -410,7 +409,7 @@ class WhenRunningTestScenarios extends Specification { def "should ignore close if the webdriver is not defined"() { when: - def manager = new ThucydidesWebdriverManager(webDriverFactory, new SystemPropertiesConfiguration(environmentVariables)); + def manager = new SerenityWebdriverManager(webDriverFactory, new SystemPropertiesConfiguration(environmentVariables)); then: manager.closeDriver() } diff --git a/serenity-junit/src/test/java/net/serenitybdd/junit/runners/integration/WhenManagingAWebDriverInstance.java b/serenity-junit/src/test/java/net/serenitybdd/junit/runners/integration/WhenManagingAWebDriverInstance.java index 2c0bc8d444..78ecd6704e 100644 --- a/serenity-junit/src/test/java/net/serenitybdd/junit/runners/integration/WhenManagingAWebDriverInstance.java +++ b/serenity-junit/src/test/java/net/serenitybdd/junit/runners/integration/WhenManagingAWebDriverInstance.java @@ -84,7 +84,7 @@ public void the_driver_should_be_initialized_before_the_tests() throws Initializ } @Mock - ThucydidesWebdriverManager manager; + SerenityWebdriverManager manager; @Test public void the_driver_should_be_reset_after_each_test() throws InitializationError {