类org.openqa.selenium.DeviceRotation源码实例Demo

下面列出了怎么用org.openqa.selenium.DeviceRotation的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: java-client   文件: AppiumDriver.java
@Override
public DeviceRotation rotation() {
    Response response = execute(DriverCommand.GET_SCREEN_ROTATION);
    DeviceRotation deviceRotation =
            new DeviceRotation((Map<String, Number>) response.getValue());
    if (deviceRotation.getX() < 0 || deviceRotation.getY() < 0 || deviceRotation.getZ() < 0) {
        throw new WebDriverException("Unexpected orientation returned: " + deviceRotation);
    }
    return deviceRotation;
}
 
源代码2 项目: java-client   文件: UIAutomator2Test.java
@Test
public void testLandscapeRightRotation() {
    new WebDriverWait(driver, 20).until(ExpectedConditions
            .elementToBeClickable(driver.findElementById("android:id/content")
                    .findElement(MobileBy.AccessibilityId("Graphics"))));
    DeviceRotation landscapeRightRotation = new DeviceRotation(0, 0, 90);
    driver.rotate(landscapeRightRotation);
    assertEquals(driver.rotation(), landscapeRightRotation);
}
 
源代码3 项目: java-client   文件: UIAutomator2Test.java
@Test
public void testLandscapeLeftRotation() {
    new WebDriverWait(driver, 20).until(ExpectedConditions
            .elementToBeClickable(driver.findElementById("android:id/content")
                    .findElement(MobileBy.AccessibilityId("Graphics"))));
    DeviceRotation landscapeLeftRotation = new DeviceRotation(0, 0, 270);
    driver.rotate(landscapeLeftRotation);
    assertEquals(driver.rotation(), landscapeLeftRotation);
}
 
源代码4 项目: java-client   文件: UIAutomator2Test.java
@Test
public void testPortraitUpsideDown() {
    new WebDriverWait(driver, 20).until(ExpectedConditions
            .elementToBeClickable(driver.findElementById("android:id/content")
                    .findElement(MobileBy.AccessibilityId("Graphics"))));
    DeviceRotation landscapeRightRotation = new DeviceRotation(0, 0, 180);
    driver.rotate(landscapeRightRotation);
    assertEquals(driver.rotation(), landscapeRightRotation);
}
 
源代码5 项目: selenium   文件: RemoteRotatable.java
@Override
public DeviceRotation rotation() {
  Object result = executeMethod.execute(DriverCommand.GET_SCREEN_ROTATION, null);
  if (!(result instanceof Map)) {
    throw new IllegalStateException("Unexpected return value: " + result);
  }

  @SuppressWarnings("unchecked") Map<String, Number> raw = (Map<String, Number>) result;
  return new DeviceRotation(raw);
}
 
源代码6 项目: bobcat   文件: WebDriverWrapper.java
@Override
public void rotate(DeviceRotation deviceRotation) {
  ((Rotatable) super.getWrappedDriver()).rotate(deviceRotation);
}
 
源代码7 项目: bobcat   文件: WebDriverWrapper.java
@Override
public DeviceRotation rotation() {
  return ((Rotatable) super.getWrappedDriver()).rotation();
}
 
源代码8 项目: java-client   文件: AppiumDriver.java
@Override
public void rotate(DeviceRotation rotation) {
    execute(DriverCommand.SET_SCREEN_ROTATION, rotation.parameters());
}
 
源代码9 项目: java-client   文件: UIAutomator2Test.java
@After
public void afterMethod() {
    driver.rotate(new DeviceRotation(0, 0, 0));
}
 
源代码10 项目: java-client   文件: EmptyWebDriver.java
@Override public void rotate(DeviceRotation rotation) {
    //The rotation does nothing there
}
 
源代码11 项目: java-client   文件: EmptyWebDriver.java
@Override public DeviceRotation rotation() {
    return null;
}
 
源代码12 项目: java-client   文件: RotationTest.java
@After public void afterMethod() {
    driver.rotate(new DeviceRotation(0, 0, 0));
}
 
源代码13 项目: java-client   文件: RotationTest.java
@Test public void testLandscapeRightRotation() {
    DeviceRotation landscapeRightRotation = new DeviceRotation(0, 0, 90);
    driver.rotate(landscapeRightRotation);
    assertEquals(driver.rotation(), landscapeRightRotation);
}
 
源代码14 项目: java-client   文件: RotationTest.java
@Test public void testLandscapeLeftRotation() {
    DeviceRotation landscapeLeftRotation = new DeviceRotation(0, 0, 270);
    driver.rotate(landscapeLeftRotation);
    assertEquals(driver.rotation(), landscapeLeftRotation);
}
 
源代码15 项目: selenium   文件: RemoteRotatable.java
@Override
public void rotate(DeviceRotation rotation) {
  executeMethod.execute(DriverCommand.SET_SCREEN_ORIENTATION, rotation.parameters());
}
 
 类所在包
 类方法
 同包方法