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
All Methods Static Methods Instance Methods Concrete Methods 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 Detail
-
capabilities
public org.openqa.selenium.remote.DesiredCapabilities capabilities
-
APP_DIR_PATH
public static String APP_DIR_PATH
-
APP_NAME
public static String APP_NAME
-
IS_HYBRID_APP
public static String IS_HYBRID_APP
-
CHROME_VERSION
public static String CHROME_VERSION
-
WDA_LOCAL_PORT
public static int WDA_LOCAL_PORT
-
-
Method Detail
-
withCapability
public IosCapability withCapability(org.openqa.selenium.remote.DesiredCapabilities Capabilities)
-
getCapability
public org.openqa.selenium.remote.DesiredCapabilities getCapability()
-
withDevice
public IosCapability withDevice(String device)
device: property name from property file. eg. device1, device2- Parameters:
device-- Returns:
-
getAppPath
public String getAppPath()
-
withIosCapability
public IosCapability 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
public static List<String> 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
public void setPort(String deviceName)
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
-
-