List of usage examples for org.openqa.selenium ScreenOrientation PORTRAIT
ScreenOrientation PORTRAIT
To view the source code for org.openqa.selenium ScreenOrientation PORTRAIT.
Click Source Link
From source file:com.atanas.kanchev.testframework.core.tests.handlers.AppiumInitTest.java
License:Apache License
@Test public void androidChromeTest() throws Exception { // appiumInit() // .setupDevice() // .setDeviceType(AppiumDeviceTypesEnum.ANDROID_DEVICE) // .setDeviceName("ZY22398GL7") // .setPlatformVersion("6.0.1"); ///*from ww w. j av a2 s.co m*/ // appiumInit() // .setupDeviceServer() // .setBrowserName(MobileBrowserType.CHROME) // .setFullReset(false) // .setAutoLaunch(false); // // appiumInit() // .setupAndroidDriver() // .setAndroidDeviceReadyTimeout(60) // .setEnablePerformanceLogging(true); // // appiumInit() // .initAndroidDriver("http://127.0.0.1:4723/wd/hub"); goTo("https://bbc.co.uk"); find().elementBy(By.id("idcta-link")); interact().click(); Thread.sleep(10000); android().orientation().rotate(ScreenOrientation.PORTRAIT); }
From source file:com.comcast.magicwand.spells.appium.AbstractAppiumPhoenixDriverTest.java
License:Apache License
@Test public void testGetOrientation() { final ScreenOrientation expected = ScreenOrientation.PORTRAIT; ScreenOrientation actual;// w w w . j ava 2 s .c o m when(this.appiumDriverMock.getOrientation()).thenReturn(expected); actual = this.myTestObj.getOrientation(); Assert.assertEquals(expected, actual); }
From source file:com.github.wasiqb.coteafs.appium.android.VodQATest.java
License:Apache License
/** * @author wasiqb/* w w w.j a va 2s .c o m*/ * @since Oct 21, 2018 * @return orientation list */ @DataProvider public static Iterator<Object[]> getOrientation() { final List<Object[]> data = new ArrayList<>(); data.add(new Object[] { ScreenOrientation.LANDSCAPE }); data.add(new Object[] { ScreenOrientation.PORTRAIT }); return data.iterator(); }
From source file:com.google.android.testing.nativedriver.server.AndroidNativeDriver.java
License:Apache License
@Override public ScreenOrientation getOrientation() { int orientation = context.getOnMainSyncRunner().run(doGetOrientation()); if ((orientation == Surface.ROTATION_0) || (orientation == Surface.ROTATION_180)) { return ScreenOrientation.PORTRAIT; } else { // Surface.ROTATION_90 or Surface.ROTATION_270 return ScreenOrientation.LANDSCAPE; }//from w w w .j a v a 2s .c o m }
From source file:com.mengge.AppiumDriver.java
License:Apache License
@Override public ScreenOrientation getOrientation() { Response response = execute(DriverCommand.GET_SCREEN_ORIENTATION); String orientation = response.getValue().toString().toLowerCase(); if (orientation.equals(ScreenOrientation.LANDSCAPE.value())) { return ScreenOrientation.LANDSCAPE; } else if (orientation.equals(ScreenOrientation.PORTRAIT.value())) { return ScreenOrientation.PORTRAIT; } else {//from w w w . j a v a2 s. c om throw new WebDriverException("Unexpected orientation returned: " + orientation); } }
From source file:com.opera.core.systems.MobileRotationTest.java
License:Apache License
@Test public void rotation() { assertEquals(ScreenOrientation.PORTRAIT, driver.getOrientation()); }
From source file:com.opera.core.systems.OperaMobileDriver.java
License:Apache License
public ScreenOrientation getOrientation() { return ScreenOrientation.PORTRAIT; }
From source file:com.owncloud.android.test.ui.actions.Actions.java
License:Open Source License
public static FileListView login(String url, String user, String password, Boolean isTrusted, AndroidDriver driver) throws InterruptedException { LoginForm loginForm = new LoginForm(driver); CertificatePopUp certificatePopUp = loginForm.typeHostUrl(url); if (!isTrusted) { WebDriverWait wait = new WebDriverWait(driver, 30); //sometimes the certificate has been already accept //and it doesn't appear again try {/*from ww w .ja v a2s . co m*/ wait.until(ExpectedConditions.visibilityOf(certificatePopUp.getOkButtonElement())); //we need to repaint the screen //because of some element are misplaced driver.rotate(ScreenOrientation.LANDSCAPE); driver.rotate(ScreenOrientation.PORTRAIT); certificatePopUp.clickOnOkButton(); } catch (NoSuchElementException e) { } } loginForm.typeUserName(user); loginForm.typePassword(password); //TODO. Assert related to check the connection? return loginForm.clickOnConnectButton(); }
From source file:com.owncloud.android.test.ui.testSuites.LoginTestSuite.java
License:Open Source License
@Test
@Category({ NoIgnoreTestCategory.class })
public void test1LoginPortrait() throws Exception {
driver.rotate(ScreenOrientation.PORTRAIT);
Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
common.assertIsInFileListView();/*w ww. ja va2 s . c om*/
}
From source file:com.owncloud.android.test.ui.testSuites.LoginTestSuite.java
License:Open Source License
@Test
@Category({ NoIgnoreTestCategory.class, SmokeTestCategory.class })
public void testLoginAndShowFiles() throws Exception {
driver.rotate(ScreenOrientation.PORTRAIT);
FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted,
driver);/* ww w . j a va 2s. com*/
common.assertIsInFileListView();
fileListView.scrollTillFindElement(Config.fileWhichIsInTheServer1);
assertTrue(fileListView.getFileElement().isDisplayed());
}