// Path: common/src/main/java/com/saucelabs/common/JavaScriptInvokerFactory.java
// public class JavaScriptInvokerFactory {
//     private static JavaScriptExecutor customManager = null;
// 
//     public static void setJavaScriptExecutor(JavaScriptExecutor js)
//     {
//         customManager = js;
//     }
//     public static JavaScriptExecutor create(WebDriver driver)
//     {
//         if (customManager != null)
//         {
//             return customManager;
//         }
//         else
//             return new JavaScriptInvokerImpl(driver);
//     }
// }


import com.saucelabs.common.JavaScriptInvokerFactory;
import org.junit.After;
import org.junit.Before;
import org.openqa.selenium.WebDriver;
import static org.mockito.Mockito.mock;
package com.saucelabs.common.unit;



public class BaseUnitTest {
    public WebDriver mockWebDriver;
    @Before
    public void runBeforeTest()
    {
        mockWebDriver = mock(WebDriver.class);
        resetJavaScriptInvokerState();
    }
    @After
    public void afterEveryTest()
    {
        resetJavaScriptInvokerState();
    }
    private void resetJavaScriptInvokerState() {
// Path: common/src/main/java/com/saucelabs/common/JavaScriptInvokerFactory.java
// public class JavaScriptInvokerFactory {
//     private static JavaScriptExecutor customManager = null;
// 
//     public static void setJavaScriptExecutor(JavaScriptExecutor js)
//     {
//         customManager = js;
//     }
//     public static JavaScriptExecutor create(WebDriver driver)
//     {
//         if (customManager != null)
//         {
//             return customManager;
//         }
//         else
//             return new JavaScriptInvokerImpl(driver);
//     }
// }


// Path: common/src/test/java/com/saucelabs/common/unit/BaseUnitTest.java
import com.saucelabs.common.JavaScriptInvokerFactory;
import org.junit.After;
import org.junit.Before;
import org.openqa.selenium.WebDriver;
import static org.mockito.Mockito.mock;

package com.saucelabs.common.unit;



public class BaseUnitTest {
    public WebDriver mockWebDriver;
    @Before
    public void runBeforeTest()
    {
        mockWebDriver = mock(WebDriver.class);
        resetJavaScriptInvokerState();
    }
    @After
    public void afterEveryTest()
    {
        resetJavaScriptInvokerState();
    }
    private void resetJavaScriptInvokerState() {
        JavaScriptInvokerFactory.setJavaScriptExecutor(null);