Search in sources :

Example 36 with FirefoxCapabilitiesFactory

use of com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory in project seleniumRobot by bhecquet.

the class TestMarionetteCapabilitiesFactory 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");
}
Also used : MutableCapabilities(org.openqa.selenium.MutableCapabilities) FirefoxCapabilitiesFactory(com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory) Test(org.testng.annotations.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) MockitoTest(com.seleniumtests.MockitoTest)

Example 37 with FirefoxCapabilitiesFactory

use of com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory in project seleniumRobot by bhecquet.

the class TestMarionetteCapabilitiesFactory method testCreateMarionetteCapabilitiesNoOverrideDownloadDirRemote.

/**
 * issue #365: Check DownloadDir is not set in remote
 */
@Test(groups = { "ut" })
public void testCreateMarionetteCapabilitiesNoOverrideDownloadDirRemote() {
    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", ""), "");
}
Also used : MutableCapabilities(org.openqa.selenium.MutableCapabilities) FirefoxCapabilitiesFactory(com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory) FirefoxProfile(org.openqa.selenium.firefox.FirefoxProfile) Test(org.testng.annotations.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) MockitoTest(com.seleniumtests.MockitoTest)

Example 38 with FirefoxCapabilitiesFactory

use of com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory in project seleniumRobot by bhecquet.

the class TestMarionetteCapabilitiesFactory 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 user profile
    Assert.assertEquals(capa.getCapability("firefoxProfile"), "/home/user/profile");
}
Also used : MutableCapabilities(org.openqa.selenium.MutableCapabilities) FirefoxCapabilitiesFactory(com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory) Test(org.testng.annotations.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) MockitoTest(com.seleniumtests.MockitoTest)

Aggregations

MockitoTest (com.seleniumtests.MockitoTest)38 FirefoxCapabilitiesFactory (com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory)38 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)38 Test (org.testng.annotations.Test)38 MutableCapabilities (org.openqa.selenium.MutableCapabilities)35 FirefoxProfile (org.openqa.selenium.firefox.FirefoxProfile)10 HashMap (java.util.HashMap)4 BrowserInfo (com.seleniumtests.browserfactory.BrowserInfo)2 BrowserType (com.seleniumtests.driver.BrowserType)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Map (java.util.Map)2