Search in sources :

Example 16 with WebUIDriver

use of com.seleniumtests.driver.WebUIDriver in project seleniumRobot by bhecquet.

the class TestWebUIDriver method testMultipleConstructor.

/**
 * A new WebUIDriver is the new default one
 */
@Test(groups = { "ut" })
public void testMultipleConstructor() {
    WebUIDriver uiDriver = WebUIDriverFactory.getInstance("foo");
    WebUIDriver uiDriver2 = WebUIDriverFactory.getInstance("bar");
    Assert.assertEquals(WebUIDriver.getUxDriverSession().get().size(), 2);
    Assert.assertEquals(WebUIDriver.getCurrentWebUiDriverName(), "bar");
}
Also used : WebUIDriver(com.seleniumtests.driver.WebUIDriver) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest) MockitoTest(com.seleniumtests.MockitoTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 17 with WebUIDriver

use of com.seleniumtests.driver.WebUIDriver in project seleniumRobot by bhecquet.

the class TestWebUIDriver method testCleanUpWithBrowserMob.

/**
 * BrowserMob proxy is closed when driver is cleaned
 */
@Test(groups = { "ut" })
public void testCleanUpWithBrowserMob() {
    SeleniumTestsContextManager.getThreadContext().setCaptureNetwork(true);
    SeleniumTestsContextManager.getThreadContext().setBrowser("htmlunit");
    WebUIDriver uiDriver = WebUIDriverFactory.getInstance("foo");
    uiDriver.createRemoteWebDriver();
    Assert.assertNotNull(uiDriver.getConfig().getBrowserMobProxy());
    WebUIDriver.cleanUp();
    Assert.assertNull(uiDriver.getConfig().getBrowserMobProxy());
}
Also used : WebUIDriver(com.seleniumtests.driver.WebUIDriver) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest) MockitoTest(com.seleniumtests.MockitoTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 18 with WebUIDriver

use of com.seleniumtests.driver.WebUIDriver in project seleniumRobot by bhecquet.

the class TestWebUIDriver method testConstructor.

@Test(groups = { "ut" })
public void testConstructor() {
    WebUIDriver uiDriver = WebUIDriverFactory.getInstance("foo");
    Assert.assertEquals(WebUIDriver.getUxDriverSession().get().size(), 1);
    Assert.assertEquals(WebUIDriver.getCurrentWebUiDriverName(), "foo");
}
Also used : WebUIDriver(com.seleniumtests.driver.WebUIDriver) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest) MockitoTest(com.seleniumtests.MockitoTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 19 with WebUIDriver

use of com.seleniumtests.driver.WebUIDriver in project seleniumRobot by bhecquet.

the class TestWebUIDriver method testGetNoWebUiDriver2.

/**
 * Null is returned when no WebUIDriver exist for this name
 */
@Test(groups = { "ut" })
public void testGetNoWebUiDriver2() {
    WebUIDriver uiDriver = WebUIDriver.getWebUIDriver(true, "bar");
    Assert.assertNull(WebUIDriver.getWebUIDriver(false, "foo"));
}
Also used : WebUIDriver(com.seleniumtests.driver.WebUIDriver) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest) MockitoTest(com.seleniumtests.MockitoTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Example 20 with WebUIDriver

use of com.seleniumtests.driver.WebUIDriver in project seleniumRobot by bhecquet.

the class TestWebUIDriver method testCleanUpDriverNull.

/**
 * Check there are no errors if driver is null
 */
@Test(groups = { "ut" })
public void testCleanUpDriverNull() {
    SeleniumTestsContextManager.getThreadContext().setCaptureNetwork(true);
    SeleniumTestsContextManager.getThreadContext().setBrowser("htmlunit");
    WebUIDriver uiDriver = WebUIDriverFactory.getInstance("foo");
    uiDriver.setDriver(null);
    WebUIDriver.cleanUp();
}
Also used : WebUIDriver(com.seleniumtests.driver.WebUIDriver) Test(org.testng.annotations.Test) GenericTest(com.seleniumtests.GenericTest) MockitoTest(com.seleniumtests.MockitoTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

WebUIDriver (com.seleniumtests.driver.WebUIDriver)26 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)19 Test (org.testng.annotations.Test)19 GenericTest (com.seleniumtests.GenericTest)14 MockitoTest (com.seleniumtests.MockitoTest)14 ConnectorsTest (com.seleniumtests.ConnectorsTest)5 CustomEventFiringWebDriver (com.seleniumtests.driver.CustomEventFiringWebDriver)5 ReporterTest (com.seleniumtests.it.reporter.ReporterTest)5 NLWebDriver (com.neotys.selenium.proxies.NLWebDriver)2 ScenarioException (com.seleniumtests.customexception.ScenarioException)2 VideoRecorder (com.seleniumtests.util.video.VideoRecorder)2 File (java.io.File)2 Dimension (org.openqa.selenium.Dimension)2 WebDriver (org.openqa.selenium.WebDriver)2 Point (org.openqa.selenium.Point)1 WebDriverException (org.openqa.selenium.WebDriverException)1 Actions (org.openqa.selenium.interactions.Actions)1 DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)1 SessionId (org.openqa.selenium.remote.SessionId)1