use of com.owncloud.android.test.ui.models.FileListView in project android by nextcloud.
the class ShareLinkFileTestSuite method tearDown.
@After
public void tearDown() throws Exception {
common.takeScreenShotOnFailed(name.getMethodName());
if (fileHasBeenCreated) {
FileListView fileListView = new FileListView(driver);
Actions.deleteElement(FILE_NAME, fileListView, driver);
}
driver.removeApp("com.owncloud.android");
driver.quit();
}
use of com.owncloud.android.test.ui.models.FileListView in project android by nextcloud.
the class ShareLinkFileTestSuite method testShareLinkFileByCopyLink.
@Test
@Category({ NoIgnoreTestCategory.class, SmokeTestCategory.class })
public void testShareLinkFileByCopyLink() throws Exception {
AndroidElement sharedElementIndicator;
FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
common.assertIsInFileListView();
// TODO. if the file already exists, do not upload
FileListView fileListViewAfterUploadFile = Actions.uploadFile(FILE_NAME, fileListView);
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile.getFileElement().isDisplayed());
sharedElementIndicator = Actions.shareLinkElementByCopyLink(FILE_NAME, fileListViewAfterUploadFile, driver, common);
assertTrue(sharedElementIndicator.isDisplayed());
}
use of com.owncloud.android.test.ui.models.FileListView in project android by nextcloud.
the class UploadTestSuite method testKeepFileUpToDate.
@Test
@Category({ FailingTestCategory.class })
public void testKeepFileUpToDate() throws Exception {
FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
common.assertIsInFileListView();
Common.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(), 1000);
FileListView fileListViewAfterUploadFile = Actions.uploadFile(FILE_NAME, fileListView);
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
assertTrue(fileHasBeenUploaded = fileListViewAfterUploadFile.getFileElement().isDisplayed());
ElementMenuOptions menuOptions = fileListViewAfterUploadFile.longPressOnElement(FILE_NAME);
FileDetailsView fileDetailsView = menuOptions.clickOnDetails();
fileDetailsView.checkKeepFileUpToDateCheckbox();
Thread.sleep(3000);
driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_BACK);
assertTrue(common.isElementPresent(fileListViewAfterUploadFile.getFileElementLayout(), MobileBy.id(FileListView.getFavoriteFileIndicator())));
assertTrue(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getFavoriteFileIndicator())).isDisplayed());
}
use of com.owncloud.android.test.ui.models.FileListView in project android by nextcloud.
the class UploadTestSuite method testUploadBigFile.
@Test
@Category({ UnfinishedTestCategory.class })
public void testUploadBigFile() throws Exception {
FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
common.assertIsInFileListView();
// check if the file already exists and if true, delete it
Actions.deleteElement(BIG_FILE_NAME, fileListView, driver);
FileListView fileListViewAfterUploadFile = Actions.uploadFile(BIG_FILE_NAME, fileListView);
driver.openNotifications();
NotificationView notificationView = new NotificationView(driver);
try {
if (notificationView.getUploadingNotification().isDisplayed()) {
Common.waitTillElementIsPresent(notificationView.getUploadSucceededNotification(), 300000);
driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME);
driver.startActivity("com.owncloud.android", ".ui.activity.FileDisplayActivity");
}
} catch (NoSuchElementException e) {
driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME);
driver.startActivity("com.owncloud.android", ".ui.activity.FileDisplayActivity");
}
fileListViewAfterUploadFile.scrollTillFindElement(BIG_FILE_NAME);
assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed());
Common.waitTillElementIsNotPresentWithoutTimeout(fileListViewAfterUploadFile.getProgressCircular(), 1000);
common.wait.until(ExpectedConditions.visibilityOf(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getLocalFileIndicator()))));
assertTrue(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getLocalFileIndicator())).isDisplayed());
fileListView = new FileListView(driver);
fileListView.scrollTillFindElement(BIG_FILE_NAME);
assertTrue(fileHasBeenUploaded = fileListView.getFileElement().isDisplayed());
}
Aggregations