use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateDefaultCapabilitiesWithPlatform.
@Test(groups = { "ut" })
public void testCreateDefaultCapabilitiesWithPlatform() {
when(config.isEnableJavascript()).thenReturn(true);
when(config.getProxy()).thenReturn(proxyConfig);
when(config.getWebPlatform()).thenReturn(Platform.WINDOWS);
MutableCapabilities capa = new EdgeCapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(capa.getPlatform(), Platform.WINDOWS);
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateEdgeCapabilitiesWithUserProfileGrid.
@Test(groups = { "ut" })
public void testCreateEdgeCapabilitiesWithUserProfileGrid() {
when(config.getMode()).thenReturn(DriverMode.GRID);
when(config.getEdgeProfilePath()).thenReturn("/home/user/profile");
MutableCapabilities capa = new EdgeCapabilitiesFactory(config).createCapabilities();
// check option is added with user profile
Assert.assertNull(capa.getCapability("edgeProfile"));
Assert.assertTrue(((Map<String, List<String>>) (((EdgeOptions) capa).asMap().get(EdgeOptions.CAPABILITY))).get("args").contains("--user-data-dir=/home/user/profile"));
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testBetaVersionBrowserAbsent.
/**
* If beta is not requested, and non beta browser not installed, return null
*/
@Test(groups = { "ut" }, expectedExceptions = ConfigurationException.class, expectedExceptionsMessageRegExp = "Browser EDGE beta is not available")
public void testBetaVersionBrowserAbsent() {
when(config.getMode()).thenReturn(DriverMode.LOCAL);
Map<BrowserType, List<BrowserInfo>> browserInfos = new HashMap<>();
browserInfos.put(BrowserType.EDGE, Arrays.asList(new BrowserInfo(BrowserType.EDGE, "101.0", "", false, false)));
PowerMockito.when(OSUtility.getInstalledBrowsersWithVersion(true)).thenReturn(browserInfos);
when(config.getBetaBrowser()).thenReturn(true);
EdgeCapabilitiesFactory capaFactory = new EdgeCapabilitiesFactory(config);
capaFactory.createCapabilities();
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateEdgeCapabilitiesWithOptions.
@Test(groups = { "ut" })
public void testCreateEdgeCapabilitiesWithOptions() {
when(config.getEdgeOptions()).thenReturn("--key1=value1 --key2=value2");
MutableCapabilities capa = new EdgeCapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(((Map<?, ?>) (((EdgeOptions) capa).asMap().get(EdgeOptions.CAPABILITY))).get("args").toString(), "[--disable-translate, --disable-web-security, --no-sandbox, --disable-site-isolation-trials, --disable-features=IsolateOrigins,site-per-process, --key1=value1, --key2=value2]");
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory 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() {
when(config.getNodeTags()).thenReturn(Arrays.asList("foo", "bar"));
when(config.getMode()).thenReturn(DriverMode.LOCAL);
MutableCapabilities capa = new EdgeCapabilitiesFactory(config).createCapabilities();
Assert.assertFalse(capa.is(SeleniumRobotCapabilityType.NODE_TAGS));
}
Aggregations