use of com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestMarionetteCapabilitiesFactory method testCreateMarionetteCapabilitiesStandardBinPath.
@Test(groups = { "ut" })
public void testCreateMarionetteCapabilitiesStandardBinPath() {
Mockito.when(config.getMode()).thenReturn(DriverMode.LOCAL);
MutableCapabilities capa = new FirefoxCapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(capa.getCapability(FirefoxDriver.BINARY), "/usr/bin/firefox");
}
use of com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestFirefoxCapabilitiesFactory method testCreateFirefoxCapabilitiesWithoutDefaultProfile.
@Test(groups = { "ut" })
public void testCreateFirefoxCapabilitiesWithoutDefaultProfile() {
Mockito.when(config.getMode()).thenReturn(DriverMode.GRID);
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 testCreateDefaultFirefoxCapabilities.
@Test(groups = { "ut" })
public void testCreateDefaultFirefoxCapabilities() {
Mockito.when(config.getMode()).thenReturn(DriverMode.LOCAL);
Mockito.when(config.isSetAcceptUntrustedCertificates()).thenReturn(true);
Mockito.when(config.isSetAssumeUntrustedCertificateIssuer()).thenReturn(true);
MutableCapabilities capa = new FirefoxCapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(capa.getCapability(CapabilityType.BROWSER_NAME), "firefox");
Assert.assertEquals(capa.getCapability(FirefoxDriver.MARIONETTE), false);
FirefoxProfile profile = (FirefoxProfile) capa.getCapability(FirefoxDriver.PROFILE);
// check profile
Assert.assertTrue(profile.getBooleanPreference("webdriver_accept_untrusted_certs", false));
Assert.assertTrue(profile.getBooleanPreference("webdriver_assume_untrusted_issuer", false));
Assert.assertEquals(profile.getStringPreference("capability.policy.default.Window.QueryInterface", ""), FirefoxCapabilitiesFactory.ALL_ACCESS);
Assert.assertEquals(profile.getStringPreference("capability.policy.default.Window.frameElement.get", ""), FirefoxCapabilitiesFactory.ALL_ACCESS);
Assert.assertEquals(profile.getStringPreference("capability.policy.default.HTMLDocument.compatMode.get", ""), FirefoxCapabilitiesFactory.ALL_ACCESS);
Assert.assertEquals(profile.getStringPreference("capability.policy.default.Document.compatMode.get", ""), FirefoxCapabilitiesFactory.ALL_ACCESS);
Assert.assertEquals(profile.getIntegerPreference("dom.max_chrome_script_run_time", 100), 0);
Assert.assertEquals(profile.getIntegerPreference("dom.max_script_run_time", 100), 0);
}
use of com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestFirefoxCapabilitiesFactory method testCreateFirefoxCapabilitiesStandardBinPath.
@Test(groups = { "ut" })
public void testCreateFirefoxCapabilitiesStandardBinPath() {
Mockito.when(config.getMode()).thenReturn(DriverMode.LOCAL);
MutableCapabilities capa = new FirefoxCapabilitiesFactory(config).createCapabilities();
Assert.assertEquals(capa.getCapability(FirefoxDriver.BINARY), "/usr/bin/firefox");
}
use of com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestFirefoxCapabilitiesFactory method testCreateFirefoxCapabilitiesOverrideDownloadDir.
@Test(groups = { "ut" })
public void testCreateFirefoxCapabilitiesOverrideDownloadDir() {
Mockito.when(config.getBrowserDownloadDir()).thenReturn("/home/download");
Mockito.when(config.getMode()).thenReturn(DriverMode.LOCAL);
MutableCapabilities capa = new FirefoxCapabilitiesFactory(config).createCapabilities();
FirefoxProfile profile = (FirefoxProfile) capa.getCapability(FirefoxDriver.PROFILE);
// check profile
Assert.assertEquals(profile.getStringPreference("browser.download.dir", ""), "/home/download");
Assert.assertEquals(profile.getIntegerPreference("browser.download.folderList", 0), 2);
Assert.assertEquals(profile.getBooleanPreference("browser.download.manager.showWhenStarting", true), false);
Assert.assertEquals(profile.getStringPreference("browser.helperApps.neverAsk.saveToDisk", ""), "application/octet-stream,text/plain,application/pdf,application/zip,text/csv,text/html");
}
Aggregations