if (desiredCapabilities.getCapability(IOSCapabilities.SIMULATOR) != null &&
desiredCapabilities.isSimulator() != appCapability.isSimulator()) {
return false;
}
if (desiredCapabilities.getBundleName() == null) {
throw new WebDriverException("you need to specify the bundle to test.");
}
String desired = desiredCapabilities.getBundleName();
String bundleName = (String) appCapability.getCapability(IOSCapabilities.BUNDLE_NAME);
String displayName = (String) appCapability.getCapability(IOSCapabilities.BUNDLE_DISPLAY_NAME);
String name = bundleName != null ? bundleName : displayName;
if (!desired.equals(name)) {
return false;
}
if (desiredCapabilities.getBundleVersion() != null && !desiredCapabilities.getBundleVersion()
.equals(appCapability.getBundleVersion())) {
return false;
}
if (desiredCapabilities.getDevice() == null) {
throw new WebDriverException("you need to specify the device.");
}
if (!appCapability.getSupportedDevices().contains(desiredCapabilities.getDevice())) {
return false;
}