Class IosCapability
java.lang.Object
core.uiCore.driverProperties.capabilities.IosCapability
public class IosCapability extends Object
- Author:
- ehsan.matean
-
Field Summary
Fields Modifier and Type Field Description static StringAPP_DIR_PATHstatic StringAPP_NAMEorg.openqa.selenium.remote.DesiredCapabilitiescapabilitiesstatic StringCHROME_VERSIONstatic StringIS_HYBRID_APPList<String>simulatorListstatic intWDA_LOCAL_PORT -
Constructor Summary
Constructors Constructor Description IosCapability() -
Method Summary
Modifier and Type Method Description StringgetAppPath()org.openqa.selenium.remote.DesiredCapabilitiesgetCapability()static List<String>getIosDeviceList()gets the list of android devices including real devices + emulators require idevice installed: brew install ideviceinstallerbooleanisRealDeviceConnected()if adb device contains emulator, Then its an emulator otherwise, its a connected real devicevoidsetChromeDriver()download chrome driver if hybrid app is enabled if Version is LATEST, download latest driver unless set in configorg.openqa.selenium.remote.DesiredCapabilitiessetiOSCapabilties()set capabilties with prefix ios.capabilties.voidsetIosDevice()sets device by following strategy: if device is connected, selects device if emulator is not specified with "withDevice1() or with Device2() function, select device 1 by default from properties else select emulator from properties specified in panel config pagevoidsetPort(String deviceName)if device has port assigned, use assigned port else generate new port numbervoidsetRealDevices()sets real devicevoidsetSimulator()sets ios device number of devices must be equal or greater than number of threads for parallel runvoidsetSingleSignIn()runs subsequent tests without restarting the app removes the need to sign in on every test if tests fail, it will restart the appIosCapabilitywithCapability(org.openqa.selenium.remote.DesiredCapabilities Capabilities)IosCapabilitywithDevice(String device)device: property name from property file.IosCapabilitywithIosCapability()sets ios capabilities values are from maven or properties file maven has higher priority than properties
-
Field Details
-
capabilities
public org.openqa.selenium.remote.DesiredCapabilities capabilities -
APP_DIR_PATH
-
APP_NAME
-
IS_HYBRID_APP
-
CHROME_VERSION
-
simulatorList
-
WDA_LOCAL_PORT
public static int WDA_LOCAL_PORT
-
-
Constructor Details
-
IosCapability
public IosCapability()
-
-
Method Details
-
withCapability
-
getCapability
public org.openqa.selenium.remote.DesiredCapabilities getCapability() -
withDevice
device: property name from property file. eg. device1, device2- Parameters:
device-- Returns:
-
getAppPath
-
withIosCapability
sets ios capabilities values are from maven or properties file maven has higher priority than properties- Returns:
-
setiOSCapabilties
public org.openqa.selenium.remote.DesiredCapabilities setiOSCapabilties()set capabilties with prefix ios.capabilties. eg. ios.capabilties.fullReset="false iterates through all property values with such prefix And adds them to android desired capabilities- Returns:
-
setSingleSignIn
public void setSingleSignIn()runs subsequent tests without restarting the app removes the need to sign in on every test if tests fail, it will restart the app -
isRealDeviceConnected
public boolean isRealDeviceConnected()if adb device contains emulator, Then its an emulator otherwise, its a connected real device- Parameters:
devices-- Returns:
-
getIosDeviceList
gets the list of android devices including real devices + emulators require idevice installed: brew install ideviceinstaller- Returns:
-
setSimulator
public void setSimulator()sets ios device number of devices must be equal or greater than number of threads for parallel run -
setRealDevices
public void setRealDevices()sets real device -
setIosDevice
public void setIosDevice()sets device by following strategy: if device is connected, selects device if emulator is not specified with "withDevice1() or with Device2() function, select device 1 by default from properties else select emulator from properties specified in panel config page -
setPort
if device has port assigned, use assigned port else generate new port number- Parameters:
deviceName-
-
setChromeDriver
public void setChromeDriver()download chrome driver if hybrid app is enabled if Version is LATEST, download latest driver unless set in config
-