Search in sources :

Example 6 with FirefoxCapabilitiesFactory

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

the class TestMarionetteCapabilitiesFactory method testCreateMarionetteCapabilitiesStandardDriverPathGrid.

@Test(groups = { "ut" })
public void testCreateMarionetteCapabilitiesStandardDriverPathGrid() {
    System.clearProperty(GeckoDriverService.GECKO_DRIVER_EXE_PROPERTY);
    Mockito.when(config.getMode()).thenReturn(DriverMode.GRID);
    new FirefoxCapabilitiesFactory(config).createCapabilities();
    Assert.assertNull(System.getProperty(GeckoDriverService.GECKO_DRIVER_EXE_PROPERTY));
}
Also used : FirefoxCapabilitiesFactory(com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory) Test(org.testng.annotations.Test) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) MockitoTest(com.seleniumtests.MockitoTest)

Example 7 with FirefoxCapabilitiesFactory

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

the class TestMarionetteCapabilitiesFactory method testCreateDefaultCapabilitiesWithJavascriptDisabled.

@Test(groups = { "ut" })
public void testCreateDefaultCapabilitiesWithJavascriptDisabled() {
    Mockito.when(config.isEnableJavascript()).thenReturn(false);
    Mockito.when(config.getProxy()).thenReturn(proxyConfig);
    MutableCapabilities capa = new FirefoxCapabilitiesFactory(config).createCapabilities();
    Assert.assertFalse(capa.is(CapabilityType.SUPPORTS_JAVASCRIPT));
}
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 8 with FirefoxCapabilitiesFactory

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

the class TestFirefoxCapabilitiesFactory method testCreateDefaultCapabilitiesWithPlatform.

@Test(groups = { "ut" })
public void testCreateDefaultCapabilitiesWithPlatform() {
    Mockito.when(config.isEnableJavascript()).thenReturn(true);
    Mockito.when(config.getProxy()).thenReturn(proxyConfig);
    Mockito.when(config.getWebPlatform()).thenReturn(Platform.WINDOWS);
    MutableCapabilities capa = new FirefoxCapabilitiesFactory(config).createCapabilities();
    Assert.assertEquals(capa.getPlatform(), Platform.WINDOWS);
}
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 9 with FirefoxCapabilitiesFactory

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

the class TestFirefoxCapabilitiesFactory method testCreateDefaultCapabilitiesWithNodeTagsInGridMode.

/**
 * Check default behaviour when node tags are defined in grid mode
 * tags are transferred to driver
 */
@Test(groups = { "ut" })
public void testCreateDefaultCapabilitiesWithNodeTagsInGridMode() {
    Mockito.when(config.isEnableJavascript()).thenReturn(true);
    Mockito.when(config.getProxy()).thenReturn(proxyConfig);
    Mockito.when(config.getNodeTags()).thenReturn(Arrays.asList("foo", "bar"));
    Mockito.when(config.getMode()).thenReturn(DriverMode.GRID);
    MutableCapabilities capa = new FirefoxCapabilitiesFactory(config).createCapabilities();
    Assert.assertEquals(capa.getCapability(SeleniumRobotCapabilityType.NODE_TAGS), Arrays.asList("foo", "bar"));
}
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 10 with FirefoxCapabilitiesFactory

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

the class TestFirefoxCapabilitiesFactory method testCreateFirefoxCapabilitiesWithDefaultProfile.

@Test(groups = { "ut" })
public void testCreateFirefoxCapabilitiesWithDefaultProfile() {
    Mockito.when(config.getMode()).thenReturn(DriverMode.GRID);
    Mockito.when(config.getFirefoxProfilePath()).thenReturn(BrowserInfo.DEFAULT_BROWSER_PRODFILE);
    MutableCapabilities capa = new FirefoxCapabilitiesFactory(config).createCapabilities();
    // check 'firefoxProfile' is set to 'default'
    Assert.assertEquals(capa.getCapability("firefoxProfile"), BrowserInfo.DEFAULT_BROWSER_PRODFILE);
}
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