use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateEdgeCapabilitiesOverrideBinPath.
/**
* check the case where we have a beta browser. The last one is choosen
*/
@Test(groups = { "ut" })
public void testCreateEdgeCapabilitiesOverrideBinPath() {
when(config.getMode()).thenReturn(DriverMode.LOCAL);
// SeleniumTestsContext class adds a browserInfo when binary path is set
Map<BrowserType, List<BrowserInfo>> updatedBrowserInfos = new HashMap<>();
updatedBrowserInfos.put(BrowserType.EDGE, Arrays.asList(new BrowserInfo(BrowserType.EDGE, "92.0", "", false), new BrowserInfo(BrowserType.EDGE, "93.0", "/opt/edge/bin/edge", false)));
PowerMockito.when(OSUtility.getInstalledBrowsersWithVersion(false)).thenReturn(updatedBrowserInfos);
MutableCapabilities capa = new EdgeCapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(((Map<?, ?>) (((EdgeOptions) capa).asMap().get(EdgeOptions.CAPABILITY))).get("binary").toString(), "/opt/edge/bin/edge");
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateDefaultCapabilities.
/**
* Check default behaviour
*/
@Test(groups = { "ut" })
public void testCreateDefaultCapabilities() {
when(config.isEnableJavascript()).thenReturn(true);
when(config.getProxy()).thenReturn(proxyConfig);
when(config.getNodeTags()).thenReturn(new ArrayList<>());
MutableCapabilities capa = new EdgeCapabilitiesFactory(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);
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateEdgeCapabilitiesOverrideUserAgent.
@Test(groups = { "ut" })
public void testCreateEdgeCapabilitiesOverrideUserAgent() {
when(config.getUserAgentOverride()).thenReturn("EDGE 55");
MutableCapabilities capa = new EdgeCapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(((Map<?, ?>) (((EdgeOptions) capa).asMap().get(EdgeOptions.CAPABILITY))).get("args").toString(), "[--user-agent=EDGE 55, --disable-translate, --disable-web-security, --no-sandbox, --disable-site-isolation-trials, --disable-features=IsolateOrigins,site-per-process]");
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateEdgeCapabilitiesStandardDriverPathGrid.
@Test(groups = { "ut" })
public void testCreateEdgeCapabilitiesStandardDriverPathGrid() {
when(config.getMode()).thenReturn(DriverMode.GRID);
new EdgeCapabilitiesFactory(config).createCapabilities();
Assert.assertNull(System.getProperty(EdgeDriverService.EDGE_DRIVER_EXE_PROPERTY));
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testNonBetaVersionBrowserAbsent.
/**
* If beta is not requested, and non beta browser not installed, return null
*/
@Test(groups = { "ut" }, expectedExceptions = ConfigurationException.class, expectedExceptionsMessageRegExp = "Browser EDGE is not available")
public void testNonBetaVersionBrowserAbsent() {
when(config.getMode()).thenReturn(DriverMode.LOCAL);
Map<BrowserType, List<BrowserInfo>> browserInfos = new HashMap<>();
browserInfos.put(BrowserType.EDGE, Arrays.asList(new BrowserInfo(BrowserType.EDGE, "102.0", "", false, true)));
PowerMockito.when(OSUtility.getInstalledBrowsersWithVersion(false)).thenReturn(browserInfos);
EdgeCapabilitiesFactory capaFactory = new EdgeCapabilitiesFactory(config);
capaFactory.createCapabilities();
}
Aggregations