Browse Source

add headers. reformat files

purigarcia 10 năm trước cách đây
mục cha
commit
8386357e68
44 tập tin đã thay đổi với 1228 bổ sung166 xóa
  1. 60 20
      automationTest/src/test/java/com/owncloud/android/test/ui/actions/Actions.java
  2. 19 0
      automationTest/src/test/java/com/owncloud/android/test/ui/groups/FailingTestCategory.java
  3. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/groups/IgnoreTestCategory.java
  4. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/groups/NoIgnoreTestCategory.java
  5. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/groups/OtherTestCategory.java
  6. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/groups/SmokeTestCategory.java
  7. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/groups/UnfinishedTestCategory.java
  8. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/models/CertificatePopUp.java
  9. 22 1
      automationTest/src/test/java/com/owncloud/android/test/ui/models/ElementMenuOptions.java
  10. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/models/FileDetailsView.java
  11. 41 10
      automationTest/src/test/java/com/owncloud/android/test/ui/models/FileListView.java
  12. 24 2
      automationTest/src/test/java/com/owncloud/android/test/ui/models/GmailEmailListView.java
  13. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/models/GmailEmailView.java
  14. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/models/GmailSendMailView.java
  15. 23 2
      automationTest/src/test/java/com/owncloud/android/test/ui/models/ImageView.java
  16. 28 4
      automationTest/src/test/java/com/owncloud/android/test/ui/models/LoginForm.java
  17. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/models/MenuList.java
  18. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/models/MoveView.java
  19. 24 2
      automationTest/src/test/java/com/owncloud/android/test/ui/models/NewFolderPopUp.java
  20. 32 6
      automationTest/src/test/java/com/owncloud/android/test/ui/models/PassCodeRequestView.java
  21. 36 8
      automationTest/src/test/java/com/owncloud/android/test/ui/models/PassCodeView.java
  22. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/models/RemoveConfirmationView.java
  23. 22 1
      automationTest/src/test/java/com/owncloud/android/test/ui/models/SettingsView.java
  24. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/models/ShareView.java
  25. 22 1
      automationTest/src/test/java/com/owncloud/android/test/ui/models/UploadFilesView.java
  26. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/models/UploadView.java
  27. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/models/WaitAMomentPopUp.java
  28. 59 16
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/Common.java
  29. 28 4
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/CreateFolderTestSuite.java
  30. 29 4
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/DeleteFileTestSuite.java
  31. 30 5
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/DeleteFolderTestSuite.java
  32. 41 10
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/LoginTestSuite.java
  33. 24 2
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/LogoutTestSuite.java
  34. 36 8
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/MoveFileTestSuite.java
  35. 36 8
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/MoveFolderTestSuite.java
  36. 35 7
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/PasscodeTestSuite.java
  37. 24 2
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RefreshFolderTestSuite.java
  38. 39 9
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RenameFileTestSuite.java
  39. 36 8
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RenameFolderTestSuite.java
  40. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunFailingTests.java
  41. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunNoIgnoreTests.java
  42. 20 0
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunSmokeTests.java
  43. 38 8
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/ShareLinkFileTestSuite.java
  44. 60 18
      automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/UploadTestSuite.java

+ 60 - 20
automationTest/src/test/java/com/owncloud/android/test/ui/actions/Actions.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.actions;
 
 import java.util.HashMap;
