use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateDefaultCapabilitiesWithNodeTagsInGridMode.
/**
* Check default behaviour when node tags are defined in grid mode
* tags are transferred to driver
*/
@Test(groups = { "ut" })
public void testCreateDefaultCapabilitiesWithNodeTagsInGridMode() {
when(config.isEnableJavascript()).thenReturn(true);
when(config.getProxy()).thenReturn(proxyConfig);
when(config.getNodeTags()).thenReturn(Arrays.asList("foo", "bar"));
when(config.getMode()).thenReturn(DriverMode.GRID);
MutableCapabilities capa = new EdgeCapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(capa.getCapability(SeleniumRobotCapabilityType.NODE_TAGS), Arrays.asList("foo", "bar"));
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateEdgeCapabilitiesHeadless.
@Test(groups = { "ut" })
public void testCreateEdgeCapabilitiesHeadless() {
when(config.isHeadlessBrowser()).thenReturn(true);
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, --headless, --window-size=1280,1024, --disable-gpu]");
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateEdgeCapabilitiesWrongProfile.
@Test(groups = { "ut" })
public void testCreateEdgeCapabilitiesWrongProfile() {
when(config.getEdgeProfilePath()).thenReturn("wrongName");
when(config.getMode()).thenReturn(DriverMode.LOCAL);
MutableCapabilities capa = new EdgeCapabilitiesFactory(config).createCapabilities();
// a user data dir is configured
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]");
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateEdgeCapabilitiesWithLogging.
@Test(groups = { "ut" })
public void testCreateEdgeCapabilitiesWithLogging() {
try {
when(config.getDebug()).thenReturn(Arrays.asList(DebugMode.DRIVER));
when(config.getMode()).thenReturn(DriverMode.LOCAL);
new EdgeCapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(System.getProperty(EdgeDriverService.EDGE_DRIVER_VERBOSE_LOG_PROPERTY), "true");
Assert.assertTrue(System.getProperty(EdgeDriverService.EDGE_DRIVER_LOG_PROPERTY).endsWith("edgedriver.log"));
} finally {
System.clearProperty(EdgeDriverService.EDGE_DRIVER_VERBOSE_LOG_PROPERTY);
System.clearProperty(EdgeDriverService.EDGE_DRIVER_LOG_PROPERTY);
}
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateEdgeCapabilitiesWithDefaultProfileGrid.
@Test(groups = { "ut" })
public void testCreateEdgeCapabilitiesWithDefaultProfileGrid() {
when(config.getMode()).thenReturn(DriverMode.GRID);
when(config.getEdgeProfilePath()).thenReturn(BrowserInfo.DEFAULT_BROWSER_PRODFILE);
MutableCapabilities capa = new EdgeCapabilitiesFactory(config).createCapabilities();
// check 'edgeProfile' is set to 'default'
Assert.assertEquals(capa.getCapability("edgeProfile"), BrowserInfo.DEFAULT_BROWSER_PRODFILE);
}
Aggregations