WIP upload a big file
authorpurigarcia <pgarcia@solidgear.es>
Wed, 3 Jun 2015 10:32:14 +0000 (12:32 +0200)
committerpurigarcia <pgarcia@solidgear.es>
Wed, 3 Jun 2015 10:32:14 +0000 (12:32 +0200)
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/UploadTestSuite.java

index af95647..287b43d 100644 (file)
@@ -105,8 +105,10 @@ public class UploadTestSuite{
                                fileHasBeenUploaded = fileListView.getFileElement().isDisplayed());
        }
 
                                fileHasBeenUploaded = fileListView.getFileElement().isDisplayed());
        }
 
+       
+       
        @Test
        @Test
-       @Category({NoIgnoreTestCategory.class, SmokeTestCategory.class, InProgressCategory.class})
+       @Category({UnfinishedTestCategory.class, InProgressCategory.class})
        public void testUploadBigFile () throws Exception {
 
                FileListView fileListView = Actions.login(Config.URL, Config.user,
        public void testUploadBigFile () throws Exception {
 
                FileListView fileListView = Actions.login(Config.URL, Config.user,
@@ -119,31 +121,29 @@ public class UploadTestSuite{
                FileListView fileListViewAfterUploadFile = Actions
                                .uploadFile(BIG_FILE_NAME, fileListView);
 
                FileListView fileListViewAfterUploadFile = Actions
                                .uploadFile(BIG_FILE_NAME, fileListView);
 
-               fileListViewAfterUploadFile.scrollTillFindElement(BIG_FILE_NAME);
+               
                driver.openNotifications();
                NotificationView notificationView = new NotificationView(driver);
 
                try{
                        if(notificationView.getUploadingNotification().isDisplayed()){
                                Common.waitTillElementIsPresent(
                driver.openNotifications();
                NotificationView notificationView = new NotificationView(driver);
 
                try{
                        if(notificationView.getUploadingNotification().isDisplayed()){
                                Common.waitTillElementIsPresent(
-                                               notificationView.getUploadSucceededNotification(),1000);
+                                               notificationView.getUploadSucceededNotification(),300000);
+                               driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME);
+                               driver.startActivity("com.owncloud.android", 
+                                               ".ui.activity.FileDisplayActivity");
+                               
                        }
                } catch (NoSuchElementException e) {
                        }
                } catch (NoSuchElementException e) {
-                       try{
-                               if(notificationView.getClearAllNotificationButton().isDisplayed()){
-                                       notificationView.tapOnClearAllNotification();
-                               }
-                       } catch (NoSuchElementException e2) {
-                               notificationView.tapOnBottomNotificationArea();
-                       }
+                       driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME);
+                       driver.startActivity("com.owncloud.android", 
+                                       ".ui.activity.FileDisplayActivity");
                }
 
                }
 
-
-
-
-               //fileListViewAfterUploadFile.pulldownToSeeNotification();
+               fileListViewAfterUploadFile.scrollTillFindElement(BIG_FILE_NAME);
 
                assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed());
 
                assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed());
+               
                Common.waitTillElementIsNotPresentWithoutTimeout(
                                fileListViewAfterUploadFile.getProgressCircular(), 1000);
                common.wait.until(ExpectedConditions.visibilityOf(
                Common.waitTillElementIsNotPresentWithoutTimeout(
                                fileListViewAfterUploadFile.getProgressCircular(), 1000);
                common.wait.until(ExpectedConditions.visibilityOf(
@@ -158,6 +158,7 @@ public class UploadTestSuite{
                                fileHasBeenUploaded = fileListView.getFileElement().isDisplayed());
        }
 
                                fileHasBeenUploaded = fileListView.getFileElement().isDisplayed());
        }
 
+
        @Test
        @Category(UnfinishedTestCategory.class)
        public void testUploadFromGmail () throws Exception {
        @Test
        @Category(UnfinishedTestCategory.class)
        public void testUploadFromGmail () throws Exception {
@@ -275,7 +276,7 @@ public class UploadTestSuite{
                        Actions.deleteElement(BIG_FILE_NAME,fileListView, driver);
                }
 
                        Actions.deleteElement(BIG_FILE_NAME,fileListView, driver);
                }
 
-               driver.removeApp("com.owncloud.android");
+               //driver.removeApp("com.owncloud.android");
                driver.quit();
        }
 
                driver.quit();
        }