use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateEdgeCapabilitiesWithoutDefaultProfileGrid.
@Test(groups = { "ut" })
public void testCreateEdgeCapabilitiesWithoutDefaultProfileGrid() {
when(config.getMode()).thenReturn(DriverMode.GRID);
MutableCapabilities capa = new EdgeCapabilitiesFactory(config).createCapabilities();
// check 'edgeProfile' is not set as not requested, 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 testCreateEdgeCapabilitiesDefaultProfile.
@Test(groups = { "ut" })
public void testCreateEdgeCapabilitiesDefaultProfile() {
when(config.getEdgeProfilePath()).thenReturn("default");
when(config.getMode()).thenReturn(DriverMode.LOCAL);
MutableCapabilities capa = new EdgeCapabilitiesFactory(config).createCapabilities();
// a user data dir is configured
Assert.assertNotEquals(((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, --user-data-dir=/home/foo/edge]");
Assert.assertTrue(((Map<?, ?>) (((EdgeOptions) capa).asMap().get(EdgeOptions.CAPABILITY))).get("args").toString().startsWith("[--disable-translate, --disable-web-security, --no-sandbox, --disable-site-isolation-trials, --disable-features=IsolateOrigins,site-per-process, --user-data-dir="));
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateDefaultCapabilitiesWithVersion.
@Test(groups = { "ut" })
public void testCreateDefaultCapabilitiesWithVersion() {
when(config.isEnableJavascript()).thenReturn(true);
when(config.getProxy()).thenReturn(proxyConfig);
when(config.getBrowserVersion()).thenReturn("60.0");
MutableCapabilities capa = new EdgeCapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(capa.getVersion(), "60.0");
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateEdgeCapabilitiesUserDefinedProfile.
@Test(groups = { "ut" })
public void testCreateEdgeCapabilitiesUserDefinedProfile() {
when(config.getEdgeProfilePath()).thenReturn("/home/foo/edge");
when(config.getMode()).thenReturn(DriverMode.LOCAL);
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, --user-data-dir=/home/foo/edge]");
}
use of com.seleniumtests.browserfactory.EdgeCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestEdgeCapabilityFactory method testCreateEdgeCapabilitiesOverrideDriverPathLocal.
@Test(groups = { "ut" })
public void testCreateEdgeCapabilitiesOverrideDriverPathLocal() {
try {
when(config.getMode()).thenReturn(DriverMode.LOCAL);
when(config.getEdgeDriverPath()).thenReturn("/opt/edge/driver/edgedriver");
new EdgeCapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(System.getProperty(EdgeDriverService.EDGE_DRIVER_EXE_PROPERTY).replace(File.separator, "/"), "/opt/edge/driver/edgedriver");
} finally {
System.clearProperty(EdgeDriverService.EDGE_DRIVER_EXE_PROPERTY);
}
}
Aggregations