use of com.seleniumtests.browserfactory.IECapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestIECapabilityFactory method testCreateDefaultIECapabilities.
@Test(groups = { "ut" })
public void testCreateDefaultIECapabilities() {
// check we start on "about:blank"
Mockito.when(config.getInitialUrl()).thenReturn("http://mysite");
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), "about:blank");
}
use of com.seleniumtests.browserfactory.IECapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestIECapabilityFactory method testCreateDefaultEdgeIEModeCapabilities.
/**
* Edge IE mode in local
* Check ie.edgepath and ie.edgechromium capabilities are set
*/
@Test(groups = { "ut" })
public void testCreateDefaultEdgeIEModeCapabilities() {
Mockito.when(config.getIeMode()).thenReturn(true);
Mockito.when(config.getMode()).thenReturn(DriverMode.LOCAL);
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.assertTrue((Boolean) capa.getCapability("ie.edgechromium"));
Assert.assertEquals((String) capa.getCapability("ie.edgepath"), "");
Assert.assertEquals(((Map<String, Object>) capa.getCapability(IECapabilitiesFactory.SE_IE_OPTIONS)).get("ie.edgepath"), "");
Assert.assertTrue((boolean) ((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 testCreateDefaultCapabilitiesWithPlatform.
@Test(groups = { "ut" })
public void testCreateDefaultCapabilitiesWithPlatform() {
Mockito.when(config.isEnableJavascript()).thenReturn(true);
Mockito.when(config.getProxy()).thenReturn(proxyConfig);
Mockito.when(config.getWebPlatform()).thenReturn(Platform.WINDOWS);
MutableCapabilities capa = new IECapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(capa.getPlatform(), Platform.WINDOWS);
}
use of com.seleniumtests.browserfactory.IECapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestIECapabilityFactory method testCreateDefaultCapabilitiesWithJavascriptDisabled.
@Test(groups = { "ut" })
public void testCreateDefaultCapabilitiesWithJavascriptDisabled() {
Mockito.when(config.isEnableJavascript()).thenReturn(false);
Mockito.when(config.getProxy()).thenReturn(proxyConfig);
MutableCapabilities capa = new IECapabilitiesFactory(config).createCapabilities();
Assert.assertFalse(capa.is(CapabilityType.SUPPORTS_JAVASCRIPT));
}
use of com.seleniumtests.browserfactory.IECapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestIECapabilityFactory method testCreateDefaultCapabilities.
/**
* Check default behaviour
*/
@Test(groups = { "ut" })
public void testCreateDefaultCapabilities() {
Mockito.when(config.isEnableJavascript()).thenReturn(true);
Mockito.when(config.getProxy()).thenReturn(proxyConfig);
Mockito.when(config.getNodeTags()).thenReturn(new ArrayList<>());
MutableCapabilities capa = new IECapabilitiesFactory(config).createCapabilities();
Assert.assertTrue(capa.is(CapabilityType.SUPPORTS_JAVASCRIPT));
Assert.assertTrue(capa.is(CapabilityType.TAKES_SCREENSHOT));
Assert.assertTrue(capa.is(CapabilityType.ACCEPT_SSL_CERTS));
Assert.assertFalse(capa.is(SeleniumRobotCapabilityType.NODE_TAGS));
Assert.assertEquals(capa.getVersion(), "");
Assert.assertEquals(capa.getCapability(CapabilityType.PROXY), proxyConfig);
}
Aggregations