Search in sources :

Example 1 with NotificationView

use of com.owncloud.android.test.ui.models.NotificationView in project android by owncloud.

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());
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) NotificationView(com.owncloud.android.test.ui.models.NotificationView) NoSuchElementException(org.openqa.selenium.NoSuchElementException) InProgressCategory(com.owncloud.android.test.ui.groups.InProgressCategory) SmokeTestCategory(com.owncloud.android.test.ui.groups.SmokeTestCategory) UnfinishedTestCategory(com.owncloud.android.test.ui.groups.UnfinishedTestCategory) FailingTestCategory(com.owncloud.android.test.ui.groups.FailingTestCategory) Category(org.junit.experimental.categories.Category) NoIgnoreTestCategory(com.owncloud.android.test.ui.groups.NoIgnoreTestCategory) Test(org.junit.Test)

Aggregations

FailingTestCategory (com.owncloud.android.test.ui.groups.FailingTestCategory)1 InProgressCategory (com.owncloud.android.test.ui.groups.InProgressCategory)1 NoIgnoreTestCategory (com.owncloud.android.test.ui.groups.NoIgnoreTestCategory)1 SmokeTestCategory (com.owncloud.android.test.ui.groups.SmokeTestCategory)1 UnfinishedTestCategory (com.owncloud.android.test.ui.groups.UnfinishedTestCategory)1 FileListView (com.owncloud.android.test.ui.models.FileListView)1 NotificationView (com.owncloud.android.test.ui.models.NotificationView)1 Test (org.junit.Test)1 Category (org.junit.experimental.categories.Category)1 NoSuchElementException (org.openqa.selenium.NoSuchElementException)1