use of com.seleniumtests.browserfactory.IECapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestIECapabilityFactory method testCreateDefaultEdgeIEModeCapabilitiesGridEdgeNotAvailable.
/**
* If Edge is not available, throw an error when Edge in IE mode is requested
*/
@Test(groups = { "ut" }, expectedExceptions = ConfigurationException.class)
public void testCreateDefaultEdgeIEModeCapabilitiesGridEdgeNotAvailable() {
Mockito.when(config.getIeMode()).thenReturn(true);
Mockito.when(config.getMode()).thenReturn(DriverMode.LOCAL);
Mockito.when(config.getInitialUrl()).thenReturn("http://mysite");
MutableCapabilities capa = new IECapabilitiesFactory(config).createCapabilities();
}
use of com.seleniumtests.browserfactory.IECapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestIECapabilityFactory method testCreateIECapabilitiesStandardDriverPathLocal.
@Test(groups = { "ut" })
public void testCreateIECapabilitiesStandardDriverPathLocal() {
try {
PowerMockito.mockStatic(Advapi32Util.class);
PowerMockito.when(Advapi32Util.registryGetValue(any(HKEY.class), anyString(), anyString())).thenReturn("1");
Mockito.when(config.getMode()).thenReturn(DriverMode.LOCAL);
new IECapabilitiesFactory(config).createCapabilities();
Assert.assertTrue(System.getProperty(InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY).replace(File.separator, "/").contains("/drivers/IEDriverServer_"));
} finally {
System.clearProperty(InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY);
}
}
use of com.seleniumtests.browserfactory.IECapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestIECapabilityFactory method testCreateDefaultCapabilitiesWithVersion.
@Test(groups = { "ut" })
public void testCreateDefaultCapabilitiesWithVersion() {
Mockito.when(config.isEnableJavascript()).thenReturn(true);
Mockito.when(config.getProxy()).thenReturn(proxyConfig);
Mockito.when(config.getBrowserVersion()).thenReturn("10.0");
MutableCapabilities capa = new IECapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(capa.getVersion(), "10.0");
}
Aggregations