Search in sources :

Example 16 with MobileDevice

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));
}
Also used : MobileDevice(com.seleniumtests.browserfactory.mobile.MobileDevice) BrowserInfo(com.seleniumtests.browserfactory.BrowserInfo) DesiredCapabilities(org.openqa.selenium.remote.DesiredCapabilities) MutableCapabilities(org.openqa.selenium.MutableCapabilities) ArrayList(java.util.ArrayList) Test(org.testng.annotations.Test) MockitoTest(com.seleniumtests.MockitoTest) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest)

Aggregations

MobileDevice (com.seleniumtests.browserfactory.mobile.MobileDevice)16 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)16 Test (org.testng.annotations.Test)16 ArrayList (java.util.ArrayList)14 DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)13 MockitoTest (com.seleniumtests.MockitoTest)12 GenericDriverTest (com.seleniumtests.GenericDriverTest)4 ReporterTest (com.seleniumtests.it.reporter.ReporterTest)4 ExistingAppiumLauncher (com.seleniumtests.browserfactory.mobile.ExistingAppiumLauncher)3 URL (java.net.URL)3 Capabilities (org.openqa.selenium.Capabilities)3 MutableCapabilities (org.openqa.selenium.MutableCapabilities)3 BrowserInfo (com.seleniumtests.browserfactory.BrowserInfo)2 AndroidDriver (io.appium.java_client.android.AndroidDriver)2 AdbWrapper (com.seleniumtests.browserfactory.mobile.AdbWrapper)1 InstrumentsWrapper (com.seleniumtests.browserfactory.mobile.InstrumentsWrapper)1 LocalAppiumLauncher (com.seleniumtests.browserfactory.mobile.LocalAppiumLauncher)1 ConfigurationException (com.seleniumtests.customexception.ConfigurationException)1 IOSDriver (io.appium.java_client.ios.IOSDriver)1 SkipException (org.testng.SkipException)1