use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateDefaultCapabilitiesWithJavascriptDisabled.
@Test(groups = { "ut" })
public void testCreateDefaultCapabilitiesWithJavascriptDisabled() {
when(config.isEnableJavascript()).thenReturn(false);
when(config.getProxy()).thenReturn(proxyConfig);
MutableCapabilities capa = new EdgeCapabilitiesFactory(config).createCapabilities();
Assert.assertFalse(capa.is(CapabilityType.SUPPORTS_JAVASCRIPT));
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateDefaultEdgeCapabilitiesAttach.
/**
* Check we set debugger address
*/
@Test(groups = { "ut" })
public void testCreateDefaultEdgeCapabilitiesAttach() {
when(config.getAttachExistingDriverPort()).thenReturn(10);
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]");
Assert.assertEquals(capa.getCapability(CapabilityType.BROWSER_NAME), "MicrosoftEdge");
// no preference set when attaching to existing browser
Assert.assertNull(((Map<?, ?>) (((EdgeOptions) capa).asMap().get(EdgeOptions.CAPABILITY))).get("prefs"));
Assert.assertEquals(((Map<?, ?>) (((EdgeOptions) capa).asMap().get(EdgeOptions.CAPABILITY))).get("debuggerAddress"), "127.0.0.1:10");
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateEdgeCapabilitiesStandardDriverPathLocal.
@Test(groups = { "ut" })
public void testCreateEdgeCapabilitiesStandardDriverPathLocal() {
try {
when(config.getMode()).thenReturn(DriverMode.LOCAL);
new EdgeCapabilitiesFactory(config).createCapabilities();
Assert.assertTrue(System.getProperty(EdgeDriverService.EDGE_DRIVER_EXE_PROPERTY).replace(File.separator, "/").contains("/drivers/edgedriver_"));
} finally {
System.clearProperty(EdgeDriverService.EDGE_DRIVER_EXE_PROPERTY);
}
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateEdgeCapabilitiesWrongProfileGrid.
@Test(groups = { "ut" })
public void testCreateEdgeCapabilitiesWrongProfileGrid() {
when(config.getMode()).thenReturn(DriverMode.GRID);
when(config.getEdgeProfilePath()).thenReturn("foo");
MutableCapabilities capa = new EdgeCapabilitiesFactory(config).createCapabilities();
// check 'edgeProfile' is not set as it's wrong profile path, and no option added
Assert.assertNull(capa.getCapability("edgeProfile"));
Assert.assertFalse(((Map<String, List<String>>) (((EdgeOptions) capa).asMap().get(EdgeOptions.CAPABILITY))).get("args").toString().contains("--user-data-dir=/home/user/profile"));
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateDefaultEdgeCapabilities.
@Test(groups = { "ut" })
public void testCreateDefaultEdgeCapabilities() {
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]");
Assert.assertEquals(capa.getCapability(CapabilityType.BROWSER_NAME), "MicrosoftEdge");
Assert.assertEquals(((Map<?, ?>) (((EdgeOptions) capa).asMap().get(EdgeOptions.CAPABILITY))).get("prefs").toString(), "{profile.exit_type=Normal}");
// no debuger address set as we do not attach an existing browser
Assert.assertNull(((Map<?, ?>) (((EdgeOptions) capa).asMap().get(EdgeOptions.CAPABILITY))).get("debuggerAddress"));
}
Aggregations