+/**
+ * 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;
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();
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;
}
}
//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;
+/**
+ * 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 {}
+/**
+ * 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 {}
+/**
+ * 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 {
+/**
+ * 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 {}
+/**
+ * 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 {
+/**
+ * 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{
+/**
+ * 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;
+/**
+ * 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;
public RemoveConfirmationView clickOnRemove () {
removeFileElement.click();
- RemoveConfirmationView removeConfirmationView = new RemoveConfirmationView(driver);
+ RemoveConfirmationView removeConfirmationView =
+ new RemoveConfirmationView(driver);
return removeConfirmationView;
}
+/**
+ * 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;
+/**
+ * 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;
public class FileListView {
final AndroidDriver driver;
- @AndroidFindBy(uiAutomator = "new UiSelector().description(\"More options\")")
+ @AndroidFindBy(uiAutomator = "new UiSelector()"
+ + ".description(\"More options\")")
private AndroidElement menuButton;
@CacheLookup
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
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) {
}
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;
}
}
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);
}
+/**
+ * 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;
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;
+/**
+ * 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;
+/**
+ * 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;
+/**
+ * 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;
final AndroidDriver driver;
@CacheLookup
- @AndroidFindBy(uiAutomator = "new UiSelector().description(\"More options\")")
+ @AndroidFindBy(uiAutomator = "new UiSelector()"
+ + ".description(\"More options\")")
private AndroidElement optionsButton;
@AndroidFindBy(name = "Share")
public void clickOnOwnCloudButton(){
if(Common.isElementPresent(ownCloudButton)){
- Actions.scrollTillFindElement("ownCloud", sharingAppsLayout, driver);
+ Actions.scrollTillFindElement("ownCloud",sharingAppsLayout,driver);
ownCloudButton.click();
}else if(Common.isElementPresent(shareWithOwnCloudButton)){}
}
+/**
+ * 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;
final AndroidDriver driver;
@CacheLookup
- @AndroidFindBy(uiAutomator = "new UiSelector().description(\"Server address\")")
+ @AndroidFindBy(uiAutomator = "new UiSelector()"
+ + ".description(\"Server address\")")
private AndroidElement hostUrlInput;
@CacheLookup
@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) {
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();
}
+/**
+ * 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;
+/**
+ * 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;
+/**
+ * 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;
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) {
+/**
+ * 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;
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) {
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);
}
}
+/**
+ * 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;
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")
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;
}
+/**
+ * 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;
+/**
+ * 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;
@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) {
+/**
+ * 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;
+/**
+ * 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;
//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) {
+/**
+ * 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;
+/**
+ * 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;
+/**
+ * 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.*;
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;
}
//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;
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;
}
}
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\")")));
}
}
+/**
+ * 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.*;
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());
}
+/**
+ * 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.*;
@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());
+/**
+ * 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.*;
@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
+/**
+ * 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.*;
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();
}
@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();
}
@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);
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();
}
@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);
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()));
}
+/**
+ * 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;
@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());
}
+/**
+ * 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.*;
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());
+/**
+ * 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.*;
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());
+/**
+ * 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;
@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();
}
+/**
+ * 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.*;
@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();
+/**
+ * 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.*;
@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;
}
+/**
+ * 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.*;
@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());
}
+/**
+ * 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;
+/**
+ * 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;
+/**
+ * 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;
+/**
+ * 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;
@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());
}
+/**
+ * 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;
@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();
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
}
@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());
}