}
}
public IOSCapabilities getCapabilities() {
IOSCapabilities cap = new IOSCapabilities();
cap.setSupportedLanguages(getSupportedLanguagesCodes());
cap.setCapability("applicationPath", getApplicationPath().getAbsoluteFile());
List<DeviceType> supported = getSupportedDevices();
if (supported.contains(DeviceType.iphone)) {
cap.setDevice(DeviceType.iphone);
} else {
cap.setDevice(DeviceType.ipad);
}
if (this instanceof IPAApplication) {
cap.setCapability(IOSCapabilities.SIMULATOR, false);
} else {
cap.setCapability(IOSCapabilities.SIMULATOR, true);
}
cap.setCapability(IOSCapabilities.SUPPORTED_DEVICES, supported);
for (Iterator iterator = getMetadata().keys(); iterator.hasNext(); ) {
String key = (String) iterator.next();
try {
Object value = getMetadata().get(key);
cap.setCapability(key, value);
} catch (JSONException e) {
throw new WebDriverException("cannot get metadata", e);
}
}
return cap;