use of com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestFirefoxCapabilitiesFactory method testCreateFirefoxCapabilitiesWithUserProfile.
@Test(groups = { "ut" })
public void testCreateFirefoxCapabilitiesWithUserProfile() {
Mockito.when(config.getMode()).thenReturn(DriverMode.GRID);
Mockito.when(config.getFirefoxProfilePath()).thenReturn("/home/user/profile");
MutableCapabilities capa = new FirefoxCapabilitiesFactory(config).createCapabilities();
// check 'firefoxProfile' is set to 'default'
Assert.assertEquals(capa.getCapability("firefoxProfile"), "/home/user/profile");
}
use of com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestFirefoxCapabilitiesFactory method testCreateFirefoxCapabilitiesWrongProfile.
@Test(groups = { "ut" })
public void testCreateFirefoxCapabilitiesWrongProfile() {
Mockito.when(config.getMode()).thenReturn(DriverMode.GRID);
Mockito.when(config.getFirefoxProfilePath()).thenReturn("foo");
MutableCapabilities capa = new FirefoxCapabilitiesFactory(config).createCapabilities();
// check 'firefoxProfile' is set to 'default'
Assert.assertNull(capa.getCapability("firefoxProfile"));
}
use of com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestFirefoxCapabilitiesFactory method testCreateFirefoxCapabilitiesNoOverrideDownloadDirRemote.
/**
* issue #365: Check DownloadDir is not set in remote
*/
@Test(groups = { "ut" })
public void testCreateFirefoxCapabilitiesNoOverrideDownloadDirRemote() {
Mockito.when(config.getBrowserDownloadDir()).thenReturn("/home/download");
Mockito.when(config.getMode()).thenReturn(DriverMode.GRID);
MutableCapabilities capa = new FirefoxCapabilitiesFactory(config).createCapabilities();
FirefoxProfile profile = (FirefoxProfile) capa.getCapability(FirefoxDriver.PROFILE);
// check profile
Assert.assertEquals(profile.getStringPreference("browser.download.dir", ""), "");
Assert.assertEquals(profile.getIntegerPreference("browser.download.folderList", 0), 0);
Assert.assertEquals(profile.getStringPreference("browser.helperApps.neverAsk.saveToDisk", ""), "");
}
use of com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestFirefoxCapabilitiesFactory 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() {
Mockito.when(config.getNodeTags()).thenReturn(Arrays.asList("foo", "bar"));
Mockito.when(config.getMode()).thenReturn(DriverMode.LOCAL);
MutableCapabilities capa = new FirefoxCapabilitiesFactory(config).createCapabilities();
Assert.assertFalse(capa.is(SeleniumRobotCapabilityType.NODE_TAGS));
}
use of com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestFirefoxCapabilitiesFactory method testCreateDefaultCapabilitiesWithVersion.
@Test(groups = { "ut" })
public void testCreateDefaultCapabilitiesWithVersion() {
Mockito.when(config.isEnableJavascript()).thenReturn(true);
Mockito.when(config.getProxy()).thenReturn(proxyConfig);
Mockito.when(config.getBrowserVersion()).thenReturn("60.0");
MutableCapabilities capa = new FirefoxCapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(capa.getVersion(), "60.0");
}
Aggregations