@@ -26,15 +46,20 @@ import com.owncloud.android.test.ui.testSuites.Common;
 
 public class Actions {
 
-	public static FileListView login(String url, String user, String password, Boolean isTrusted, AndroidDriver driver) throws InterruptedException {
+	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
+			//sometimes the certificate has been already accept 
+			//and it doesn't appear again
 			try {
-				wait.until(ExpectedConditions.visibilityOf(certificatePopUp.getOkButtonElement()));
-				//we need to repaint the screen because of some element are misplaced
+				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();
@@ -49,26 +74,30 @@ public class Actions {
 		return loginForm.clickOnConnectButton();
 	}
 
-	public static WaitAMomentPopUp createFolder(String folderName, FileListView fileListView){
+	public static WaitAMomentPopUp createFolder(String folderName,
+			FileListView fileListView){
 		NewFolderPopUp newFolderPopUp = fileListView.clickOnNewFolderButton();
 		newFolderPopUp.typeNewFolderName(folderName);
-		WaitAMomentPopUp waitAMomentPopUp = newFolderPopUp.clickOnNewFolderOkButton();
+		WaitAMomentPopUp waitAMomentPopUp = newFolderPopUp
+				.clickOnNewFolderOkButton();
 		//TODO. assert here
 		return waitAMomentPopUp;
 	}
 
 
-	public static AndroidElement scrollTillFindElement (String elementName, AndroidElement element, AndroidDriver driver) {
+	public static AndroidElement scrollTillFindElement (String elementName,
+			AndroidElement element, AndroidDriver driver) {
 		AndroidElement fileElement;
 
 		if(element.getAttribute("scrollable").equals("true")){
-			HashMap<String, String> scrollObject = new HashMap<String, String>();
+			HashMap<String, String> scrollObject = new HashMap<String,String>();
 			scrollObject.put("text", elementName);
 			scrollObject.put("element", ( (RemoteWebElement) element).getId());
 			driver.executeScript("mobile: scrollTo", scrollObject);
 		}
 		try {
-			fileElement = (AndroidElement) driver.findElementByName(elementName);
+			fileElement = (AndroidElement) driver
+					.findElementByName(elementName);
 		} catch (NoSuchElementException e) {
 			fileElement = null;
 		}
@@ -92,28 +121,39 @@ public class Actions {
 	}
 
 	//TODO. convert deleteFodler and deleteFile in deleteElement
-	public static AndroidElement deleteElement(String elementName,  FileListView fileListView, AndroidDriver driver) throws Exception{
+	public static AndroidElement deleteElement(String elementName,  
+			FileListView fileListView, AndroidDriver driver) throws Exception{
 		AndroidElement fileElement;
 		WaitAMomentPopUp waitAMomentPopUp;
 		try{
-			//To open directly the "file list view" and we don't need to know in which view we are
-			driver.startActivity("com.owncloud.android", ".ui.activity.FileDisplayActivity");
-			fileElement = (AndroidElement) driver.findElementByName(elementName);
-			ElementMenuOptions menuOptions = fileListView.longPressOnElement(elementName);
-			RemoveConfirmationView removeConfirmationView = menuOptions.clickOnRemove();;
-			waitAMomentPopUp = removeConfirmationView.clickOnRemoteAndLocalButton();
-			Common.waitTillElementIsNotPresent(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
+			//To open directly the "file list view" and
+			//we don't need to know in which view we are
+			driver.startActivity("com.owncloud.android",
+					".ui.activity.FileDisplayActivity");
+			fileElement = (AndroidElement) driver
+					.findElementByName(elementName);
+			ElementMenuOptions menuOptions = fileListView
+					.longPressOnElement(elementName);
+			RemoveConfirmationView removeConfirmationView = menuOptions
+					.clickOnRemove();;
+			waitAMomentPopUp = removeConfirmationView
+					.clickOnRemoteAndLocalButton();
+			Common.waitTillElementIsNotPresent(
+					waitAMomentPopUp.getWaitAMomentTextElement(), 100);
 		}catch(NoSuchElementException e){
 			fileElement=null;
 		}
 		return fileElement;
 	}
 
-	public static FileListView uploadFile(String elementName,  FileListView fileListView) throws InterruptedException{
+	public static FileListView uploadFile(String elementName,
+			FileListView fileListView) throws InterruptedException{
 		fileListView.clickOnUploadButton();
-		UploadFilesView uploadFilesView = fileListView.clickOnFilesElementUploadFile();
+		UploadFilesView uploadFilesView = fileListView
+				.clickOnFilesElementUploadFile();
 		uploadFilesView.clickOnFileName(elementName);
-		FileListView fileListViewAfterUploadFile = uploadFilesView.clickOnUploadButton();
+		FileListView fileListViewAfterUploadFile = uploadFilesView
+				.clickOnUploadButton();
 		//TO DO. detect when the file is successfully uploaded
 		Thread.sleep(15000);
 		return fileListViewAfterUploadFile; 

+ 19 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/groups/FailingTestCategory.java

@@ -1,3 +1,22 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
 package com.owncloud.android.test.ui.groups;
 
 public interface FailingTestCategory extends IgnoreTestCategory {}

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/groups/IgnoreTestCategory.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.groups;
 
 public interface IgnoreTestCategory {}

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/groups/NoIgnoreTestCategory.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.groups;
 
 public interface NoIgnoreTestCategory {

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/groups/OtherTestCategory.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.groups;
 
 public interface OtherTestCategory extends IgnoreTestCategory {}

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/groups/SmokeTestCategory.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.groups;
 
 public interface SmokeTestCategory {

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/groups/UnfinishedTestCategory.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.groups;
 
 public interface UnfinishedTestCategory extends IgnoreTestCategory{

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/models/CertificatePopUp.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import io.appium.java_client.android.AndroidDriver;

+ 22 - 1
automationTest/src/test/java/com/owncloud/android/test/ui/models/ElementMenuOptions.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import io.appium.java_client.android.AndroidDriver;
@@ -39,7 +59,8 @@ public class ElementMenuOptions {
 	
 	public RemoveConfirmationView clickOnRemove () {
 		removeFileElement.click();
-		RemoveConfirmationView removeConfirmationView = new RemoveConfirmationView(driver);
+		RemoveConfirmationView removeConfirmationView = 
+				new RemoveConfirmationView(driver);
 		return removeConfirmationView;
 	}
 	

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/models/FileDetailsView.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import io.appium.java_client.android.AndroidDriver;

+ 41 - 10
automationTest/src/test/java/com/owncloud/android/test/ui/models/FileListView.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import java.util.List;
@@ -18,7 +38,8 @@ import com.owncloud.android.test.ui.actions.Actions;
 public class FileListView {
 	final AndroidDriver driver;
 	
-	@AndroidFindBy(uiAutomator = "new UiSelector().description(\"More options\")")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".description(\"More options\")")
 	private AndroidElement menuButton;
 	
 	@CacheLookup
@@ -26,14 +47,16 @@ public class FileListView {
 	private AndroidElement filesLayout;
 	
 	@CacheLookup
-	@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/action_bar_title\")")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".resourceId(\"android:id/action_bar_title\")")
 	private AndroidElement titleText;
 	
 	@AndroidFindBy(id = "android:id/progress_circular")
 	private AndroidElement progressCircular;
 
 	@CacheLookup
-	@AndroidFindBy(uiAutomator = "new UiSelector().description(\"New folder\")")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".description(\"New folder\")")
 	private AndroidElement newFolderButton;
 	
 	@CacheLookup
@@ -52,16 +75,20 @@ public class FileListView {
 	private AndroidElement filesElementUploadFile;
 	
 	@CacheLookup
-	@AndroidFindBy(uiAutomator = "new UiSelector().description(\"List Layout\")")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".description(\"List Layout\")")
 	private AndroidElement listLayout;
 	
 	private AndroidElement fileElement;
 	
 	private AndroidElement fileElementLayout;
 	
-	private static String localFileIndicator = "com.owncloud.android:id/localFileIndicator";
-	private static String favoriteFileIndicator = "com.owncloud.android:id/favoriteIcon";
-	private static String sharedElementIndicator = "com.owncloud.android:id/sharedIcon";
+	private static String localFileIndicator = 
+			"com.owncloud.android:id/localFileIndicator";
+	private static String favoriteFileIndicator = 
+			"com.owncloud.android:id/favoriteIcon";
+	private static String sharedElementIndicator = 
+			"com.owncloud.android:id/sharedIcon";
 	
 	
 	public FileListView (AndroidDriver driver) {
@@ -133,9 +160,12 @@ public class FileListView {
 	}
 	
 	public AndroidElement scrollTillFindElement (String elementName) {
-        fileElement = Actions.scrollTillFindElement (elementName,filesLayout,driver);
+        fileElement = Actions
+        		.scrollTillFindElement (elementName,filesLayout,driver);
 		try {
-        	fileElementLayout = (AndroidElement) driver.findElementByAndroidUIAutomator("new UiSelector().description(\"LinearLayout-"+ elementName +"\")");
+        	fileElementLayout = (AndroidElement) driver
+        			.findElementByAndroidUIAutomator("new UiSelector()"
+        				+ ".description(\"LinearLayout-"+ elementName +"\")");
         } catch (NoSuchElementException e) {
         	fileElementLayout = null;
         }
@@ -163,7 +193,8 @@ public class FileListView {
 	}
 	public void pulldownToRefresh () throws InterruptedException {
 		Point listLocation = listLayout.getLocation();
-		driver.swipe(listLocation.getX(),listLocation.getY(), listLocation.getX(),listLocation.getY()+1000, 5000);
+		driver.swipe(listLocation.getX(),listLocation.getY(), 
+				listLocation.getX(),listLocation.getY()+1000, 5000);
 	}
 
 

+ 24 - 2
automationTest/src/test/java/com/owncloud/android/test/ui/models/GmailEmailListView.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import io.appium.java_client.android.AndroidDriver;
@@ -12,9 +32,11 @@ public class GmailEmailListView {
 	
 	final AndroidDriver driver;
 	
-	@AndroidFindBy(uiAutomator = "new UiSelector().description(\"me about UploadFile,  on May 11, conversation read\")")
+	@AndroidFindBy(uiAutomator = "new UiSelector().description(\""
+			+ "me about UploadFile,  on May 11, conversation read\")")
 	private AndroidElement emailAmericanFormatDate;
-	@AndroidFindBy(uiAutomator = "new UiSelector().description(\"me about UploadFile,  on 11 May, conversation read\")")
+	@AndroidFindBy(uiAutomator = "new UiSelector().description(\""
+			+ "me about UploadFile,  on 11 May, conversation read\")")
 	private AndroidElement emailEuropeanFormatDate;
 	
 		

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/models/GmailEmailView.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import io.appium.java_client.android.AndroidDriver;

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/models/GmailSendMailView.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import io.appium.java_client.android.AndroidDriver;

+ 23 - 2
automationTest/src/test/java/com/owncloud/android/test/ui/models/ImageView.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import io.appium.java_client.android.AndroidDriver;
@@ -15,7 +35,8 @@ public class ImageView {
 	final AndroidDriver driver;
 
 	@CacheLookup
-	@AndroidFindBy(uiAutomator = "new UiSelector().description(\"More options\")")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".description(\"More options\")")
 	private AndroidElement optionsButton;
 
 	@AndroidFindBy(name = "Share")
@@ -48,7 +69,7 @@ public class ImageView {
 
 	public void clickOnOwnCloudButton(){
 		if(Common.isElementPresent(ownCloudButton)){
-			Actions.scrollTillFindElement("ownCloud", sharingAppsLayout, driver);
+			Actions.scrollTillFindElement("ownCloud",sharingAppsLayout,driver);
 			ownCloudButton.click();
 		}else if(Common.isElementPresent(shareWithOwnCloudButton)){}
 	}

+ 28 - 4
automationTest/src/test/java/com/owncloud/android/test/ui/models/LoginForm.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import org.openqa.selenium.support.CacheLookup;
@@ -12,7 +32,8 @@ public class LoginForm {
 	final AndroidDriver driver;
 	
 	@CacheLookup
-	@AndroidFindBy(uiAutomator = "new UiSelector().description(\"Server address\")")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".description(\"Server address\")")
 	private AndroidElement hostUrlInput;
 	
 	@CacheLookup
@@ -27,10 +48,12 @@ public class LoginForm {
 	@AndroidFindBy(uiAutomator = "new UiSelector().description(\"Connect\")")
 	private AndroidElement connectButton;
 	
-	@AndroidFindBy(uiAutomator = "new UiSelector().description(\"Testing connection\")")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".description(\"Testing connection\")")
 	private AndroidElement serverStatusText;
 	
-	@AndroidFindBy(uiAutomator = "new UiSelector().description(\"Wrong username or password\")")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".description(\"Wrong username or password\")")
 	private AndroidElement authStatusText;
 	
 	public LoginForm (AndroidDriver driver) {
@@ -51,7 +74,8 @@ public class LoginForm {
 	
 	public void typeUserName (String userName) {
 		userNameInput.clear();
-		//using the \n , it not need to hide the keyboard which sometimes gives problems
+		//using the \n , it not need to hide the keyboard
+		//which sometimes gives problems
 		userNameInput.sendKeys(userName + "\n");
 		//driver.hideKeyboard();
 	}

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/models/MenuList.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import org.openqa.selenium.support.PageFactory;

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/models/MoveView.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import io.appium.java_client.android.AndroidDriver;

+ 24 - 2
automationTest/src/test/java/com/owncloud/android/test/ui/models/NewFolderPopUp.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import org.openqa.selenium.support.PageFactory;
@@ -11,10 +31,12 @@ public class NewFolderPopUp {
 
 	final AndroidDriver driver;
 	
-	@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"android:id/button1\")")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".resourceId(\"android:id/button1\")")
 	private AndroidElement newFolderOkButton;
 	
-	@AndroidFindBy(uiAutomator = "new UiSelector().resourceId(\"com.owncloud.android:id/user_input\")")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".resourceId(\"com.owncloud.android:id/user_input\")")
 	private AndroidElement newFolderNameField;
 	
 	public NewFolderPopUp (AndroidDriver driver) {

+ 32 - 6
automationTest/src/test/java/com/owncloud/android/test/ui/models/PassCodeRequestView.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import org.openqa.selenium.support.PageFactory;
@@ -10,16 +30,20 @@ import io.appium.java_client.pagefactory.AppiumFieldDecorator;
 public class PassCodeRequestView {
 final AndroidDriver driver;
 	
-	@AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.EditText\").index(0)")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".className(\"android.widget.EditText\").index(0)")
 	private AndroidElement codeElement1;
 	
-	@AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.EditText\").index(1)")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".className(\"android.widget.EditText\").index(1)")
 	private AndroidElement codeElement2;
 	
-	@AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.EditText\").index(2)")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".className(\"android.widget.EditText\").index(2)")
 	private AndroidElement codeElement3;
 	
-	@AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.EditText\").index(3)")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".className(\"android.widget.EditText\").index(3)")
 	private AndroidElement codeElement4;
 	
 	public PassCodeRequestView (AndroidDriver driver) {
@@ -27,8 +51,10 @@ final AndroidDriver driver;
 		PageFactory.initElements(new AppiumFieldDecorator(driver), this);
 	}
 	
-	public void enterPasscode(String codeNumber1, String codeNumber2, String codeNumber3, String codeNumber4){
-		codeElement1.sendKeys(codeNumber1 + codeNumber1 + codeNumber1 + codeNumber1);
+	public void enterPasscode(String codeNumber1, String codeNumber2, 
+			String codeNumber3, String codeNumber4){
+		codeElement1
+		   .sendKeys(codeNumber1 + codeNumber1 + codeNumber1 + codeNumber1);
 	}
 
 }

+ 36 - 8
automationTest/src/test/java/com/owncloud/android/test/ui/models/PassCodeView.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import io.appium.java_client.android.AndroidDriver;
@@ -10,16 +30,20 @@ import org.openqa.selenium.support.PageFactory;
 public class PassCodeView {
 	final AndroidDriver driver;
 	
-	@AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.EditText\").index(0)")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".className(\"android.widget.EditText\").index(0)")
 	private AndroidElement codeElement1;
 	
-	@AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.EditText\").index(1)")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".className(\"android.widget.EditText\").index(1)")
 	private AndroidElement codeElement2;
 	
-	@AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.EditText\").index(2)")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".className(\"android.widget.EditText\").index(2)")
 	private AndroidElement codeElement3;
 	
-	@AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.EditText\").index(3)")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".className(\"android.widget.EditText\").index(3)")
 	private AndroidElement codeElement4;
 	
 	@AndroidFindBy(name = "Cancel")
@@ -30,12 +54,16 @@ public class PassCodeView {
 		PageFactory.initElements(new AppiumFieldDecorator(driver), this);
 	}
 	
-	public PassCodeView enterPasscode(String codeNumber1, String codeNumber2, String codeNumber3, String codeNumber4){
-		codeElement1.sendKeys(codeNumber1 + codeNumber1 + codeNumber1 + codeNumber1);
+	public PassCodeView enterPasscode(String codeNumber1, String codeNumber2, 
+			String codeNumber3, String codeNumber4){
+		codeElement1
+		  .sendKeys(codeNumber1 + codeNumber1 + codeNumber1 + codeNumber1);
 		return this;
 	}
-	public SettingsView reenterPasscode(String codeNumber1, String codeNumber2, String codeNumber3, String codeNumber4){
-		codeElement1.sendKeys(codeNumber1 + codeNumber1 + codeNumber1 + codeNumber1);
+	public SettingsView reenterPasscode(String codeNumber1,
+			String codeNumber2, String codeNumber3, String codeNumber4){
+		codeElement1
+		   .sendKeys(codeNumber1 + codeNumber1 + codeNumber1 + codeNumber1);
 		SettingsView settingsView = new SettingsView(driver);
 		return settingsView;
 	}

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/models/RemoveConfirmationView.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import io.appium.java_client.android.AndroidDriver;

+ 22 - 1
automationTest/src/test/java/com/owncloud/android/test/ui/models/SettingsView.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import io.appium.java_client.android.AndroidDriver;
@@ -30,7 +50,8 @@ public class SettingsView {
 	@AndroidFindBy(name = "Add account")
 	private AndroidElement addAccountElement;
 
-	@AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.CheckBox\").index(0)")
+	@AndroidFindBy(uiAutomator = "new UiSelector()"
+			+ ".className(\"android.widget.CheckBox\").index(0)")
 	private AndroidElement passcodeCheckbox;
 
 	public SettingsView (AndroidDriver driver) {

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/models/ShareView.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import io.appium.java_client.android.AndroidDriver;

+ 22 - 1
automationTest/src/test/java/com/owncloud/android/test/ui/models/UploadFilesView.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import io.appium.java_client.android.AndroidDriver;
@@ -36,7 +56,8 @@ public class UploadFilesView{
 	
 	//change to scrollTillFindElement
 	public void scrollTillFindFile (String fileName) {
-		fileElement = Actions.scrollTillFindElement (fileName,filesLayout,driver);
+		fileElement = Actions
+				.scrollTillFindElement(fileName,filesLayout,driver);
 	}
 	
 	public void clickOnFileName (String fileName) {

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/models/UploadView.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import io.appium.java_client.android.AndroidDriver;

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/models/WaitAMomentPopUp.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.models;
 
 import org.openqa.selenium.support.PageFactory;

+ 59 - 16
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/Common.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 import static org.junit.Assert.*;
@@ -34,16 +54,21 @@ public class Common{
 		capabilities.setCapability("deviceName", "test");
 		capabilities.setCapability("app", app.getAbsolutePath());
 		capabilities.setCapability("appPackage", "com.owncloud.android");
-		capabilities.setCapability("appActivity", ".ui.activity.FileDisplayActivity");	
-		capabilities.setCapability("appWaitActivity", ".authentication.AuthenticatorActivity");
-		driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
-		driver.manage().timeouts().implicitlyWait(waitingTime, TimeUnit.SECONDS);
+		capabilities.setCapability("appActivity", 
+				".ui.activity.FileDisplayActivity");	
+		capabilities.setCapability("appWaitActivity", 
+				".authentication.AuthenticatorActivity");
+		driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),
+				capabilities);
+		driver.manage().timeouts().implicitlyWait(waitingTime,
+				TimeUnit.SECONDS);
 		wait = new WebDriverWait(driver, waitingTime, 50);
 		return driver;
 
 	}
 
-	protected boolean waitForTextPresent(String text, AndroidElement element) throws InterruptedException{
+	protected boolean waitForTextPresent(String text, AndroidElement element)
+			throws InterruptedException{
 		for (int second = 0;;second++){	
 			if (second >= waitingTime)
 				return false;
@@ -77,7 +102,8 @@ public class Common{
 	}
 
 	//pollingTime in milliseconds
-	public static void waitTillElementIsNotPresent (AndroidElement element, int pollingTime) throws Exception {
+	public static void waitTillElementIsNotPresent (AndroidElement element,
+			int pollingTime) throws Exception {
 		for (int time = 0;;time += pollingTime){	
 			if (time >= waitingTime * 1000) //convert to milliseconds
 				break;
@@ -91,24 +117,35 @@ public class Common{
 		throw new TimeoutException();
 	}
 
-	protected void takeScreenShotOnFailed (String testName) throws IOException {
-		File file  = ((RemoteWebDriver) driver).getScreenshotAs(OutputType.FILE);
+	protected void takeScreenShotOnFailed (String testName) 
+			throws IOException {
+		File file  = ((RemoteWebDriver) driver)
+				.getScreenshotAs(OutputType.FILE);
 		SimpleDateFormat dt1 = new SimpleDateFormat("yyyy-MM-dd");
 		Date today = Calendar.getInstance().getTime(); 
-		String screenShotName = "ScreenShots/" + dt1.format(today) + "/" + testName + ".png";
+		String screenShotName = "ScreenShots/" + dt1.format(today) + "/"
+		    + testName + ".png";
 		FileUtils.copyFile(file, new File(screenShotName));
 	}
 
 	protected void assertIsInFileListView() throws InterruptedException {
-		assertTrue(waitForTextPresent("ownCloud", (AndroidElement) driver.findElementByAndroidUIAutomator("new UiSelector().resourceId(\"android:id/action_bar_title\")")));
-		assertTrue(isElementPresent((AndroidElement) driver.findElementByAndroidUIAutomator("new UiSelector().description(\"Upload\")")));	
+		assertTrue(waitForTextPresent("ownCloud", (AndroidElement) driver
+				.findElementByAndroidUIAutomator("new UiSelector()"
+						+ ".resourceId(\"android:id/action_bar_title\")")));
+		assertTrue(isElementPresent((AndroidElement) driver
+				.findElementByAndroidUIAutomator("new UiSelector()"
+						+ ".description(\"Upload\")")));	
 	}
 
 	protected void assertIsNotInFileListView() throws InterruptedException {
 		AndroidElement fileElement;
-		assertTrue(waitForTextPresent("ownCloud", (AndroidElement) driver.findElementByAndroidUIAutomator("new UiSelector().resourceId(\"android:id/action_bar_title\")")));
+		assertTrue(waitForTextPresent("ownCloud", (AndroidElement) driver
+				.findElementByAndroidUIAutomator("new UiSelector()"
+						+ ".resourceId(\"android:id/action_bar_title\")")));
 		try {
-			fileElement = (AndroidElement) driver.findElementByAndroidUIAutomator("new UiSelector().description(\"Upload\")");
+			fileElement = (AndroidElement) driver
+					.findElementByAndroidUIAutomator("new UiSelector()"
+							+ ".description(\"Upload\")");
 		} catch (NoSuchElementException e) {
 			fileElement = null;
 		}
@@ -116,13 +153,19 @@ public class Common{
 	}
 	
 	protected void assertIsPasscodeRequestView() throws InterruptedException {
-		assertTrue(waitForTextPresent("ownCloud", (AndroidElement) driver.findElementByAndroidUIAutomator("new UiSelector().resourceId(\"android:id/action_bar_title\")")));
-		assertTrue(((AndroidElement) driver.findElementByAndroidUIAutomator("new UiSelector().text(\"Please, insert your pass code\")")).isDisplayed());
+		assertTrue(waitForTextPresent("ownCloud", (AndroidElement) driver
+				.findElementByAndroidUIAutomator("new UiSelector()"
+						+ ".resourceId(\"android:id/action_bar_title\")")));
+		assertTrue(((AndroidElement) driver.findElementByAndroidUIAutomator(
+				"new UiSelector().text(\"Please, insert your pass code\")"))
+				.isDisplayed());
 
 	}
 
 	protected void assertIsInSettingsView() throws InterruptedException {
-		assertTrue(waitForTextPresent("Settings", (AndroidElement) driver.findElementByAndroidUIAutomator("new UiSelector().resourceId(\"android:id/action_bar_title\")")));
+		assertTrue(waitForTextPresent("Settings", (AndroidElement) driver
+				.findElementByAndroidUIAutomator("new UiSelector()"
+						+ ".resourceId(\"android:id/action_bar_title\")")));
 	}
 
 }

+ 28 - 4
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/CreateFolderTestSuite.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 import static org.junit.Assert.*;
@@ -41,17 +61,21 @@ public class CreateFolderTestSuite{
 	public void testCreateNewFolder () throws Exception {
 		String NEW_FOLDER_NAME = "testCreateFolder";
 
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		FileListView fileListView = Actions.login(Config.URL, 
+				Config.user,Config.password, Config.isTrusted, driver);
 		common.assertIsInFileListView();
 
 		//check if the folder already exists and if true, delete them
 		Actions.deleteElement(NEW_FOLDER_NAME, fileListView, driver);
 
-		WaitAMomentPopUp waitAMomentPopUp = Actions.createFolder(NEW_FOLDER_NAME, fileListView);
-		Common.waitTillElementIsNotPresent(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
+		WaitAMomentPopUp waitAMomentPopUp = Actions
+				.createFolder(NEW_FOLDER_NAME, fileListView);
+		Common.waitTillElementIsNotPresent(waitAMomentPopUp
+				.getWaitAMomentTextElement(), 100);
 		fileListView.scrollTillFindElement(FOLDER_NAME);
 		assertNotNull(fileListView.getFileElement());
-		assertTrue(folderHasBeenCreated=fileListView.getFileElement().isDisplayed());	
+		assertTrue(
+			folderHasBeenCreated=fileListView.getFileElement().isDisplayed());	
 		CurrentCreatedFolder = FOLDER_NAME;
 		assertEquals(FOLDER_NAME , fileListView.getFileElement().getText());
 	}

+ 29 - 4
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/DeleteFileTestSuite.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 import static org.junit.Assert.*;
@@ -38,15 +58,20 @@ public class DeleteFileTestSuite{
 	@Test
 	@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
 	public void testDeleteFile () throws Exception {		
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		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);
+		FileListView fileListViewAfterUploadFile = Actions
+				.uploadFile(FILE_NAME, fileListView);
 		
 		fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
-		Common.waitTillElementIsNotPresent(fileListViewAfterUploadFile.getProgressCircular(), 1000);
-		common.wait.until(ExpectedConditions.visibilityOf(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getLocalFileIndicator()))));
+		Common.waitTillElementIsNotPresent(
+				fileListViewAfterUploadFile.getProgressCircular(), 1000);
+		common.wait.until(ExpectedConditions.visibilityOf(
+				fileListViewAfterUploadFile.getFileElementLayout()
+				.findElement(By.id(FileListView.getLocalFileIndicator()))));
 		
 		Actions.deleteElement(FILE_NAME,fileListViewAfterUploadFile, driver);
 		assertFalse(fileListViewAfterUploadFile.getFileElement().isDisplayed());

+ 30 - 5
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/DeleteFolderTestSuite.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 import static org.junit.Assert.*;
@@ -38,19 +58,24 @@ public class DeleteFolderTestSuite{
 	@Test
 	@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
 	public void testDeleteFolder () throws Exception {
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		FileListView fileListView = Actions.login(Config.URL, Config.user,
+				Config.password, Config.isTrusted, driver);
 		common.assertIsInFileListView();
 		
 		//TODO. if the folder already exists, do no created
 		//create the folder
-		WaitAMomentPopUp waitAMomentPopUp = Actions.createFolder(FOLDER_NAME, fileListView);
-		Common.waitTillElementIsNotPresent(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
+		WaitAMomentPopUp waitAMomentPopUp = Actions
+				.createFolder(FOLDER_NAME, fileListView);
+		Common.waitTillElementIsNotPresent(
+				waitAMomentPopUp.getWaitAMomentTextElement(), 100);
 		fileListView.scrollTillFindElement(FOLDER_NAME);
-		assertTrue(folderHasBeenCreated = fileListView.getFileElement().isDisplayed());
+		assertTrue(
+			folderHasBeenCreated = fileListView.getFileElement().isDisplayed());
 
 		//delete the folder
 		Actions.deleteElement(FOLDER_NAME, fileListView, driver);
-		assertFalse(folderHasBeenCreated =fileListView.getFileElement().isDisplayed());
+		assertFalse(
+			folderHasBeenCreated =fileListView.getFileElement().isDisplayed());
 	}
 
 	@After

+ 41 - 10
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/LoginTestSuite.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 import static org.junit.Assert.*;
@@ -38,7 +58,8 @@ public class LoginTestSuite{
 	public void test1LoginPortrait () throws Exception {
 		driver.rotate(ScreenOrientation.PORTRAIT);
 		
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		FileListView fileListView = Actions.login(Config.URL, Config.user,
+				Config.password, Config.isTrusted, driver);
 		common.assertIsInFileListView();
 	}
 	
@@ -46,7 +67,8 @@ public class LoginTestSuite{
 	@Category({NoIgnoreTestCategory.class})
 	public void test2LoginLandscape () throws Exception {
 		driver.rotate(ScreenOrientation.LANDSCAPE);
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		FileListView fileListView = Actions.login(Config.URL, Config.user,
+				Config.password, Config.isTrusted, driver);
 		common.assertIsInFileListView();
 	}
 	
@@ -55,7 +77,8 @@ public class LoginTestSuite{
 	@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
 	public void test3MultiAccountRotate () throws Exception {
 		driver.rotate(ScreenOrientation.LANDSCAPE);
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		FileListView fileListView = Actions.login(Config.URL, Config.user,
+				Config.password, Config.isTrusted, driver);
 		common.assertIsInFileListView();
 		
 		driver.rotate(ScreenOrientation.PORTRAIT);
@@ -63,7 +86,8 @@ public class LoginTestSuite{
 		SettingsView settingsView = menu.clickOnSettingsButton();
 		
 		settingsView.tapOnAddAccount(1, 1000);
-		fileListView = Actions.login(Config.URL2, Config.user2,Config.password2, Config.isTrusted2, driver);
+		fileListView = Actions.login(Config.URL2, Config.user2,
+				Config.password2, Config.isTrusted2, driver);
 		common.assertIsInSettingsView();
 	}
 	
@@ -71,7 +95,8 @@ public class LoginTestSuite{
 	@Category({NoIgnoreTestCategory.class})
 	public void test4ExistingAccountRotate () throws Exception {
 		driver.rotate(ScreenOrientation.PORTRAIT);
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		FileListView fileListView = Actions.login(Config.URL, Config.user,
+				Config.password, Config.isTrusted, driver);
 		common.assertIsInFileListView();
 		
 		driver.rotate(ScreenOrientation.LANDSCAPE);
@@ -80,23 +105,29 @@ public class LoginTestSuite{
 		settingsView.tapOnAddAccount(1, 1000);
 		
 		LoginForm loginForm = new LoginForm(driver);
-		fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);	
-		assertTrue(common.waitForTextPresent("An account for the same user and server already exists in the device", loginForm.getAuthStatusText()));
+		fileListView = Actions.login(Config.URL, Config.user,Config.password, 
+				Config.isTrusted, driver);	
+		assertTrue(common.waitForTextPresent("An account for the same user and"
+				+ " server already exists in the device", 
+				loginForm.getAuthStatusText()));
 	}
 	
 	@Test
 	@Category({NoIgnoreTestCategory.class})
 	public void test5ChangePasswordWrong () throws Exception {
 		driver.rotate(ScreenOrientation.PORTRAIT);
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		FileListView fileListView = Actions.login(Config.URL, Config.user,
+				Config.password, Config.isTrusted, driver);
 		common.assertIsInFileListView();
 		MenuList menu = fileListView.clickOnMenuButton();
 		SettingsView settingsView = menu.clickOnSettingsButton();
 		settingsView.tapOnAccountElement(1, 1000);
-		LoginForm changePasswordForm = settingsView.clickOnChangePasswordElement();
+		LoginForm changePasswordForm = settingsView
+				.clickOnChangePasswordElement();
 		changePasswordForm.typePassword("WrongPassword");
 		changePasswordForm.clickOnConnectButton();
-		assertTrue(common.waitForTextPresent("Wrong username or password", changePasswordForm.getAuthStatusText()));
+		assertTrue(common.waitForTextPresent("Wrong username or password", 
+				changePasswordForm.getAuthStatusText()));
 	}
 	
 

+ 24 - 2
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/LogoutTestSuite.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 
@@ -35,13 +55,15 @@ public class LogoutTestSuite{
 	@Test
 	@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
 	public void testLogout () throws Exception {
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		FileListView fileListView = Actions.login(Config.URL, Config.user,
+				Config.password, Config.isTrusted, driver);
 		common.assertIsInFileListView();
 		MenuList menulist = fileListView.clickOnMenuButton();
 		SettingsView settingsView = menulist.clickOnSettingsButton();
 		settingsView.tapOnAccountElement(1, 1000);
 		LoginForm loginForm = settingsView.clickOnDeleteAccountElement();
-		assertEquals("Server address https://…", loginForm.gethostUrlInput().getText());
+		assertEquals("Server address https://…",
+				loginForm.gethostUrlInput().getText());
 		assertEquals("Username", loginForm.getUserNameInput().getText());
 		assertEquals("", loginForm.getPasswordInput().getText());
 	}

+ 36 - 8
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/MoveFileTestSuite.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 import static org.junit.Assert.*;
@@ -41,37 +61,45 @@ public class MoveFileTestSuite{
 	public void testMoveFile () throws Exception {
 		WaitAMomentPopUp waitAMomentPopUp;
 
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		FileListView fileListView = Actions.login(Config.URL, Config.user,
+				Config.password, Config.isTrusted, driver);
 		common.assertIsInFileListView();
 
-		//Common.waitTillElementIsNotPresent(fileListView.getProgressCircular(), 1000);
+		//Common.waitTillElementIsNotPresent(
+		     //fileListView.getProgressCircular(), 1000);
 
 		//check if the folder already exists and if true, delete them
 		Actions.deleteElement(FOLDER_WHERE_MOVE, fileListView, driver);
 		Actions.deleteElement(FILE_NAME, fileListView, driver);
 
 		//Create the folder where the other is gone to be moved
-		waitAMomentPopUp = Actions.createFolder(FOLDER_WHERE_MOVE, fileListView);
-		Common.waitTillElementIsNotPresent(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
+		waitAMomentPopUp = Actions
+				.createFolder(FOLDER_WHERE_MOVE, fileListView);
+		Common.waitTillElementIsNotPresent(
+				waitAMomentPopUp.getWaitAMomentTextElement(), 100);
 		fileListView.scrollTillFindElement(FOLDER_WHERE_MOVE);
 		assertTrue(fileListView.getFileElement().isDisplayed());
 
-		FileListView fileListViewAfterUploadFile = Actions.uploadFile(FILE_NAME, fileListView);
+		FileListView fileListViewAfterUploadFile = Actions
+				.uploadFile(FILE_NAME, fileListView);
 		fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
 		assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed());
 
 		//select to move the file
-		ElementMenuOptions menuOptions = fileListView.longPressOnElement(FILE_NAME);
+		ElementMenuOptions menuOptions = fileListView
+				.longPressOnElement(FILE_NAME);
 		MoveView moveView = menuOptions.clickOnMove();
 
 		//to move to a folder
 		moveView.scrollTillFindElement(FOLDER_WHERE_MOVE).tap(1,1);
 		waitAMomentPopUp = moveView.clickOnChoose();
-		Common.waitTillElementIsNotPresent(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
+		Common.waitTillElementIsNotPresent(
+				waitAMomentPopUp.getWaitAMomentTextElement(), 100);
 
 		//check that the folder moved is inside the other
 		fileListView.scrollTillFindElement(FOLDER_WHERE_MOVE).tap(1,1);
-		Common.waitTillElementIsNotPresent(fileListView.getProgressCircular(), 1000);
+		Common.waitTillElementIsNotPresent(fileListView.getProgressCircular(),
+				1000);
 		Thread.sleep(1000);
 		fileListView.scrollTillFindElement(FILE_NAME);
 		assertEquals(FILE_NAME , fileListView.getFileElement().getText());

+ 36 - 8
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/MoveFolderTestSuite.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 import static org.junit.Assert.*;
@@ -41,39 +61,47 @@ public class MoveFolderTestSuite{
 	public void testMoveFolder () throws Exception {
 		WaitAMomentPopUp waitAMomentPopUp;
 
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		FileListView fileListView = Actions.login(Config.URL, Config.user,
+				Config.password, Config.isTrusted, driver);
 		common.assertIsInFileListView();
 
-		//Common.waitTillElementIsNotPresent(fileListView.getProgressCircular(), 1000);
+		//Common.waitTillElementIsNotPresent(
+		     //fileListView.getProgressCircular(), 1000);
 
 		//check if the folder already exists and if true, delete them
 		Actions.deleteElement(FOLDER_WHERE_MOVE, fileListView, driver);
 		Actions.deleteElement(FOLDER_TO_MOVE, fileListView, driver);
 
 		//Create the folder where the other is gone to be moved
-		waitAMomentPopUp = Actions.createFolder(FOLDER_WHERE_MOVE, fileListView);
-		Common.waitTillElementIsNotPresent(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
+		waitAMomentPopUp = Actions
+				.createFolder(FOLDER_WHERE_MOVE, fileListView);
+		Common.waitTillElementIsNotPresent(
+				waitAMomentPopUp.getWaitAMomentTextElement(), 100);
 		fileListView.scrollTillFindElement(FOLDER_WHERE_MOVE);
 		assertTrue(fileListView.getFileElement().isDisplayed());
 
 		//Create the folder which is going to be moved
 		waitAMomentPopUp = Actions.createFolder(FOLDER_TO_MOVE, fileListView);
-		Common.waitTillElementIsNotPresent(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
+		Common.waitTillElementIsNotPresent(
+				waitAMomentPopUp.getWaitAMomentTextElement(), 100);
 		fileListView.scrollTillFindElement(FOLDER_TO_MOVE);
 		assertTrue(fileListView.getFileElement().isDisplayed());
 
 		//select to move the folder
-		ElementMenuOptions menuOptions = fileListView.longPressOnElement(FOLDER_TO_MOVE);
+		ElementMenuOptions menuOptions = fileListView
+				.longPressOnElement(FOLDER_TO_MOVE);
 		MoveView moveView = menuOptions.clickOnMove();
 
 		//to move to a folder
 		moveView.scrollTillFindElement(FOLDER_WHERE_MOVE).tap(1,1);
 		waitAMomentPopUp = moveView.clickOnChoose();
-		Common.waitTillElementIsNotPresent(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
+		Common.waitTillElementIsNotPresent(waitAMomentPopUp
+				.getWaitAMomentTextElement(), 100);
 		
 		//check that the folder moved is inside the other
 		fileListView.scrollTillFindElement(FOLDER_WHERE_MOVE).tap(1,1);
-		Common.waitTillElementIsNotPresent(fileListView.getProgressCircular(), 1000);
+		Common.waitTillElementIsNotPresent(fileListView.getProgressCircular(),
+				1000);
 		Thread.sleep(1000);
 		fileListView.scrollTillFindElement(FOLDER_TO_MOVE);
 		assertEquals(FOLDER_TO_MOVE , fileListView.getFileElement().getText());

+ 35 - 7
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/PasscodeTestSuite.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 import io.appium.java_client.android.AndroidDriver;
@@ -37,25 +57,33 @@ public class PasscodeTestSuite {
 	@Category({NoIgnoreTestCategory.class})
 	public void testPincodeEnable () throws Exception {
 		driver.rotate(ScreenOrientation.PORTRAIT);
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		FileListView fileListView = Actions.login(Config.URL, Config.user,
+				Config.password, Config.isTrusted, driver);
 		common.assertIsInFileListView();
 		
 		MenuList menu = fileListView.clickOnMenuButton();
 		SettingsView settingsView = menu.clickOnSettingsButton();
 		
 		PassCodeView passCodeview = settingsView.EnablePassCode();
-		PassCodeView passCodeview2 = passCodeview.enterPasscode(Config.passcode1, Config.passcode2, Config.passcode3, Config.passcode4);
-		passCodeview2.reenterPasscode(Config.passcode1, Config.passcode2, Config.passcode3, Config.passcode4);
+		PassCodeView passCodeview2 = passCodeview.enterPasscode(
+				Config.passcode1, Config.passcode2, Config.passcode3, 
+				Config.passcode4);
+		passCodeview2.reenterPasscode(Config.passcode1, Config.passcode2, 
+				Config.passcode3, Config.passcode4);
 		
 		driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME);
 		//TO DO. Open the app instead of start an activity
-		driver.startActivity("com.owncloud.android", ".ui.activity.FileDisplayActivity");
-		//here we check that we are not in the fileDisplayActivity, because pincode is asked
+		driver.startActivity("com.owncloud.android", 
+				".ui.activity.FileDisplayActivity");
+		//here we check that we are not in the fileDisplayActivity,
+		//because pincode is asked
 		common.assertIsNotInFileListView();
 		common.assertIsPasscodeRequestView();
 		
-		PassCodeRequestView passCodeReequestView = new PassCodeRequestView(driver);
-		passCodeReequestView.enterPasscode(Config.passcode1, Config.passcode2, Config.passcode3, Config.passcode4);
+		PassCodeRequestView passCodeReequestView = new 
+				PassCodeRequestView(driver);
+		passCodeReequestView.enterPasscode(Config.passcode1, Config.passcode2,
+				Config.passcode3, Config.passcode4);
 		common.assertIsInFileListView();
 	}
 	

+ 24 - 2
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RefreshFolderTestSuite.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 import static org.junit.Assert.*;
@@ -34,9 +54,11 @@ public class RefreshFolderTestSuite{
 	@Test
 	@Category({UnfinishedTestCategory.class})
 	public void testPulldownToRefreshFolder () throws Exception {
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		FileListView fileListView = Actions.login(Config.URL, Config.user,
+				Config.password, Config.isTrusted, driver);
 		common.assertIsInFileListView();
-		//TODO. Remove the sleep and check why is not working the assert when using waitTillElementIsNotPresent
+		//TODO. Remove the sleep and check why is not working the assert 
+		//when using waitTillElementIsNotPresent
 		Thread.sleep(5000);
 		//waitTillElementIsNotPresent(fileListView.getProgressCircular(), 1000);
 		fileListView.pulldownToRefresh();

+ 39 - 9
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RenameFileTestSuite.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 import static org.junit.Assert.*;
@@ -44,29 +64,39 @@ public class RenameFileTestSuite{
 	@Test
 	@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
 	public void testRenameFile () throws Exception {
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		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(OLD_FILE_NAME, fileListView);
+		FileListView fileListViewAfterUploadFile = Actions
+				.uploadFile(OLD_FILE_NAME, fileListView);
 
 		//check if the file with the new name already exists, if true delete it
 		Actions.deleteElement(FILE_NAME, fileListView, driver);
 
 		fileListViewAfterUploadFile.scrollTillFindElement(OLD_FILE_NAME);
-		assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile.getFileElement().isDisplayed());
+		assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile
+				.getFileElement().isDisplayed());
 		CurrentCreatedFile = OLD_FILE_NAME;
-		Common.waitTillElementIsNotPresent(fileListViewAfterUploadFile.getProgressCircular(), 1000);
-		common.wait.until(ExpectedConditions.visibilityOf(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getLocalFileIndicator()))));
-		ElementMenuOptions menuOptions = fileListViewAfterUploadFile.longPressOnElement(OLD_FILE_NAME);
+		Common.waitTillElementIsNotPresent(fileListViewAfterUploadFile
+				.getProgressCircular(), 1000);
+		common.wait.until(ExpectedConditions.visibilityOf(
+				fileListViewAfterUploadFile.getFileElementLayout()
+				.findElement(By.id(FileListView.getLocalFileIndicator()))));
+		ElementMenuOptions menuOptions = fileListViewAfterUploadFile
+				.longPressOnElement(OLD_FILE_NAME);
 		NewFolderPopUp newFolderPopUp = menuOptions.clickOnRename();
 		newFolderPopUp.typeNewFolderName(FILE_NAME);
-		WaitAMomentPopUp waitAMomentPopUp = newFolderPopUp.clickOnNewFolderOkButton();
-		Common.waitTillElementIsNotPresent(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
+		WaitAMomentPopUp waitAMomentPopUp = newFolderPopUp
+				.clickOnNewFolderOkButton();
+		Common.waitTillElementIsNotPresent(waitAMomentPopUp
+				.getWaitAMomentTextElement(), 100);
 		fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
 		assertNotNull(fileListViewAfterUploadFile.getFileElement());
 		assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed());	
-		assertEquals(FILE_NAME , fileListViewAfterUploadFile.getFileElement().getText());
+		assertEquals(FILE_NAME , fileListViewAfterUploadFile.getFileElement()
+				.getText());
 		CurrentCreatedFile = FILE_NAME;
 	}
 

+ 36 - 8
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RenameFolderTestSuite.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 import static org.junit.Assert.*;
@@ -43,30 +63,38 @@ public class RenameFolderTestSuite{
 	@Test
 	@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
 	public void testRenameFolder () throws Exception {
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		FileListView fileListView = Actions.login(Config.URL, Config.user,
+				Config.password, Config.isTrusted, driver);
 		common.assertIsInFileListView();
 
 		//TODO. if the folder already exists, do no created
 		//create the folder to rename
-		WaitAMomentPopUp waitAMomentPopUp = Actions.createFolder(OLD_FOLDER_NAME, fileListView);
-		Common.waitTillElementIsNotPresent(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
+		WaitAMomentPopUp waitAMomentPopUp = Actions
+				.createFolder(OLD_FOLDER_NAME, fileListView);
+		Common.waitTillElementIsNotPresent(
+				waitAMomentPopUp.getWaitAMomentTextElement(), 100);
 		fileListView.scrollTillFindElement(OLD_FOLDER_NAME);
 
-		assertTrue(folderHasBeenCreated = fileListView.getFileElement().isDisplayed());
+		assertTrue(
+			folderHasBeenCreated = fileListView.getFileElement().isDisplayed());
 
-		//check if the folder with the new name already exists and if true, delete them
+		//check if the folder with the new name already exists 
+		//and if true, delete them
 		Actions.deleteElement(FOLDER_NAME, fileListView, driver);
 
 		CurrentCreatedFolder = OLD_FOLDER_NAME;
-		ElementMenuOptions menuOptions = fileListView.longPressOnElement(OLD_FOLDER_NAME);
+		ElementMenuOptions menuOptions = fileListView
+				.longPressOnElement(OLD_FOLDER_NAME);
 		NewFolderPopUp FolderPopUp = menuOptions.clickOnRename();
 		FolderPopUp.typeNewFolderName(FOLDER_NAME);
 		FolderPopUp.clickOnNewFolderOkButton();
 		CurrentCreatedFolder = FOLDER_NAME;
-		Common.waitTillElementIsNotPresent(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
+		Common.waitTillElementIsNotPresent(waitAMomentPopUp
+				.getWaitAMomentTextElement(), 100);
 		fileListView.scrollTillFindElement(FOLDER_NAME);
 		assertNotNull(fileListView.getFileElement());
-		assertTrue(folderHasBeenCreated = fileListView.getFileElement().isDisplayed());	
+		assertTrue(
+			folderHasBeenCreated = fileListView.getFileElement().isDisplayed());	
 		assertEquals(FOLDER_NAME , fileListView.getFileElement().getText());
 	}
 

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunFailingTests.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunNoIgnoreTests.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 import org.junit.experimental.categories.Categories.ExcludeCategory;

+ 20 - 0
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunSmokeTests.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 import org.junit.experimental.categories.Categories.ExcludeCategory;

+ 38 - 8
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/ShareLinkFileTestSuite.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 import static org.junit.Assert.assertTrue;
@@ -38,24 +58,34 @@ public class ShareLinkFileTestSuite{
 	@Test
 	@Category({NoIgnoreTestCategory.class, SmokeTestCategory.class})
 	public void testShareLinkFile () throws Exception {	
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		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);
+		FileListView fileListViewAfterUploadFile = Actions
+				.uploadFile(FILE_NAME, fileListView);
 				
 		fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
-		assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile.getFileElement().isDisplayed());
+		assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile
+				.getFileElement().isDisplayed());
 		
-		ElementMenuOptions elementMenuOption = fileListViewAfterUploadFile.longPressOnElement(FILE_NAME);
+		ElementMenuOptions elementMenuOption = fileListViewAfterUploadFile
+				.longPressOnElement(FILE_NAME);
 		ShareView shareView = elementMenuOption.clickOnShareLinkElement();
-		Actions.scrollTillFindElement("Gmail", shareView.getListViewLayout(), driver).click();
+		Actions.scrollTillFindElement("Gmail", shareView.getListViewLayout(), 
+				driver).click();
 		GmailSendMailView gmailSendMailView = new GmailSendMailView(driver);
 		gmailSendMailView.typeToEmailAdress(Config.gmailAccount);
 		gmailSendMailView.clickOnSendButton();
-		Common.waitTillElementIsNotPresent(fileListViewAfterUploadFile.getProgressCircular(), 1000);
-		common.wait.until(ExpectedConditions.visibilityOf(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getSharedElementIndicator()))));
-		assertTrue(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getSharedElementIndicator())).isDisplayed());
+		Common.waitTillElementIsNotPresent(fileListViewAfterUploadFile
+				.getProgressCircular(), 1000);
+		common.wait.until(ExpectedConditions.visibilityOf(
+				fileListViewAfterUploadFile.getFileElementLayout()
+				.findElement(By.id(FileListView.getSharedElementIndicator()))));
+		assertTrue(fileListViewAfterUploadFile.getFileElementLayout()
+				.findElement(By.id(FileListView.getSharedElementIndicator()))
+				.isDisplayed());
 
 	}
 

+ 60 - 18
automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/UploadTestSuite.java

@@ -1,3 +1,23 @@
+/**
+ *   ownCloud Android client application
+ *
+ *   @author purigarcia
+ *   Copyright (C) 2015 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
 package com.owncloud.android.test.ui.testSuites;
 
 
@@ -55,29 +75,39 @@ public class UploadTestSuite{
 	@Category(NoIgnoreTestCategory.class)
 	public void testUploadFile () throws Exception {
 
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		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(FILE_NAME, fileListView, driver);
 
-		FileListView fileListViewAfterUploadFile = Actions.uploadFile(FILE_NAME, fileListView);
+		FileListView fileListViewAfterUploadFile = Actions
+				.uploadFile(FILE_NAME, fileListView);
 
 		fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
 		assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed());
-		Common.waitTillElementIsNotPresent(fileListViewAfterUploadFile.getProgressCircular(), 1000);
-		common.wait.until(ExpectedConditions.visibilityOf(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getLocalFileIndicator()))));
-		assertTrue(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getLocalFileIndicator())).isDisplayed());
+		Common.waitTillElementIsNotPresent(
+				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(FILE_NAME);
-		assertTrue(fileHasBeenUploaded = fileListView.getFileElement().isDisplayed());
+		assertTrue(
+			fileHasBeenUploaded = fileListView.getFileElement().isDisplayed());
 	}
 
 	@Test
 	@Category(UnfinishedTestCategory.class)
 	public void testUploadFromGmail () throws Exception {
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
-		driver.startActivity("com.google.android.gm", ".ConversationListActivityGmail");
+		FileListView fileListView = Actions.login(Config.URL, Config.user,
+				Config.password, Config.isTrusted, driver);
+		driver.startActivity("com.google.android.gm",
+				".ConversationListActivityGmail");
 		GmailEmailListView gmailEmailListView = new GmailEmailListView(driver);
 		Thread.sleep(3000);
 		GmailEmailView gmailEmailView = gmailEmailListView.clickOnEmail();
@@ -93,12 +123,16 @@ public class UploadTestSuite{
 		UploadView uploadView = new UploadView(driver);
 		uploadView.clickOUploadButton();
 		driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME);
-		driver.startActivity("com.owncloud.android", ".ui.activity.FileDisplayActivity");
-		common.wait.until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.name(FILE_GMAIL_NAME)));
-		assertEquals(Config.fileToTestSendByEmailName , driver.findElementByName(FILE_GMAIL_NAME).getText());
+		driver.startActivity("com.owncloud.android",
+				".ui.activity.FileDisplayActivity");
+		common.wait.until(ExpectedConditions
+				.visibilityOfAllElementsLocatedBy(By.name(FILE_GMAIL_NAME)));
+		assertEquals(Config.fileToTestSendByEmailName ,
+				driver.findElementByName(FILE_GMAIL_NAME).getText());
 		fileListView = new FileListView(driver);
 		fileListView.scrollTillFindElement(FILE_GMAIL_NAME);
-		assertTrue(fileHasBeenUploadedFromGmail = fileListView.getFileElement().isDisplayed());
+		assertTrue(fileHasBeenUploadedFromGmail = fileListView
+				.getFileElement().isDisplayed());
 		//TODO. correct assert if fileListView is shown in grid mode
 	}
 
@@ -107,22 +141,30 @@ public class UploadTestSuite{
 	@Category({FailingTestCategory.class})
 	public void testKeepFileUpToDate () throws Exception {
 
-		FileListView fileListView = Actions.login(Config.URL, Config.user,Config.password, Config.isTrusted, driver);
+		FileListView fileListView = Actions.login(Config.URL, Config.user,
+				Config.password, Config.isTrusted, driver);
 		common.assertIsInFileListView();
 
-		Common.waitTillElementIsNotPresent(fileListView.getProgressCircular(), 1000);
+		Common.waitTillElementIsNotPresent(fileListView.getProgressCircular(), 
+				1000);
 
-		FileListView fileListViewAfterUploadFile = Actions.uploadFile(FILE_NAME, fileListView);
+		FileListView fileListViewAfterUploadFile = Actions
+				.uploadFile(FILE_NAME, fileListView);
 		fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
 		assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed());
 
-		ElementMenuOptions menuOptions = fileListViewAfterUploadFile.longPressOnElement(FILE_NAME);
+		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());
+		assertTrue(common.isElementPresent(
+				fileListViewAfterUploadFile.getFileElementLayout(), 
+				MobileBy.id(FileListView.getFavoriteFileIndicator())));
+		assertTrue(fileListViewAfterUploadFile.getFileElementLayout()
+				.findElement(By.id(FileListView.getFavoriteFileIndicator()))
+				.isDisplayed());
 	}