use of com.seleniumtests.browserfactory.IECapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestIECapabilityFactory method testCreateIECapabilitiesOverrideDriverPathLocal.
@Test(groups = { "ut" })
public void testCreateIECapabilitiesOverrideDriverPathLocal() {
try {
PowerMockito.mockStatic(Advapi32Util.class);
PowerMockito.when(Advapi32Util.registryGetValue(any(HKEY.class), anyString(), anyString())).thenReturn("1");
Mockito.when(config.getMode()).thenReturn(DriverMode.LOCAL);
Mockito.when(config.getIeDriverPath()).thenReturn("/opt/ie/driver/ie");
new IECapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(System.getProperty(InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY).replace(File.separator, "/"), "/opt/ie/driver/ie");
} finally {
System.clearProperty(InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY);
}
}
use of com.seleniumtests.browserfactory.IECapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestIECapabilityFactory method testCreateDefaultEdgeIEModeCapabilitiesGrid.
/**
* Edge IE mode in grid
* Check ie.edgepath and ie.edgechromium capabilities are not set
*/
@Test(groups = { "ut" })
public void testCreateDefaultEdgeIEModeCapabilitiesGrid() {
Mockito.when(config.getIeMode()).thenReturn(true);
Mockito.when(config.getMode()).thenReturn(DriverMode.GRID);
Mockito.when(config.getInitialUrl()).thenReturn("http://mysite");
Map<BrowserType, List<BrowserInfo>> browserInfos = new HashMap<>();
browserInfos.put(BrowserType.INTERNET_EXPLORER, Arrays.asList(new BrowserInfo(BrowserType.INTERNET_EXPLORER, "11", "", false)));
browserInfos.put(BrowserType.EDGE, Arrays.asList(new BrowserInfo(BrowserType.EDGE, "97.0", "", false)));
PowerMockito.when(OSUtility.getInstalledBrowsersWithVersion(false)).thenReturn(browserInfos);
MutableCapabilities capa = new IECapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(capa.getCapability(CapabilityType.BROWSER_NAME), "internet explorer");
Assert.assertTrue((Boolean) capa.getCapability(InternetExplorerDriver.IGNORE_ZOOM_SETTING));
Assert.assertTrue((Boolean) capa.getCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS));
Assert.assertTrue((Boolean) capa.getCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION));
Assert.assertEquals((String) capa.getCapability(InternetExplorerDriver.INITIAL_BROWSER_URL), "http://mysite");
Assert.assertNull((Boolean) capa.getCapability("ie.edgechromium"));
Assert.assertNull((String) capa.getCapability("ie.edgepath"), "");
Assert.assertNull(((Map<String, Object>) capa.getCapability(IECapabilitiesFactory.SE_IE_OPTIONS)).get("ie.edgepath"));
Assert.assertNull(((Map<String, Object>) capa.getCapability(IECapabilitiesFactory.SE_IE_OPTIONS)).get("ie.edgechromium"));
}
use of com.seleniumtests.browserfactory.IECapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestIECapabilityFactory method testCreateDefaultCapabilitiesWithNodeTagsInGridMode.
/**
* Check default behaviour when node tags are defined in grid mode
* tags are transferred to driver
*/
@Test(groups = { "ut" })
public void testCreateDefaultCapabilitiesWithNodeTagsInGridMode() {
Mockito.when(config.isEnableJavascript()).thenReturn(true);
Mockito.when(config.getProxy()).thenReturn(proxyConfig);
Mockito.when(config.getNodeTags()).thenReturn(Arrays.asList("foo", "bar"));
Mockito.when(config.getMode()).thenReturn(DriverMode.GRID);
MutableCapabilities capa = new IECapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(capa.getCapability(SeleniumRobotCapabilityType.NODE_TAGS), Arrays.asList("foo", "bar"));
}
use of com.seleniumtests.browserfactory.IECapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestIECapabilityFactory method testCreateIECapabilitiesStandardDriverPathGrid.
@Test(groups = { "ut" })
public void testCreateIECapabilitiesStandardDriverPathGrid() {
Mockito.when(config.getMode()).thenReturn(DriverMode.GRID);
new IECapabilitiesFactory(config).createCapabilities();
Assert.assertNull(System.getProperty(InternetExplorerDriverService.IE_DRIVER_EXE_PROPERTY));
}
use of com.seleniumtests.browserfactory.IECapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestIECapabilityFactory method testCreateDefaultCapabilitiesWithNodeTagsInLocalMode.
/**
* Check default behaviour when node tags are defined in local mode
* tags are not transferred to driver
*/
@Test(groups = { "ut" })
public void testCreateDefaultCapabilitiesWithNodeTagsInLocalMode() {
Mockito.when(config.getNodeTags()).thenReturn(Arrays.asList("foo", "bar"));
Mockito.when(config.getMode()).thenReturn(DriverMode.LOCAL);
MutableCapabilities capa = new IECapabilitiesFactory(config).createCapabilities();
Assert.assertFalse(capa.is(SeleniumRobotCapabilityType.NODE_TAGS));
}
Aggregations