use of com.seleniumtests.browserfactory.mobile.MobileDevice in project seleniumRobot by bhecquet.
the class TestMobileDeviceSelector method testCapabilitiesUpdateWithDriverNonLocal.
/**
* Test the driver capabilities are not updated with driver executable when using browsers in non-local mode
*/
@Test(groups = { "ut" })
public void testCapabilitiesUpdateWithDriverNonLocal() {
// available devices
List<MobileDevice> deviceList = new ArrayList<>();
BrowserInfo chromeInfo = new BrowserInfo(BrowserType.BROWSER, "47.0", null);
chromeInfo.setDriverFileName("chromedriver2.exe");
deviceList.add(new MobileDevice("nexus 5", "1234", "android", "5.0", Arrays.asList(chromeInfo)));
when(adbWrapper.getDeviceList()).thenReturn(deviceList);
DesiredCapabilities requestedCaps = new DesiredCapabilities();
requestedCaps.setCapability(MobileCapabilityType.DEVICE_NAME, "Nexus 5");
requestedCaps.setCapability(MobileCapabilityType.BROWSER_NAME, "browser");
deviceSelector.setAndroidReady(true);
deviceSelector.setIosReady(false);
MutableCapabilities updatedCaps = deviceSelector.updateCapabilitiesWithSelectedDevice(requestedCaps, DriverMode.SAUCELABS);
Assert.assertNull(updatedCaps.getCapability(AndroidMobileCapabilityType.CHROMEDRIVER_EXECUTABLE));
}
Aggregations