use of com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestMarionetteCapabilitiesFactory 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);
}
use of com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestMarionetteCapabilitiesFactory 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 TestMarionetteCapabilitiesFactory method testCreateDefaultCapabilities.
/**
* Check default behaviour
*/
@Test(groups = { "ut" })
public void testCreateDefaultCapabilities() {
Mockito.when(config.isEnableJavascript()).thenReturn(true);
Mockito.when(config.getProxy()).thenReturn(proxyConfig);
Mockito.when(config.getNodeTags()).thenReturn(new ArrayList<>());
MutableCapabilities capa = new FirefoxCapabilitiesFactory(config).createCapabilities();
Assert.assertTrue(capa.is(CapabilityType.SUPPORTS_JAVASCRIPT));
Assert.assertTrue(capa.is(CapabilityType.TAKES_SCREENSHOT));
Assert.assertTrue(capa.is(CapabilityType.ACCEPT_SSL_CERTS));
Assert.assertFalse(capa.is(SeleniumRobotCapabilityType.NODE_TAGS));
Assert.assertEquals(capa.getVersion(), "");
Assert.assertEquals(capa.getCapability(CapabilityType.PROXY), proxyConfig);
}
use of com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestMarionetteCapabilitiesFactory method testCreateMarionetteCapabilitiesStandardDriverPathLocal.
@Test(groups = { "ut" })
public void testCreateMarionetteCapabilitiesStandardDriverPathLocal() {
System.clearProperty(GeckoDriverService.GECKO_DRIVER_EXE_PROPERTY);
try {
Mockito.when(config.getMode()).thenReturn(DriverMode.LOCAL);
new FirefoxCapabilitiesFactory(config).createCapabilities();
Assert.assertTrue(System.getProperty(GeckoDriverService.GECKO_DRIVER_EXE_PROPERTY).replace(File.separator, "/").contains("/drivers/geckodriver"));
} finally {
System.clearProperty(GeckoDriverService.GECKO_DRIVER_EXE_PROPERTY);
}
}
use of com.seleniumtests.browserfactory.FirefoxCapabilitiesFactory in project seleniumRobot by bhecquet.
the class TestMarionetteCapabilitiesFactory 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 not set if name is not valid
Assert.assertNull(capa.getCapability("firefoxProfile"));
}
Aggregations