cap.setCapability(LOCALE, "en_GB");
cap.setCapability(BUNDLE_NAME, "Safari");
// normal iphone
driver = new RemoteIOSDriver(getRemoteURL(), cap);
Capabilities actual = driver.getCapabilities();
driver.switchTo().window("Web");
driver.get(getRemoteURL() + "/status");
for (Orientation o : Orientation.values()) {
if (o == Orientation.UIA_DEVICE_ORIENTATION_FACEUP
|| o == Orientation.UIA_DEVICE_ORIENTATION_FACEDOWN
|| (o == Orientation.UIA_DEVICE_ORIENTATION_PORTRAIT_UPSIDEDOWN
&& device == DeviceType.iphone)) {
continue;
}
driver.rotate(o);
}
Assert.assertEquals(actual.getCapability(DEVICE), device.toString());
File f = driver.getScreenshotAs(OutputType.FILE);
BufferedImage bimg = ImageIO.read(f);
Assert.assertTrue(bimg.getWidth() == expectedW || bimg.getHeight() == expectedW);