From: David A. Velasco Date: Mon, 15 Jun 2015 11:43:17 +0000 (+0200) Subject: Merge branch 'develop' into navigationDrawer_basic X-Git-Tag: oc-android-1.7.2~1^2~23^2~1 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/66f3a45d050c27e41296ddc9083d968cfd8803a4?hp=e81b00207fa4a9848670d0869f119dfd084c6ae8 Merge branch 'develop' into navigationDrawer_basic Conflicts FIXED: res/layout/files.xml --- diff --git a/automationTest/.classpath b/automationTest/.classpath new file mode 100644 index 00000000..c52bcedc --- /dev/null +++ b/automationTest/.classpath @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/automationTest/.gitignore b/automationTest/.gitignore new file mode 100644 index 00000000..487ae52f --- /dev/null +++ b/automationTest/.gitignore @@ -0,0 +1,5 @@ + +target/ +ScreenShots/ +.DS_Store +Users/ \ No newline at end of file diff --git a/automationTest/.project b/automationTest/.project new file mode 100644 index 00000000..b1e58409 --- /dev/null +++ b/automationTest/.project @@ -0,0 +1,23 @@ + + + androidtest + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/automationTest/.settings/org.eclipse.jdt.core.prefs b/automationTest/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..62492222 --- /dev/null +++ b/automationTest/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,12 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/automationTest/.settings/org.eclipse.m2e.core.prefs b/automationTest/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000..f897a7f1 --- /dev/null +++ b/automationTest/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/automationTest/README.md b/automationTest/README.md new file mode 100644 index 00000000..899bb8dc --- /dev/null +++ b/automationTest/README.md @@ -0,0 +1,20 @@ +** Work in progress + +This project contains a set of automatic tests operating in the UI level. + +Tests are to be run with the tool Appium. Check [here][0] to install it and all its dependencies (including Maven). + +You will need to modify the constants in automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/Config.java to assign appropiate values for your test server and accounts. +You will need to include the ownCloud.apk to test in automationTest/src/test/resources/. + +To run the tests from command line, plug a device to your computer or start and emulator. Then type + +mvn clean tests + +To run only one category of the test + +mvn clean -Dtest=RunSmokeTests test + +The project may also be imported in Eclipse, with the appropiate plug-ins, and run from it. + +[0]: http://appium.io/slate/en/master/?java#about-appium \ No newline at end of file diff --git a/automationTest/pom.xml b/automationTest/pom.xml new file mode 100644 index 00000000..548da37e --- /dev/null +++ b/automationTest/pom.xml @@ -0,0 +1,78 @@ + + +4.0.0 + +com.owncloud +androidtest +1.0-SNAPSHOT + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.18.1 + + + **/*Test**.java + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + 1.7 + 1.7 + + + + + + + + junit + junit + 4.11 + + + org.seleniumhq.selenium + selenium-java + 2.45.0 + + + io.selendroid + 0.9.0 + selendroid-standalone + + + io.selendroid + 0.9.0 + selendroid-client + + + io.appium + java-client + 2.2.0 + + + commons-lang + commons-lang + 2.6 + + + org.apache.httpcomponents + httpclient + 4.3.1 + + + com.google.android + android + 4.1.1.4 + provided + + + \ No newline at end of file diff --git a/automationTest/resources/.gitignore b/automationTest/resources/.gitignore new file mode 100644 index 00000000..86d0cb27 --- /dev/null +++ b/automationTest/resources/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/actions/Actions.java b/automationTest/src/test/java/com/owncloud/android/test/ui/actions/Actions.java new file mode 100644 index 00000000..ecec7f56 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/actions/Actions.java @@ -0,0 +1,244 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.actions; + +import java.util.HashMap; + +import org.openqa.selenium.By; +import org.openqa.selenium.NoSuchElementException; +import org.openqa.selenium.ScreenOrientation; +import org.openqa.selenium.remote.RemoteWebElement; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; +import com.owncloud.android.test.ui.models.CertificatePopUp; +import com.owncloud.android.test.ui.models.ElementMenuOptions; +import com.owncloud.android.test.ui.models.GmailSendMailView; +import com.owncloud.android.test.ui.models.ShareView; +import com.owncloud.android.test.ui.models.UploadFilesView; +import com.owncloud.android.test.ui.models.LoginForm; +import com.owncloud.android.test.ui.models.FileListView; +import com.owncloud.android.test.ui.models.MenuList; +import com.owncloud.android.test.ui.models.NewFolderPopUp; +import com.owncloud.android.test.ui.models.RemoveConfirmationView; +import com.owncloud.android.test.ui.models.SettingsView; +import com.owncloud.android.test.ui.models.WaitAMomentPopUp; +import com.owncloud.android.test.ui.testSuites.Common; +import com.owncloud.android.test.ui.testSuites.Config; + +public class Actions { + + 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 + try { + 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(); + }catch (NoSuchElementException e) { + + } + + } + loginForm.typeUserName(user); + loginForm.typePassword(password); + //TODO. Assert related to check the connection? + return loginForm.clickOnConnectButton(); + } + + public static WaitAMomentPopUp createFolder(String folderName, + FileListView fileListView){ + NewFolderPopUp newFolderPopUp = fileListView.clickOnNewFolderButton(); + newFolderPopUp.typeNewFolderName(folderName); + WaitAMomentPopUp waitAMomentPopUp = newFolderPopUp + .clickOnNewFolderOkButton(); + //TODO. assert here + return waitAMomentPopUp; + } + + + public static AndroidElement scrollTillFindElement (String elementName, + AndroidElement element, AndroidDriver driver) { + AndroidElement fileElement; + + if(element.getAttribute("scrollable").equals("true")){ + HashMap scrollObject = new HashMap(); + scrollObject.put("text", elementName); + scrollObject.put("element", ( (RemoteWebElement) element).getId()); + driver.executeScript("mobile: scrollTo", scrollObject); + } + try { + fileElement = (AndroidElement) driver + .findElementByName(elementName); + } catch (NoSuchElementException e) { + fileElement = null; + } + return fileElement; + } + + + public static void deleteAccount (int accountPosition,FileListView fileListView) { + MenuList menulist = fileListView.clickOnMenuButton(); + SettingsView settingView = menulist.clickOnSettingsButton(); + deleteAccount(accountPosition,settingView); + } + + public static void deleteAccount (int accountPosition, SettingsView settingsView) { + settingsView.tapOnAccountElement(accountPosition,1, 1000); + settingsView.clickOnDeleteAccountElement(); + } + + public static void clickOnMainLayout(AndroidDriver driver){ + driver.tap(1, 0, 0, 1); + } + + + 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); + }catch(NoSuchElementException e){ + fileElement=null; + } + return fileElement; + } + + public static AndroidElement shareLinkElementByGmail(String elementName, + FileListView fileListView, AndroidDriver driver, Common common) + throws Exception{ + 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"); + ElementMenuOptions menuOptions = fileListView + .longPressOnElement(elementName); + ShareView shareView = menuOptions.clickOnShareLinkElement(); + Actions.scrollTillFindElement("Gmail", shareView + .getListViewLayout(), driver).click(); + GmailSendMailView gmailSendMailView = new GmailSendMailView(driver); + gmailSendMailView.typeToEmailAdress(Config.gmailAccount); + gmailSendMailView.clickOnSendButton(); + Common.waitTillElementIsNotPresentWithoutTimeout(fileListView + .getProgressCircular(), 1000); + common.wait.until(ExpectedConditions.visibilityOf( + fileListView.getFileElementLayout() + .findElement(By.id(FileListView + .getSharedElementIndicator())))); + + }catch(NoSuchElementException e){ + return null; + } + return (AndroidElement) fileListView.getFileElementLayout() + .findElement(By.id(FileListView.getSharedElementIndicator())); + } + + public static AndroidElement shareLinkElementByCopyLink(String elementName, + FileListView fileListView, AndroidDriver driver, Common common) + throws Exception{ + 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"); + ElementMenuOptions menuOptions = fileListView + .longPressOnElement(elementName); + ShareView shareView = menuOptions.clickOnShareLinkElement(); + Actions.scrollTillFindElement("Copy link", shareView.getListViewLayout(), + driver).click(); + WaitAMomentPopUp waitAMomentPopUp = new WaitAMomentPopUp(driver); + Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp + .getWaitAMomentTextElement(), 100); + common.wait.until(ExpectedConditions.visibilityOf( + fileListView.getFileElementLayout() + .findElement(By.id(FileListView.getSharedElementIndicator())))); + }catch(NoSuchElementException e){ + return null; + } + return (AndroidElement) fileListView.getFileElementLayout() + .findElement(By.id(FileListView.getSharedElementIndicator())); + } + + + public static void unshareLinkElement(String elementName, + FileListView fileListView, AndroidDriver driver, Common common) + throws Exception{ + 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"); + ElementMenuOptions menuOptions = fileListView + .longPressOnElement(elementName); + WaitAMomentPopUp waitAMomentPopUp = menuOptions + .clickOnUnshareLinkElement(); + Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp + .getWaitAMomentTextElement(), 100); + Common.waitTillElementIsNotPresent((AndroidElement) fileListView + .getFileElementLayout() + .findElement(By.id(FileListView.getSharedElementIndicator()) + ),100); + }catch(NoSuchElementException e){ + + } + } + + + public static FileListView uploadFile(String elementName, + FileListView fileListView) throws InterruptedException{ + fileListView.clickOnUploadButton(); + UploadFilesView uploadFilesView = fileListView + .clickOnFilesElementUploadFile(); + uploadFilesView.clickOnFileName(elementName); + FileListView fileListViewAfterUploadFile = uploadFilesView + .clickOnUploadButton(); + //TO DO. detect when the file is successfully uploaded + Thread.sleep(15000); + return fileListViewAfterUploadFile; + } + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/groups/FailingTestCategory.java b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/FailingTestCategory.java new file mode 100644 index 00000000..2a91e7ff --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/FailingTestCategory.java @@ -0,0 +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 . + * + */ +package com.owncloud.android.test.ui.groups; + +public interface FailingTestCategory extends IgnoreTestCategory {} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/groups/FlexibleCategories.java b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/FlexibleCategories.java new file mode 100644 index 00000000..94a019af --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/FlexibleCategories.java @@ -0,0 +1,138 @@ +package com.owncloud.android.test.ui.groups; + +import java.lang.annotation.Annotation; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +import org.junit.Test; +import org.junit.experimental.categories.Categories.CategoryFilter; +import org.junit.experimental.categories.Categories.ExcludeCategory; +import org.junit.experimental.categories.Categories.IncludeCategory; +import org.junit.experimental.categories.Category; +import org.junit.runner.Description; +import org.junit.runner.manipulation.NoTestsRemainException; +import org.junit.runners.Suite; +import org.junit.runners.model.InitializationError; +import org.junit.runners.model.RunnerBuilder; + +/** + * This class is based on org.junit.experimental.categories.Categories from JUnit 4.10. + * + * All anotations and inner classes from the original class Categories are removed, + * since they will be re-used. + * Unfortunately sub-classing Categories did not work. + */ +public class FlexibleCategories extends Suite { + + /** + * Specifies the package which should be scanned for test classes (e.g. @TestScanPackage("my.package")). + * This annotation is required. + */ + @Retention(RetentionPolicy.RUNTIME) + public @interface TestScanPackage { + public String value(); + } + + /** + * Specifies the prefix of matching class names (e.g. @TestClassPrefix("Test")). + * This annotation is optional (default: ""). + */ + @Retention(RetentionPolicy.RUNTIME) + public @interface TestClassPrefix { + public String value(); + } + + /** + * Specifies the suffix of matching class names (e.g. @TestClassSuffix("Test")). + * This annotation is optional (default: "Test"). + */ + @Retention(RetentionPolicy.RUNTIME) + public @interface TestClassSuffix { + public String value(); + } + + /** + * Specifies an annotation for methods which must be present in a matching class (e.g. @TestMethodAnnotationFilter(Test.class)). + * This annotation is optional (default: org.junit.Test.class). + */ + @Retention(RetentionPolicy.RUNTIME) + public @interface TestMethodAnnotation { + public Class value(); + } + + public FlexibleCategories(Class clazz, RunnerBuilder builder) + throws InitializationError { + this(builder, clazz, PatternClasspathClassesFinder.getSuiteClasses( + getTestScanPackage(clazz), getTestClassPrefix(clazz), getTestClassSuffix(clazz), + getTestMethodAnnotation(clazz))); + try { + filter(new CategoryFilter(getIncludedCategory(clazz), + getExcludedCategory(clazz))); + } catch (NoTestsRemainException e) { + // Ignore all classes with no matching tests. + } + assertNoCategorizedDescendentsOfUncategorizeableParents(getDescription()); + } + + public FlexibleCategories(RunnerBuilder builder, Class clazz, + Class[] suiteClasses) throws InitializationError { + super(builder, clazz, suiteClasses); + } + + private static String getTestScanPackage(Class clazz) throws InitializationError { + TestScanPackage annotation = clazz.getAnnotation(TestScanPackage.class); + if (annotation == null) { + throw new InitializationError("No package given to scan for tests!\nUse the annotation @TestScanPackage(\"my.package\") on the test suite " + clazz + "."); + } + return annotation.value(); + } + + private static String getTestClassPrefix(Class clazz) { + TestClassPrefix annotation = clazz.getAnnotation(TestClassPrefix.class); + return annotation == null ? "" : annotation.value(); + } + + private static String getTestClassSuffix(Class clazz) { + TestClassSuffix annotation = clazz.getAnnotation(TestClassSuffix.class); + return annotation == null ? "Test" : annotation.value(); + } + + private static Class getTestMethodAnnotation(Class clazz) { + TestMethodAnnotation annotation = clazz.getAnnotation(TestMethodAnnotation.class); + return annotation == null ? Test.class : annotation.value(); + } + + private Class getIncludedCategory(Class clazz) { + IncludeCategory annotation= clazz.getAnnotation(IncludeCategory.class); + return annotation == null ? null : annotation.value(); + } + + private Class getExcludedCategory(Class clazz) { + ExcludeCategory annotation= clazz.getAnnotation(ExcludeCategory.class); + return annotation == null ? null : annotation.value(); + } + + private void assertNoCategorizedDescendentsOfUncategorizeableParents(Description description) throws InitializationError { + if (!canHaveCategorizedChildren(description)) + assertNoDescendantsHaveCategoryAnnotations(description); + for (Description each : description.getChildren()) + assertNoCategorizedDescendentsOfUncategorizeableParents(each); + } + + private void assertNoDescendantsHaveCategoryAnnotations(Description description) throws InitializationError { + for (Description each : description.getChildren()) { + if (each.getAnnotation(Category.class) != null) + throw new InitializationError("Category annotations on Parameterized classes are not supported on individual methods."); + assertNoDescendantsHaveCategoryAnnotations(each); + } + } + + // If children have names like [0], our current magical category code can't determine their + // parentage. + private static boolean canHaveCategorizedChildren(Description description) { + for (Description each : description.getChildren()) + if (each.getTestClass() == null) + return false; + return true; + } +} \ No newline at end of file diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/groups/IgnoreTestCategory.java b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/IgnoreTestCategory.java new file mode 100644 index 00000000..2586edb7 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/IgnoreTestCategory.java @@ -0,0 +1,24 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.groups; + +public interface IgnoreTestCategory {} + diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/groups/InProgressCategory.java b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/InProgressCategory.java new file mode 100644 index 00000000..850ff451 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/InProgressCategory.java @@ -0,0 +1,5 @@ +package com.owncloud.android.test.ui.groups; + +public interface InProgressCategory extends IgnoreTestCategory{ + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/groups/NoIgnoreTestCategory.java b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/NoIgnoreTestCategory.java new file mode 100644 index 00000000..321fb088 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/NoIgnoreTestCategory.java @@ -0,0 +1,25 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.groups; + +public interface NoIgnoreTestCategory { + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/groups/OtherTestCategory.java b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/OtherTestCategory.java new file mode 100644 index 00000000..b14c36e4 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/OtherTestCategory.java @@ -0,0 +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 . + * + */ + +package com.owncloud.android.test.ui.groups; + +public interface OtherTestCategory extends IgnoreTestCategory {} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/groups/PatternClasspathClassesFinder.java b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/PatternClasspathClassesFinder.java new file mode 100644 index 00000000..b5988830 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/PatternClasspathClassesFinder.java @@ -0,0 +1,141 @@ +package com.owncloud.android.test.ui.groups; + +import java.io.File; +import java.io.IOException; +import java.lang.annotation.Annotation; +import java.lang.reflect.Method; +import java.net.URL; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; + +/** + * + * Modified version of ClasspathClassesFinder from: + * http://linsolas.free.fr/wordpress/index.php/2011/02/how-to-categorize-junit-tests-with-maven/ + * + * The difference is, that it does not search for annotated classes but for classes with a certain + * class name prefix and suffix. + */ +public final class PatternClasspathClassesFinder { + + /** + * Get the list of classes of a given package name, and that are annotated + * by a given annotation. + * + * @param packageName + * The package name of the classes. + * @param classPrefix + * The prefix of the class name. + * @param classSuffix + * The suffix of the class name. + * @param methodAnnotation + * Only return classes containing methods annotated with methodAnnotation. + * @return The List of classes that matches the requirements. + */ + public static Class[] getSuiteClasses(String packageName, + String classPrefix, String classSuffix, + Class methodAnnotation) { + try { + return getClasses(packageName, classPrefix, classSuffix, methodAnnotation); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + /** + * Get the list of classes of a given package name, and that are annotated + * by a given annotation. + * + * @param packageName + * The package name of the classes. + * @param classPrefix + * The prefix of the class name. + * @param classSuffix + * The suffix of the class name. + * @param methodAnnotation + * Only return classes containing methods annotated with methodAnnotation. + * @return The List of classes that matches the requirements. + * @throws ClassNotFoundException + * If something goes wrong... + * @throws IOException + * If something goes wrong... + */ + private static Class[] getClasses(String packageName, + String classPrefix, String classSuffix, + Class methodAnnotation) + throws ClassNotFoundException, IOException { + ClassLoader classLoader = Thread.currentThread() + .getContextClassLoader(); + String path = packageName.replace('.', '/'); + // Get classpath + Enumeration resources = classLoader.getResources(path); + List dirs = new ArrayList(); + while (resources.hasMoreElements()) { + URL resource = resources.nextElement(); + dirs.add(new File(resource.getFile())); + } + // For each classpath, get the classes. + ArrayList> classes = new ArrayList>(); + for (File directory : dirs) { + classes.addAll(findClasses(directory, packageName, classPrefix, classSuffix, methodAnnotation)); + } + return classes.toArray(new Class[classes.size()]); + } + + /** + * Find classes, in a given directory (recursively), for a given package + * name, that are annotated by a given annotation. + * + * @param directory + * The directory where to look for. + * @param packageName + * The package name of the classes. + * @param classPrefix + * The prefix of the class name. + * @param classSuffix + * The suffix of the class name. + * @param methodAnnotation + * Only return classes containing methods annotated with methodAnnotation. + * @return The List of classes that matches the requirements. + * @throws ClassNotFoundException + * If something goes wrong... + */ + private static List> findClasses(File directory, + String packageName, String classPrefix, String classSuffix, + Class methodAnnotation) + throws ClassNotFoundException { + List> classes = new ArrayList>(); + if (!directory.exists()) { + return classes; + } + File[] files = directory.listFiles(); + for (File file : files) { + if (file.isDirectory()) { + classes.addAll(findClasses(file, + packageName + "." + file.getName(), classPrefix, classSuffix, methodAnnotation)); + } else if (file.getName().startsWith(classPrefix) && file.getName().endsWith(classSuffix + ".class")) { + // We remove the .class at the end of the filename to get the + // class name... + Class clazz = Class.forName(packageName + + '.' + + file.getName().substring(0, + file.getName().length() - 6)); + + // Check, if class contains test methods (prevent "No runnable methods" exception): + boolean classHasTest = false; + for (Method method : clazz.getMethods()) { + if (method.getAnnotation(methodAnnotation) != null) { + classHasTest = true; + break; + } + } + if (classHasTest) { + classes.add(clazz); + } + } + } + return classes; + } +} \ No newline at end of file diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/groups/SmokeTestCategory.java b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/SmokeTestCategory.java new file mode 100644 index 00000000..ebac5fec --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/SmokeTestCategory.java @@ -0,0 +1,25 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.groups; + +public interface SmokeTestCategory { + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/groups/UnfinishedTestCategory.java b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/UnfinishedTestCategory.java new file mode 100644 index 00000000..2a1451d5 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/groups/UnfinishedTestCategory.java @@ -0,0 +1,25 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.groups; + +public interface UnfinishedTestCategory extends IgnoreTestCategory{ + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/CertificatePopUp.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/CertificatePopUp.java new file mode 100644 index 00000000..1908ac9f --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/CertificatePopUp.java @@ -0,0 +1,49 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +import org.openqa.selenium.support.PageFactory; + +public class CertificatePopUp { + final AndroidDriver driver; + + @AndroidFindBy(name = "OK") + private AndroidElement okButton; + + public CertificatePopUp (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public void clickOnOkButton () { + okButton.click(); + } + + public AndroidElement getOkButtonElement () { + return okButton; + } + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/ElementMenuOptions.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/ElementMenuOptions.java new file mode 100644 index 00000000..74803607 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/ElementMenuOptions.java @@ -0,0 +1,94 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +import org.openqa.selenium.support.PageFactory; + +public class ElementMenuOptions { + + final AndroidDriver driver; + + @AndroidFindBy(name = "Share link") + private AndroidElement shareLinkElement; + + @AndroidFindBy(name = "Unshare link") + private AndroidElement unshareLinkElement; + + @AndroidFindBy(name = "Details") + private AndroidElement detailsFileElement; + + @AndroidFindBy(name = "Rename") + private AndroidElement renameFileElement; + + @AndroidFindBy(name = "Remove") + private AndroidElement removeFileElement; + + @AndroidFindBy(name = "Move") + private AndroidElement moveElement; + + public ElementMenuOptions (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public FileDetailsView clickOnDetails () { + detailsFileElement.click(); + FileDetailsView fileDetailsView = new FileDetailsView(driver); + return fileDetailsView; + } + + public RemoveConfirmationView clickOnRemove () { + removeFileElement.click(); + RemoveConfirmationView removeConfirmationView = + new RemoveConfirmationView(driver); + return removeConfirmationView; + } + + + public MoveView clickOnMove () { + moveElement.click(); + MoveView moveView = new MoveView(driver); + return moveView; + } + + public NewFolderPopUp clickOnRename () { + renameFileElement.click(); + NewFolderPopUp newFolderPopUp = new NewFolderPopUp(driver); + return newFolderPopUp; + } + + public ShareView clickOnShareLinkElement () { + shareLinkElement.click(); + ShareView shareView = new ShareView(driver); + return shareView; + } + + public WaitAMomentPopUp clickOnUnshareLinkElement () { + unshareLinkElement.click(); + WaitAMomentPopUp waitAMomentPopUp = new WaitAMomentPopUp(driver); + return waitAMomentPopUp; + } +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/FileDetailsView.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/FileDetailsView.java new file mode 100644 index 00000000..46da42fd --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/FileDetailsView.java @@ -0,0 +1,61 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +import org.openqa.selenium.support.CacheLookup; +import org.openqa.selenium.support.PageFactory; + +public class FileDetailsView { + final AndroidDriver driver; + + @CacheLookup + @AndroidFindBy(name = "Keep file up to date") + private AndroidElement keepFileUpToDateCheckbox; + + @AndroidFindBy(id = "com.owncloud.android:id/fdProgressBar") + private AndroidElement progressBar; + + public FileDetailsView (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public void checkKeepFileUpToDateCheckbox () { + if(keepFileUpToDateCheckbox.getAttribute("checked").equals("false")){ + keepFileUpToDateCheckbox.click(); + } + } + + public void unCheckKeepFileUpToDateCheckbox () { + if(keepFileUpToDateCheckbox.getAttribute("checked").equals("true")){ + keepFileUpToDateCheckbox.click(); + } + } + + public AndroidElement getProgressBar (){ + return progressBar; + } +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/FileListView.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/FileListView.java new file mode 100644 index 00000000..3c33864e --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/FileListView.java @@ -0,0 +1,211 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import java.util.List; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.android.AndroidKeyCode; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +import org.openqa.selenium.NoSuchElementException; +import org.openqa.selenium.support.CacheLookup; +import org.openqa.selenium.support.PageFactory; +import org.openqa.selenium.Point; + +import com.owncloud.android.test.ui.actions.Actions; + +public class FileListView { + final AndroidDriver driver; + + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".description(\"More options\")") + private AndroidElement menuButton; + + @CacheLookup + @AndroidFindBy(id = "com.owncloud.android:id/list_root") + private AndroidElement filesLayout; + + @CacheLookup + @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\")") + private AndroidElement newFolderButton; + + @CacheLookup + @AndroidFindBy(uiAutomator = "new UiSelector().description(\"Upload\")") + private AndroidElement uploadButton; + + private AndroidElement waitAMomentText; + + @AndroidFindBy(id = "com.owncloud.android:id/ListItemLayout") + private List listItemLayout; + + @AndroidFindBy(id = "com.owncloud.android:id/list_root") + private AndroidElement listRootLayout; + + @AndroidFindBy(name = "Files") + private AndroidElement filesElementUploadFile; + + @CacheLookup + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".description(\"List Layout\")") + private AndroidElement listLayout; + + @AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.FrameLayout\").index(0)") + private AndroidElement deviceScreen; + + 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"; + + + public FileListView (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public MenuList clickOnMenuButton () { + //if the menu option is not in the actionBar, it is opening again + try { + menuButton.click(); + } catch (NoSuchElementException e){ + driver.sendKeyEvent(AndroidKeyCode.MENU); + } + MenuList menuList = new MenuList (driver); + return menuList; + } + + public SettingsView getSettingsView () { + SettingsView settingsView = new SettingsView(driver); + return settingsView; + } + + public NewFolderPopUp clickOnNewFolderButton () { + newFolderButton.click(); + NewFolderPopUp newFolderPopUp = new NewFolderPopUp(driver); + return newFolderPopUp; + } + + public void clickOnUploadButton () { + uploadButton.click(); + } + + public UploadFilesView clickOnFilesElementUploadFile () { + filesElementUploadFile.click(); + UploadFilesView uploadFilesView = new UploadFilesView(driver); + return uploadFilesView; + } + + public AndroidElement getTitleTextElement () { + return titleText; + } + + public AndroidElement getUploadButton () { + return uploadButton; + } + + public AndroidElement getWaitAMomentTextElement () { + return waitAMomentText; + } + + public AndroidElement getListRootElement () { + return listRootLayout; + } + + public List getListItemLayout () { + return listItemLayout; + } + + public AndroidElement getFileElement () { + return fileElement; + } + + public ElementMenuOptions longPressOnElement (String elementName) { + scrollTillFindElement(elementName).tap(1, 1000); + //fileElement.tap(1, 1000); + ElementMenuOptions menuOptions = new ElementMenuOptions(driver); + return menuOptions; + } + + public AndroidElement scrollTillFindElement (String elementName) { + fileElement = Actions + .scrollTillFindElement (elementName,filesLayout,driver); + try { + fileElementLayout = (AndroidElement) driver + .findElementByAndroidUIAutomator("new UiSelector()" + + ".description(\"LinearLayout-"+ elementName +"\")"); + } catch (NoSuchElementException e) { + fileElementLayout = null; + } + return fileElement; + } + + public AndroidElement getFileElementLayout () { + return fileElementLayout; + } + + public AndroidElement getProgressCircular () { + return progressCircular; + } + + public static String getLocalFileIndicator() { + return localFileIndicator; + } + + public static String getFavoriteFileIndicator() { + return favoriteFileIndicator; + } + + public static String getSharedElementIndicator() { + return sharedElementIndicator; + } + public void pulldownToRefresh () throws InterruptedException { + Point listLocation = listLayout.getLocation(); + driver.swipe(listLocation.getX(),listLocation.getY(), + listLocation.getX(),listLocation.getY()+1000, 5000); + } + + + + public void pulldownToSeeNotification () throws InterruptedException { + Point listLocation = deviceScreen.getLocation(); + driver.swipe(listLocation.getX(),listLocation.getY(), + listLocation.getX(),listLocation.getY()+1000, 5000); + } + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/GmailEmailListView.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/GmailEmailListView.java new file mode 100644 index 00000000..a6b69751 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/GmailEmailListView.java @@ -0,0 +1,58 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +import org.openqa.selenium.NoSuchElementException; +import org.openqa.selenium.support.PageFactory; + +public class GmailEmailListView { + + final AndroidDriver driver; + + @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\")") + private AndroidElement emailEuropeanFormatDate; + + + public GmailEmailListView (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public GmailEmailView clickOnEmail (){ + try{ + emailAmericanFormatDate.click(); + }catch (NoSuchElementException e) { + emailEuropeanFormatDate.click(); + } + GmailEmailView gmailEmailView = new GmailEmailView(driver); + return gmailEmailView; + } + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/GmailEmailView.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/GmailEmailView.java new file mode 100644 index 00000000..6d6acd79 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/GmailEmailView.java @@ -0,0 +1,50 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +import org.openqa.selenium.support.CacheLookup; +import org.openqa.selenium.support.PageFactory; + +import com.owncloud.android.test.ui.testSuites.Config; + +public class GmailEmailView { + final AndroidDriver driver; + + @CacheLookup + @AndroidFindBy(name = Config.fileToTestSendByEmailName) + private AndroidElement fileButton; + + public GmailEmailView (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public ImageView clickOnfileButton (){ + fileButton.click(); + ImageView imageView = new ImageView(driver); + return imageView; + } +} \ No newline at end of file diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/GmailSendMailView.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/GmailSendMailView.java new file mode 100644 index 00000000..a8688157 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/GmailSendMailView.java @@ -0,0 +1,63 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +import org.openqa.selenium.support.CacheLookup; +import org.openqa.selenium.support.PageFactory; + +public class GmailSendMailView { + final AndroidDriver driver; + + @CacheLookup + @AndroidFindBy(uiAutomator = "new UiSelector().description(\"To\")") + private AndroidElement toTextField; + + @CacheLookup + @AndroidFindBy(name = "Subject") + private AndroidElement subjectTextField; + + @CacheLookup + @AndroidFindBy(uiAutomator = "new UiSelector().description(\"Send\")") + private AndroidElement sendButton; + + public GmailSendMailView (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public void typeToEmailAdress (String email) { + toTextField.sendKeys(email + "\n"); + } + + public void clickOnSendButton () { + sendButton.click(); + } + + public void typeSubject (String subject) { + subjectTextField.clear(); + subjectTextField.sendKeys(subject); + } +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/ImageView.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/ImageView.java new file mode 100644 index 00000000..c0f13fcc --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/ImageView.java @@ -0,0 +1,80 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; +import org.openqa.selenium.support.CacheLookup; +import org.openqa.selenium.support.PageFactory; + +import com.owncloud.android.test.ui.actions.Actions; +import com.owncloud.android.test.ui.testSuites.Common; + + +public class ImageView { + final AndroidDriver driver; + + @CacheLookup + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".description(\"More options\")") + private AndroidElement optionsButton; + + @AndroidFindBy(name = "Share") + private AndroidElement shareButton; + + @AndroidFindBy(name = "ownCloud") + private AndroidElement ownCloudButton; + + @AndroidFindBy(name = "Share with ownCloud") + private AndroidElement shareWithOwnCloudButton; + + @AndroidFindBy(name = "Just once") + private AndroidElement justOnceButton; + + @AndroidFindBy(id = "android:id/resolver_list") + private AndroidElement sharingAppsLayout; + + public ImageView (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public void clickOnOptionsButton(){ + optionsButton.click(); + } + + public void clickOnShareButton(){ + shareButton.click(); + } + + public void clickOnOwnCloudButton(){ + if(Common.isElementPresent(ownCloudButton)){ + Actions.scrollTillFindElement("ownCloud",sharingAppsLayout,driver); + ownCloudButton.click(); + }else if(Common.isElementPresent(shareWithOwnCloudButton)){} + } + + public void clickOnJustOnceButton(){ + justOnceButton.click(); + } +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/LoginForm.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/LoginForm.java new file mode 100644 index 00000000..aaef6aed --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/LoginForm.java @@ -0,0 +1,115 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import org.openqa.selenium.support.CacheLookup; +import org.openqa.selenium.support.PageFactory; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +public class LoginForm { + final AndroidDriver driver; + + @CacheLookup + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".description(\"Server address\")") + private AndroidElement hostUrlInput; + + @CacheLookup + @AndroidFindBy(uiAutomator = "new UiSelector().description(\"Username\")") + private AndroidElement userNameInput; + + @CacheLookup + @AndroidFindBy(uiAutomator = "new UiSelector().description(\"Password\")") + private AndroidElement passwordInput; + + @CacheLookup + @AndroidFindBy(uiAutomator = "new UiSelector().description(\"Connect\")") + private AndroidElement connectButton; + + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".description(\"Testing connection\")") + private AndroidElement serverStatusText; + + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".description(\"Wrong username or password\")") + private AndroidElement authStatusText; + + public LoginForm (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public CertificatePopUp typeHostUrl (String hostUrl) { + hostUrlInput.clear(); + hostUrlInput.sendKeys(hostUrl + "\n"); + CertificatePopUp certificatePopUp = new CertificatePopUp(driver); + return certificatePopUp; + } + + public void clickOnUserName () { + userNameInput.click(); + } + + public void typeUserName (String userName) { + userNameInput.clear(); + //using the \n , it not need to hide the keyboard + //which sometimes gives problems + userNameInput.sendKeys(userName + "\n"); + //driver.hideKeyboard(); + } + + public void typePassword (String password) { + passwordInput.clear(); + passwordInput.sendKeys(password + "\n"); + //driver.hideKeyboard(); + } + + public FileListView clickOnConnectButton () { + connectButton.click(); + FileListView fileListView = new FileListView(driver); + return fileListView; + } + + public AndroidElement gethostUrlInput () { + return hostUrlInput; + } + + public AndroidElement getUserNameInput () { + return userNameInput; + } + + public AndroidElement getPasswordInput () { + return passwordInput; + } + + + public AndroidElement getServerStatusTextElement () { + return serverStatusText; + } + + public AndroidElement getAuthStatusText () { + return authStatusText; + } +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/MenuList.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/MenuList.java new file mode 100644 index 00000000..132e6717 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/MenuList.java @@ -0,0 +1,47 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import org.openqa.selenium.support.PageFactory; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +public class MenuList { + + final AndroidDriver driver; + + @AndroidFindBy(name = "Settings") + private AndroidElement settingsButton; + + public MenuList (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public SettingsView clickOnSettingsButton () { + settingsButton.click(); + SettingsView settingsView = new SettingsView(driver); + return settingsView; + } +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/MoveView.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/MoveView.java new file mode 100644 index 00000000..222a268e --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/MoveView.java @@ -0,0 +1,57 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +import org.openqa.selenium.support.CacheLookup; +import org.openqa.selenium.support.PageFactory; + +import com.owncloud.android.test.ui.actions.Actions; + +public class MoveView { + final AndroidDriver driver; + + @CacheLookup + @AndroidFindBy(id = "com.owncloud.android:id/list_root") + private AndroidElement filesLayout; + + @AndroidFindBy(name = "Choose") + private AndroidElement chooseButton; + + public MoveView (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public WaitAMomentPopUp clickOnChoose () { + chooseButton.click(); + WaitAMomentPopUp waitAMomentPopUp = new WaitAMomentPopUp(driver); + return waitAMomentPopUp; + } + + public AndroidElement scrollTillFindElement (String elementName) { + return Actions.scrollTillFindElement (elementName,filesLayout,driver); + } +} \ No newline at end of file diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/NewFolderPopUp.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/NewFolderPopUp.java new file mode 100644 index 00000000..fb280662 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/NewFolderPopUp.java @@ -0,0 +1,58 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import org.openqa.selenium.support.PageFactory; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +public class NewFolderPopUp { + + final AndroidDriver driver; + + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".resourceId(\"android:id/button1\")") + private AndroidElement newFolderOkButton; + + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".resourceId(\"com.owncloud.android:id/user_input\")") + private AndroidElement newFolderNameField; + + public NewFolderPopUp (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public void typeNewFolderName (String newFolderName) { + newFolderNameField.clear(); + newFolderNameField.sendKeys(newFolderName + "\n"); + //driver.hideKeyboard(); + } + + public WaitAMomentPopUp clickOnNewFolderOkButton () { + newFolderOkButton.click(); + WaitAMomentPopUp waitAMomentPopUp = new WaitAMomentPopUp(driver); + return waitAMomentPopUp; + } +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/NotificationView.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/NotificationView.java new file mode 100644 index 00000000..35de73c8 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/NotificationView.java @@ -0,0 +1,54 @@ +package com.owncloud.android.test.ui.models; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +import org.openqa.selenium.support.PageFactory; + +public class NotificationView { +final AndroidDriver driver; + + @AndroidFindBy(name = "Upload succeeded") + private static AndroidElement uploadSucceededNotification; + + @AndroidFindBy(name = "Uploading ?") + private static AndroidElement uploadingNotification; + + @AndroidFindBy(uiAutomator = "new UiSelector().description(\"Clear all notifications.\")") + private AndroidElement clearAllNotificationButton; + + @AndroidFindBy(uiAutomator = "new UiSelector().className(\"android.widget.FrameLayout\").index(0)") + private AndroidElement notificationArea; + + + public NotificationView (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + + public AndroidElement getUploadSucceededNotification() { + return uploadSucceededNotification; + } + + public AndroidElement getUploadingNotification() { + return uploadingNotification; + } + + public AndroidElement getClearAllNotificationButton() { + return clearAllNotificationButton; + } + + public void tapOnClearAllNotification () { + clearAllNotificationButton.tap(1, 1000); + } + + public void tapOnBottomNotificationArea(){ + //TODO. it is not working + notificationArea.getSize(); + notificationArea.tap(1, 1000); + } + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/PassCodeRequestView.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/PassCodeRequestView.java new file mode 100644 index 00000000..52744cb5 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/PassCodeRequestView.java @@ -0,0 +1,60 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import org.openqa.selenium.support.PageFactory; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +public class PassCodeRequestView { +final AndroidDriver driver; + + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".className(\"android.widget.EditText\").index(0)") + private AndroidElement codeElement1; + + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".className(\"android.widget.EditText\").index(1)") + private AndroidElement codeElement2; + + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".className(\"android.widget.EditText\").index(2)") + private AndroidElement codeElement3; + + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".className(\"android.widget.EditText\").index(3)") + private AndroidElement codeElement4; + + public PassCodeRequestView (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public void enterPasscode(String codeNumber1, String codeNumber2, + String codeNumber3, String codeNumber4){ + codeElement1 + .sendKeys(codeNumber1 + codeNumber1 + codeNumber1 + codeNumber1); + } + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/PassCodeView.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/PassCodeView.java new file mode 100644 index 00000000..6f84fca5 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/PassCodeView.java @@ -0,0 +1,71 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +import org.openqa.selenium.support.PageFactory; + +public class PassCodeView { + final AndroidDriver driver; + + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".className(\"android.widget.EditText\").index(0)") + private AndroidElement codeElement1; + + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".className(\"android.widget.EditText\").index(1)") + private AndroidElement codeElement2; + + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".className(\"android.widget.EditText\").index(2)") + private AndroidElement codeElement3; + + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".className(\"android.widget.EditText\").index(3)") + private AndroidElement codeElement4; + + @AndroidFindBy(name = "Cancel") + private AndroidElement cancelButton; + + public PassCodeView (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + 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); + SettingsView settingsView = new SettingsView(driver); + return settingsView; + } + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/RemoveConfirmationView.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/RemoveConfirmationView.java new file mode 100644 index 00000000..5b0c0661 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/RemoveConfirmationView.java @@ -0,0 +1,46 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +import org.openqa.selenium.support.PageFactory; + +public class RemoveConfirmationView { + final AndroidDriver driver; + + @AndroidFindBy(name = "Remote and local") + private AndroidElement remoteAndLocalButton; + + public RemoveConfirmationView (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public WaitAMomentPopUp clickOnRemoteAndLocalButton () { + remoteAndLocalButton.click(); + WaitAMomentPopUp waitAMomentPopUp = new WaitAMomentPopUp(driver); + return waitAMomentPopUp; + } +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/SettingsView.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/SettingsView.java new file mode 100644 index 00000000..900c03b2 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/SettingsView.java @@ -0,0 +1,101 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +import org.openqa.selenium.support.CacheLookup; +import org.openqa.selenium.support.PageFactory; + +import com.owncloud.android.test.ui.testSuites.Config; + +public class SettingsView { + final AndroidDriver driver; + + @CacheLookup + @AndroidFindBy(name = Config.userAccount) + private AndroidElement accountElement; + + @CacheLookup + @AndroidFindBy(name = Config.userAccount2) + private AndroidElement accountElement2; + + @AndroidFindBy(name = "Delete account") + private AndroidElement deleteAccountElement; + + @AndroidFindBy(name = "Change password") + private AndroidElement changePasswordElement; + + @AndroidFindBy(name = "Add account") + private AndroidElement addAccountElement; + + @AndroidFindBy(uiAutomator = "new UiSelector()" + + ".className(\"android.widget.CheckBox\").index(0)") + private AndroidElement passcodeCheckbox; + + public SettingsView (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public void tapOnAccountElement (int accountPosition, int fingers, int milliSeconds) { + if(accountPosition==1) + accountElement.tap(fingers, milliSeconds); + else + accountElement2.tap(fingers, milliSeconds); + } + + public void tapOnAddAccount (int fingers, int milliSeconds) { + addAccountElement.tap(fingers, milliSeconds); + } + + public LoginForm clickOnDeleteAccountElement () { + deleteAccountElement.click(); + LoginForm loginForm = new LoginForm(driver); + return loginForm; + } + + public LoginForm clickOnChangePasswordElement () { + changePasswordElement.click(); + LoginForm loginForm = new LoginForm(driver); + return loginForm; + } + + public PassCodeView EnablePassCode(){ + if(!passcodeCheckbox.isSelected()){ + passcodeCheckbox.click(); + } + PassCodeView passcodeview = new PassCodeView(driver); + return passcodeview; + } + + public PassCodeView DisablePassCode(){ + if(passcodeCheckbox.isSelected()){ + passcodeCheckbox.click(); + } + PassCodeView passcodeview = new PassCodeView(driver); + return passcodeview; + } + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/ShareView.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/ShareView.java new file mode 100644 index 00000000..650671ba --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/ShareView.java @@ -0,0 +1,48 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +import org.openqa.selenium.support.CacheLookup; +import org.openqa.selenium.support.FindBy; +import org.openqa.selenium.support.PageFactory; + +public class ShareView { + final AndroidDriver driver; + + @CacheLookup + @FindBy(id = "android:id/select_dialog_listview") + private AndroidElement listViewLayout; + + public ShareView (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public AndroidElement getListViewLayout () { + return listViewLayout; + } + + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/UploadFilesView.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/UploadFilesView.java new file mode 100644 index 00000000..599e90c1 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/UploadFilesView.java @@ -0,0 +1,67 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +import org.openqa.selenium.support.CacheLookup; +import org.openqa.selenium.support.PageFactory; + +import com.owncloud.android.test.ui.actions.Actions; + +public class UploadFilesView{ + final AndroidDriver driver; + + @CacheLookup + @AndroidFindBy(id = "com.owncloud.android:id/list_root") + private AndroidElement filesLayout; + + @CacheLookup + @AndroidFindBy(id = "com.owncloud.android:id/upload_files_btn_upload") + private AndroidElement uploadButton; + + private AndroidElement fileElement; + + public UploadFilesView (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public FileListView clickOnUploadButton () { + uploadButton.click(); + FileListView fileListView = new FileListView (driver); + return fileListView; + } + + //change to scrollTillFindElement + public void scrollTillFindFile (String fileName) { + fileElement = Actions + .scrollTillFindElement(fileName,filesLayout,driver); + } + + public void clickOnFileName (String fileName) { + scrollTillFindFile(fileName); + fileElement.click(); + } +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/UploadView.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/UploadView.java new file mode 100644 index 00000000..5975c9af --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/UploadView.java @@ -0,0 +1,46 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +import org.openqa.selenium.support.CacheLookup; +import org.openqa.selenium.support.PageFactory; + +public class UploadView { + final AndroidDriver driver; + + @CacheLookup + @AndroidFindBy(name = "Upload") + private AndroidElement uploadButton; + + public UploadView (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public void clickOUploadButton () { + uploadButton.click(); + } +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/models/WaitAMomentPopUp.java b/automationTest/src/test/java/com/owncloud/android/test/ui/models/WaitAMomentPopUp.java new file mode 100644 index 00000000..d296235b --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/models/WaitAMomentPopUp.java @@ -0,0 +1,44 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.models; + +import org.openqa.selenium.support.PageFactory; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; +import io.appium.java_client.pagefactory.AndroidFindBy; +import io.appium.java_client.pagefactory.AppiumFieldDecorator; + +public class WaitAMomentPopUp { + final AndroidDriver driver; + + @AndroidFindBy(name = "Wait a moment") + private AndroidElement waitAMomentText; + + public WaitAMomentPopUp (AndroidDriver driver) { + this.driver = driver; + PageFactory.initElements(new AppiumFieldDecorator(driver), this); + } + + public AndroidElement getWaitAMomentTextElement () { + return waitAMomentText; + } +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/.gitignore b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/.gitignore new file mode 100644 index 00000000..fa0f66df --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/.gitignore @@ -0,0 +1 @@ +Config.java \ No newline at end of file diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/Common.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/Common.java new file mode 100644 index 00000000..7510cd99 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/Common.java @@ -0,0 +1,203 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + +import static org.junit.Assert.*; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.FileUtils; +import org.openqa.selenium.By; +import org.openqa.selenium.NoSuchElementException; +import org.openqa.selenium.OutputType; +import org.openqa.selenium.TimeoutException; +import org.openqa.selenium.remote.DesiredCapabilities; +import org.openqa.selenium.remote.RemoteWebDriver; +import org.openqa.selenium.support.ui.WebDriverWait; + +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; + +public class Common{ + AndroidDriver driver; + static int waitingTime = 30; + + public WebDriverWait wait; + + protected AndroidDriver setUpCommonDriver () throws Exception { + File rootPath = new File(System.getProperty("user.dir")); + File appDir = new File(rootPath,"src/test/resources"); + File app = new File(appDir,"ownCloud.apk"); + DesiredCapabilities capabilities = new DesiredCapabilities(); + capabilities.setCapability("platformName", "Android"); + 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); + wait = new WebDriverWait(driver, waitingTime, 50); + return driver; + + } + + protected boolean waitForTextPresent(String text, AndroidElement element) + throws InterruptedException{ + for (int second = 0;;second++){ + if (second >= waitingTime) + return false; + try{ + if (text.equals(element.getText())) + break; + } catch (Exception e){ + + } + Thread.sleep(1000); + } + return true; + } + + protected boolean isElementPresent(AndroidElement element, By by) { + try { + element.findElement(by); + return true; + } catch (NoSuchElementException e) { + return false; + } + } + + public static boolean isElementPresent(AndroidElement element) { + try{ + element.isDisplayed(); + } catch (NoSuchElementException e){ + return false; + } + return true; + } + + //pollingTime in milliseconds + public static void waitTillElementIsNotPresent (AndroidElement element, + int pollingTime) throws Exception { + for (int time = 0;time <= waitingTime * 1000;time += pollingTime){ + try{ + element.isDisplayed(); + } catch (NoSuchElementException e){ + return; + } + Thread.sleep(pollingTime); + } + throw new TimeoutException(); + } + + public static void waitTillElementIsNotPresentWithoutTimeout ( + AndroidElement element,int pollingTime) + throws InterruptedException { + for (int time = 0;time <= waitingTime * 1000;time += pollingTime){ + try{ + element.isDisplayed(); + } catch (NoSuchElementException e){ + return; + } + Thread.sleep(pollingTime); + } + } + + public static void waitTillElementIsPresent ( + AndroidElement element,int pollingTime) + throws InterruptedException { + for (int time = 0;time <= waitingTime * 1000;time += pollingTime){ + try{ + if(element.isDisplayed()){ + return; + } + } catch (NoSuchElementException e){ + + } + Thread.sleep(pollingTime); + } + } + + 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"; + FileUtils.copyFile(file, new File(screenShotName)); + } + + protected void assertIsInFileListView() throws InterruptedException { + //waitForTextPresent("Wrong username or password", + // changePasswordForm.getAuthStatusText()); + Thread.sleep(2000); + 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\")"))); + try { + fileElement = (AndroidElement) driver + .findElementByAndroidUIAutomator("new UiSelector()" + + ".description(\"Upload\")"); + } catch (NoSuchElementException e) { + fileElement = null; + } + assertNull(fileElement); + } + + 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()); + + } + + protected void assertIsInSettingsView() throws InterruptedException { + assertTrue(waitForTextPresent("Settings", (AndroidElement) driver + .findElementByAndroidUIAutomator("new UiSelector()" + + ".resourceId(\"android:id/action_bar_title\")"))); + } + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/Config.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/Config.java new file mode 100644 index 00000000..4674fab2 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/Config.java @@ -0,0 +1,54 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + +public final class Config { + + //without http or https + public static final String URL = "owncloudServerVar"; + public static boolean isTrusted = true; + + //without http or https + public static final String URL2 = "owncloudServer2Var"; + public static boolean isTrusted2 = true; + + public static final String user = "owncloudUserVar"; + public static final String password = "owncloudPasswordVar"; + public static final String user2 = "owncloudUser2Var"; + public static final String password2 = "owncloudPassword2Var"; + public static final String userAccount = user + "@"+ URL; + public static final String userAccount2 = user2 + "@"+ URL2; + + public static final String gmailAccount = "gmailAccountVar"; + + public static final String fileWhichIsInTheServer1 ="test"; + public static final String fileWhichIsInTheServer2 ="test"; + + public static final String fileToTestName = "test"; + public static final String fileToTestSendByEmailName = "test"; + public static final String bigFileToTestName = "test"; + + public static final String passcode1 = "passcode1"; + public static final String passcode2 = "passcode2"; + public static final String passcode3 = "passcode3"; + public static final String passcode4 = "passcode4"; + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/CreateFolderTestSuite.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/CreateFolderTestSuite.java new file mode 100644 index 00000000..13948755 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/CreateFolderTestSuite.java @@ -0,0 +1,94 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + +import static org.junit.Assert.*; +import io.appium.java_client.android.AndroidDriver; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.experimental.categories.Category; +import org.junit.rules.TestName; +import org.junit.runners.MethodSorters; +import org.junit.FixMethodOrder; +import org.junit.Test; + +import com.owncloud.android.test.ui.actions.Actions; +import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory; +import com.owncloud.android.test.ui.groups.SmokeTestCategory; +import com.owncloud.android.test.ui.models.FileListView; +import com.owncloud.android.test.ui.models.WaitAMomentPopUp; + + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class CreateFolderTestSuite{ + + AndroidDriver driver; + Common common; + private Boolean folderHasBeenCreated = false; + private final String FOLDER_NAME = "testCreateFolder"; + private String CurrentCreatedFolder = ""; + + @Rule public TestName name = new TestName(); + + @Before + public void setUp() throws Exception { + common=new Common(); + driver=common.setUpCommonDriver(); + } + + @Test + @Category({NoIgnoreTestCategory.class, SmokeTestCategory.class}) + public void testCreateNewFolder () throws Exception { + String NEW_FOLDER_NAME = "testCreateFolder"; + + 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.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp + .getWaitAMomentTextElement(), 100); + fileListView.scrollTillFindElement(FOLDER_NAME); + assertNotNull(fileListView.getFileElement()); + assertTrue( + folderHasBeenCreated=fileListView.getFileElement().isDisplayed()); + CurrentCreatedFolder = FOLDER_NAME; + assertEquals(FOLDER_NAME , fileListView.getFileElement().getText()); + } + + @After + public void tearDown() throws Exception { + common.takeScreenShotOnFailed(name.getMethodName()); + if (folderHasBeenCreated) { + FileListView fileListView = new FileListView(driver); + Actions.deleteElement(CurrentCreatedFolder, fileListView, driver); + } + driver.removeApp("com.owncloud.android"); + driver.quit(); + } + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/DeleteFileTestSuite.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/DeleteFileTestSuite.java new file mode 100644 index 00000000..5970ec97 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/DeleteFileTestSuite.java @@ -0,0 +1,87 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + +import static org.junit.Assert.*; +import io.appium.java_client.android.AndroidDriver; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.experimental.categories.Category; +import org.junit.rules.TestName; +import org.junit.runners.MethodSorters; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.support.ui.ExpectedConditions; + +import com.owncloud.android.test.ui.actions.Actions; +import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory; +import com.owncloud.android.test.ui.groups.SmokeTestCategory; +import com.owncloud.android.test.ui.models.FileListView; + + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class DeleteFileTestSuite{ + + AndroidDriver driver; + Common common; + private final String FILE_NAME = Config.fileToTestName; + + @Rule public TestName name = new TestName(); + + @Before + public void setUp() throws Exception { + common=new Common(); + driver=common.setUpCommonDriver(); + } + + @Test + @Category({NoIgnoreTestCategory.class, SmokeTestCategory.class}) + public void testDeleteFile () throws Exception { + FileListView fileListView = Actions.login(Config.URL, Config.user, + Config.password, Config.isTrusted, driver); + common.assertIsInFileListView(); + + //TODO. if the file already exists, do not upload + FileListView fileListViewAfterUploadFile = Actions + .uploadFile(FILE_NAME, fileListView); + + fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME); + Common.waitTillElementIsNotPresentWithoutTimeout( + 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()); + } + + @After + public void tearDown() throws Exception { + common.takeScreenShotOnFailed(name.getMethodName()); + driver.removeApp("com.owncloud.android"); + driver.quit(); + } + +} \ No newline at end of file diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/DeleteFolderTestSuite.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/DeleteFolderTestSuite.java new file mode 100644 index 00000000..375de02a --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/DeleteFolderTestSuite.java @@ -0,0 +1,92 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + +import static org.junit.Assert.*; +import io.appium.java_client.android.AndroidDriver; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.experimental.categories.Category; +import org.junit.rules.TestName; +import org.junit.runners.MethodSorters; +import org.junit.FixMethodOrder; +import org.junit.Test; + +import com.owncloud.android.test.ui.actions.Actions; +import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory; +import com.owncloud.android.test.ui.groups.SmokeTestCategory; +import com.owncloud.android.test.ui.models.FileListView; +import com.owncloud.android.test.ui.models.WaitAMomentPopUp; + + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class DeleteFolderTestSuite{ + AndroidDriver driver; + Common common; + private Boolean folderHasBeenCreated = false; + private final String FOLDER_NAME = "testCreateFolder"; + + @Rule public TestName name = new TestName(); + + + @Before + public void setUp() throws Exception { + common=new Common(); + driver=common.setUpCommonDriver(); + } + + @Test + @Category({NoIgnoreTestCategory.class, SmokeTestCategory.class}) + public void testDeleteFolder () throws Exception { + 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.waitTillElementIsNotPresentWithoutTimeout( + waitAMomentPopUp.getWaitAMomentTextElement(), 100); + fileListView.scrollTillFindElement(FOLDER_NAME); + assertTrue( + folderHasBeenCreated = fileListView.getFileElement().isDisplayed()); + + //delete the folder + Actions.deleteElement(FOLDER_NAME, fileListView, driver); + assertFalse( + folderHasBeenCreated =fileListView.getFileElement().isDisplayed()); + } + + @After + public void tearDown() throws Exception { + common.takeScreenShotOnFailed(name.getMethodName()); + if(folderHasBeenCreated){ + FileListView fileListView = new FileListView(driver); + Actions.deleteElement(FOLDER_NAME, fileListView, driver); + } + driver.removeApp("com.owncloud.android"); + driver.quit(); + } + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/LoginTestSuite.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/LoginTestSuite.java new file mode 100644 index 00000000..d9a95535 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/LoginTestSuite.java @@ -0,0 +1,181 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + +import static org.junit.Assert.*; +import io.appium.java_client.android.AndroidDriver; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.experimental.categories.Category; +import org.junit.rules.TestName; +import org.junit.runners.MethodSorters; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.openqa.selenium.ScreenOrientation; + +import com.owncloud.android.test.ui.actions.Actions; +import com.owncloud.android.test.ui.groups.*; +import com.owncloud.android.test.ui.models.LoginForm; +import com.owncloud.android.test.ui.models.FileListView; +import com.owncloud.android.test.ui.models.MenuList; +import com.owncloud.android.test.ui.models.SettingsView; + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class LoginTestSuite{ + AndroidDriver driver; + Common common; + + @Rule public TestName name = new TestName(); + + @Before + public void setUp() throws Exception { + common=new Common(); + driver=common.setUpCommonDriver(); + } + + @Test + @Category({NoIgnoreTestCategory.class}) + public void test1LoginPortrait () throws Exception { + driver.rotate(ScreenOrientation.PORTRAIT); + + Actions.login(Config.URL, Config.user, + Config.password, Config.isTrusted, driver); + common.assertIsInFileListView(); + } + + @Test + @Category({NoIgnoreTestCategory.class}) + public void test2LoginLandscape () throws Exception { + driver.rotate(ScreenOrientation.LANDSCAPE); + Actions.login(Config.URL, Config.user, + Config.password, Config.isTrusted, driver); + common.assertIsInFileListView(); + } + + @Test + @Category({NoIgnoreTestCategory.class, SmokeTestCategory.class}) + public void testLoginAndShowFiles () throws Exception { + driver.rotate(ScreenOrientation.PORTRAIT); + + FileListView fileListView = Actions.login(Config.URL, Config.user, + Config.password, Config.isTrusted, driver); + common.assertIsInFileListView(); + + fileListView.scrollTillFindElement(Config.fileWhichIsInTheServer1); + assertTrue(fileListView.getFileElement().isDisplayed()); + } + + + + @Test + @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); + common.assertIsInFileListView(); + + driver.rotate(ScreenOrientation.PORTRAIT); + MenuList menu = fileListView.clickOnMenuButton(); + SettingsView settingsView = menu.clickOnSettingsButton(); + + settingsView.tapOnAddAccount(1, 1000); + fileListView = Actions.login(Config.URL2, Config.user2, + Config.password2, Config.isTrusted2, driver); + common.assertIsInSettingsView(); + } + + @Test + @Category({NoIgnoreTestCategory.class, SmokeTestCategory.class}) + public void testMultiAccountAndShowFiles () throws Exception { + driver.rotate(ScreenOrientation.LANDSCAPE); + FileListView fileListView = Actions.login(Config.URL, Config.user, + Config.password, Config.isTrusted, driver); + common.assertIsInFileListView(); + fileListView.scrollTillFindElement(Config.fileWhichIsInTheServer1); + assertTrue(fileListView.getFileElement().isDisplayed()); + + driver.rotate(ScreenOrientation.PORTRAIT); + MenuList menu = fileListView.clickOnMenuButton(); + SettingsView settingsView = menu.clickOnSettingsButton(); + + settingsView.tapOnAddAccount(1, 1000); + fileListView = Actions.login(Config.URL2, Config.user2, + Config.password2, Config.isTrusted2, driver); + common.assertIsInSettingsView(); + settingsView.tapOnAccountElement(2,1, 100); + common.assertIsInFileListView(); + + fileListView.scrollTillFindElement(Config.fileWhichIsInTheServer2); + assertTrue(fileListView.getFileElement().isDisplayed()); + } + + @Test + @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); + common.assertIsInFileListView(); + + driver.rotate(ScreenOrientation.LANDSCAPE); + MenuList menu = fileListView.clickOnMenuButton(); + SettingsView settingsView = menu.clickOnSettingsButton(); + 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())); + } + + @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); + common.assertIsInFileListView(); + MenuList menu = fileListView.clickOnMenuButton(); + SettingsView settingsView = menu.clickOnSettingsButton(); + settingsView.tapOnAccountElement(1,1, 1000); + LoginForm changePasswordForm = settingsView + .clickOnChangePasswordElement(); + changePasswordForm.typePassword("WrongPassword"); + changePasswordForm.clickOnConnectButton(); + assertTrue(common.waitForTextPresent("Wrong username or password", + changePasswordForm.getAuthStatusText())); + } + + + @After + public void tearDown() throws Exception { + common.takeScreenShotOnFailed(name.getMethodName()); + driver.removeApp("com.owncloud.android"); + driver.quit(); + } + + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/LogoutTestSuite.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/LogoutTestSuite.java new file mode 100644 index 00000000..8927dace --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/LogoutTestSuite.java @@ -0,0 +1,77 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + + +import static org.junit.Assert.*; +import io.appium.java_client.android.AndroidDriver; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.rules.TestName; + +import com.owncloud.android.test.ui.actions.Actions; +import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory; +import com.owncloud.android.test.ui.groups.SmokeTestCategory; +import com.owncloud.android.test.ui.models.LoginForm; +import com.owncloud.android.test.ui.models.FileListView; +import com.owncloud.android.test.ui.models.MenuList; +import com.owncloud.android.test.ui.models.SettingsView; + +public class LogoutTestSuite{ + + AndroidDriver driver; + Common common; + + @Rule public TestName name = new TestName(); + + @Before + public void setUp() throws Exception { + common=new Common(); + driver=common.setUpCommonDriver(); + } + + @Test + @Category({NoIgnoreTestCategory.class, SmokeTestCategory.class}) + public void testLogout () throws Exception { + 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,1, 1000); + LoginForm loginForm = settingsView.clickOnDeleteAccountElement(); + assertEquals("Server address https://…", + loginForm.gethostUrlInput().getText()); + assertEquals("Username", loginForm.getUserNameInput().getText()); + assertEquals("", loginForm.getPasswordInput().getText()); + } + + @After + public void tearDown() throws Exception { + common.takeScreenShotOnFailed(name.getMethodName()); + //driver.removeApp("com.owncloud.android"); + driver.quit(); + } +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/MoveFileTestSuite.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/MoveFileTestSuite.java new file mode 100644 index 00000000..38c004b5 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/MoveFileTestSuite.java @@ -0,0 +1,120 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + +import static org.junit.Assert.*; +import io.appium.java_client.android.AndroidDriver; + +import org.junit.After; +import org.junit.Before; +import org.junit.FixMethodOrder; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.rules.TestName; +import org.junit.runners.MethodSorters; + +import com.owncloud.android.test.ui.actions.Actions; +import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory; +import com.owncloud.android.test.ui.groups.SmokeTestCategory; +import com.owncloud.android.test.ui.models.ElementMenuOptions; +import com.owncloud.android.test.ui.models.FileListView; +import com.owncloud.android.test.ui.models.MoveView; +import com.owncloud.android.test.ui.models.WaitAMomentPopUp; + + + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class MoveFileTestSuite{ + AndroidDriver driver; + Common common; + private String FOLDER_WHERE_MOVE = "folderWhereMove"; + private String FILE_NAME = Config.fileToTestName; + @Rule public TestName name = new TestName(); + + @Before + public void setUp() throws Exception { + common=new Common(); + driver=common.setUpCommonDriver(); + } + + @Test + @Category({NoIgnoreTestCategory.class, SmokeTestCategory.class}) + public void testMoveFile () throws Exception { + WaitAMomentPopUp waitAMomentPopUp; + + FileListView fileListView = Actions.login(Config.URL, Config.user, + Config.password, Config.isTrusted, driver); + common.assertIsInFileListView(); + + //Common.waitTillElementIsNotPresentWithoutTimeout( + //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.waitTillElementIsNotPresentWithoutTimeout( + waitAMomentPopUp.getWaitAMomentTextElement(), 100); + fileListView.scrollTillFindElement(FOLDER_WHERE_MOVE); + assertTrue(fileListView.getFileElement().isDisplayed()); + + 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); + MoveView moveView = menuOptions.clickOnMove(); + + //to move to a folder + moveView.scrollTillFindElement(FOLDER_WHERE_MOVE).tap(1,1); + waitAMomentPopUp = moveView.clickOnChoose(); + Common.waitTillElementIsNotPresentWithoutTimeout( + waitAMomentPopUp.getWaitAMomentTextElement(), 100); + + //check that the folder moved is inside the other + fileListView.scrollTillFindElement(FOLDER_WHERE_MOVE).tap(1,1); + Common.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(), + 1000); + Thread.sleep(1000); + fileListView.scrollTillFindElement(FILE_NAME); + assertEquals(FILE_NAME , fileListView.getFileElement().getText()); + + } + + @After + public void tearDown() throws Exception { + common.takeScreenShotOnFailed(name.getMethodName()); + FileListView fileListView = new FileListView(driver); + driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_BACK); + Actions.deleteElement(FOLDER_WHERE_MOVE, fileListView, driver); + Actions.deleteElement(FILE_NAME, fileListView, driver); + driver.removeApp("com.owncloud.android"); + driver.quit(); + } + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/MoveFolderTestSuite.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/MoveFolderTestSuite.java new file mode 100644 index 00000000..a6f8769f --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/MoveFolderTestSuite.java @@ -0,0 +1,122 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + +import static org.junit.Assert.*; +import io.appium.java_client.android.AndroidDriver; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.experimental.categories.Category; +import org.junit.rules.TestName; +import org.junit.runners.MethodSorters; +import org.junit.FixMethodOrder; +import org.junit.Test; + +import com.owncloud.android.test.ui.actions.Actions; +import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory; +import com.owncloud.android.test.ui.groups.SmokeTestCategory; +import com.owncloud.android.test.ui.models.ElementMenuOptions; +import com.owncloud.android.test.ui.models.FileListView; +import com.owncloud.android.test.ui.models.MoveView; +import com.owncloud.android.test.ui.models.WaitAMomentPopUp; + + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class MoveFolderTestSuite{ + AndroidDriver driver; + Common common; + private String FOLDER_TO_MOVE = "folderToMove"; + private String FOLDER_WHERE_MOVE = "folderWhereMove"; + + @Rule public TestName name = new TestName(); + + @Before + public void setUp() throws Exception { + common=new Common(); + driver=common.setUpCommonDriver(); + } + + @Test + @Category({NoIgnoreTestCategory.class, SmokeTestCategory.class}) + public void testMoveFolder () throws Exception { + WaitAMomentPopUp waitAMomentPopUp; + + FileListView fileListView = Actions.login(Config.URL, Config.user, + Config.password, Config.isTrusted, driver); + common.assertIsInFileListView(); + + //Common.waitTillElementIsNotPresentWithoutTimeout( + //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.waitTillElementIsNotPresentWithoutTimeout( + 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); + fileListView.scrollTillFindElement(FOLDER_TO_MOVE); + assertTrue(fileListView.getFileElement().isDisplayed()); + + //select to move the folder + 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.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp + .getWaitAMomentTextElement(), 100); + + //check that the folder moved is inside the other + fileListView.scrollTillFindElement(FOLDER_WHERE_MOVE).tap(1,1); + Common.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(), + 1000); + Thread.sleep(1000); + fileListView.scrollTillFindElement(FOLDER_TO_MOVE); + assertEquals(FOLDER_TO_MOVE , fileListView.getFileElement().getText()); + } + + @After + public void tearDown() throws Exception { + common.takeScreenShotOnFailed(name.getMethodName()); + FileListView fileListView = new FileListView(driver); + driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_BACK); + Actions.deleteElement(FOLDER_WHERE_MOVE, fileListView, driver); + Actions.deleteElement(FOLDER_TO_MOVE, fileListView, driver); + driver.removeApp("com.owncloud.android"); + driver.quit(); + } + + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/PasscodeTestSuite.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/PasscodeTestSuite.java new file mode 100644 index 00000000..9f671ce8 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/PasscodeTestSuite.java @@ -0,0 +1,98 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + +import io.appium.java_client.android.AndroidDriver; + +import org.junit.After; +import org.junit.Before; +import org.junit.FixMethodOrder; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.rules.TestName; +import org.junit.runners.MethodSorters; +import org.openqa.selenium.ScreenOrientation; + +import com.owncloud.android.test.ui.actions.Actions; +import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory; +import com.owncloud.android.test.ui.models.FileListView; +import com.owncloud.android.test.ui.models.MenuList; +import com.owncloud.android.test.ui.models.PassCodeRequestView; +import com.owncloud.android.test.ui.models.PassCodeView; +import com.owncloud.android.test.ui.models.SettingsView; + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class PasscodeTestSuite { + AndroidDriver driver; + Common common; + + @Rule public TestName name = new TestName(); + + @Before + public void setUp() throws Exception { + common=new Common(); + driver=common.setUpCommonDriver(); + } + + @Test + @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); + 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); + + 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 + common.assertIsNotInFileListView(); + common.assertIsPasscodeRequestView(); + + PassCodeRequestView passCodeReequestView = new + PassCodeRequestView(driver); + passCodeReequestView.enterPasscode(Config.passcode1, Config.passcode2, + Config.passcode3, Config.passcode4); + common.assertIsInFileListView(); + } + + + @After + public void tearDown() throws Exception { + common.takeScreenShotOnFailed(name.getMethodName()); + driver.removeApp("com.owncloud.android"); + driver.quit(); + } + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RefreshFolderTestSuite.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RefreshFolderTestSuite.java new file mode 100644 index 00000000..850a7572 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RefreshFolderTestSuite.java @@ -0,0 +1,77 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + +import static org.junit.Assert.*; +import io.appium.java_client.android.AndroidDriver; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.experimental.categories.Category; +import org.junit.rules.TestName; +import org.junit.runners.MethodSorters; +import org.junit.FixMethodOrder; +import org.junit.Test; + +import com.owncloud.android.test.ui.actions.Actions; +import com.owncloud.android.test.ui.groups.UnfinishedTestCategory; +import com.owncloud.android.test.ui.models.FileListView; + + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class RefreshFolderTestSuite{ + AndroidDriver driver; + Common common; + + @Rule public TestName name = new TestName(); + + @Before + public void setUp() throws Exception { + common=new Common(); + driver=common.setUpCommonDriver(); + } + + + @Test + @Category({UnfinishedTestCategory.class}) + public void testPulldownToRefreshFolder () throws Exception { + 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 + Thread.sleep(5000); + //waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(), 1000); + fileListView.pulldownToRefresh(); + assertTrue(fileListView.getProgressCircular().isDisplayed()); + //TODO insert a file in the web, and check that it's shown here + } + + + @After + public void tearDown() throws Exception { + common.takeScreenShotOnFailed(name.getMethodName()); + driver.removeApp("com.owncloud.android"); + driver.quit(); + } + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RenameFileTestSuite.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RenameFileTestSuite.java new file mode 100644 index 00000000..d82cd119 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RenameFileTestSuite.java @@ -0,0 +1,114 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + +import static org.junit.Assert.*; +import io.appium.java_client.android.AndroidDriver; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.experimental.categories.Category; +import org.junit.rules.TestName; +import org.junit.runners.MethodSorters; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.support.ui.ExpectedConditions; + +import com.owncloud.android.test.ui.actions.Actions; +import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory; +import com.owncloud.android.test.ui.groups.SmokeTestCategory; +import com.owncloud.android.test.ui.models.ElementMenuOptions; +import com.owncloud.android.test.ui.models.FileListView; +import com.owncloud.android.test.ui.models.NewFolderPopUp; +import com.owncloud.android.test.ui.models.WaitAMomentPopUp; + + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class RenameFileTestSuite{ + + AndroidDriver driver; + Common common; + private Boolean fileHasBeenCreated = false; + private final String OLD_FILE_NAME = Config.fileToTestName; + private final String FILE_NAME = "newNameFile"; + private String CurrentCreatedFile = ""; + + @Rule public TestName name = new TestName(); + + @Before + public void setUp() throws Exception { + common=new Common(); + driver=common.setUpCommonDriver(); + } + + @Test + @Category({NoIgnoreTestCategory.class, SmokeTestCategory.class}) + public void testRenameFile () throws Exception { + 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); + + //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()); + CurrentCreatedFile = OLD_FILE_NAME; + Common.waitTillElementIsNotPresentWithoutTimeout(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.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp + .getWaitAMomentTextElement(), 100); + fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME); + assertNotNull(fileListViewAfterUploadFile.getFileElement()); + assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed()); + assertEquals(FILE_NAME , fileListViewAfterUploadFile.getFileElement() + .getText()); + CurrentCreatedFile = FILE_NAME; + } + + @After + public void tearDown() throws Exception { + common.takeScreenShotOnFailed(name.getMethodName()); + if (fileHasBeenCreated) { + FileListView fileListView = new FileListView(driver); + Actions.deleteElement(CurrentCreatedFile,fileListView, driver); + } + driver.removeApp("com.owncloud.android"); + driver.quit(); + } + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RenameFolderTestSuite.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RenameFolderTestSuite.java new file mode 100644 index 00000000..271295f0 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RenameFolderTestSuite.java @@ -0,0 +1,112 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + +import static org.junit.Assert.*; +import io.appium.java_client.android.AndroidDriver; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.experimental.categories.Category; +import org.junit.rules.TestName; +import org.junit.runners.MethodSorters; +import org.junit.FixMethodOrder; +import org.junit.Test; + +import com.owncloud.android.test.ui.actions.Actions; +import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory; +import com.owncloud.android.test.ui.groups.SmokeTestCategory; +import com.owncloud.android.test.ui.models.ElementMenuOptions; +import com.owncloud.android.test.ui.models.FileListView; +import com.owncloud.android.test.ui.models.NewFolderPopUp; +import com.owncloud.android.test.ui.models.WaitAMomentPopUp; + + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +public class RenameFolderTestSuite{ + + AndroidDriver driver; + Common common; + private Boolean folderHasBeenCreated = false; + private final String OLD_FOLDER_NAME = "beforeRemoving"; + private final String FOLDER_NAME = "testCreateFolder"; + private String CurrentCreatedFolder = ""; + + @Rule public TestName name = new TestName(); + + + @Before + public void setUp() throws Exception { + common=new Common(); + driver=common.setUpCommonDriver(); + } + + @Test + @Category({NoIgnoreTestCategory.class, SmokeTestCategory.class}) + public void testRenameFolder () throws Exception { + 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.waitTillElementIsNotPresentWithoutTimeout( + waitAMomentPopUp.getWaitAMomentTextElement(), 100); + fileListView.scrollTillFindElement(OLD_FOLDER_NAME); + + assertTrue( + folderHasBeenCreated = fileListView.getFileElement().isDisplayed()); + + //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); + NewFolderPopUp FolderPopUp = menuOptions.clickOnRename(); + FolderPopUp.typeNewFolderName(FOLDER_NAME); + FolderPopUp.clickOnNewFolderOkButton(); + CurrentCreatedFolder = FOLDER_NAME; + Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp + .getWaitAMomentTextElement(), 100); + fileListView.scrollTillFindElement(FOLDER_NAME); + assertNotNull(fileListView.getFileElement()); + assertTrue( + folderHasBeenCreated = fileListView.getFileElement().isDisplayed()); + assertEquals(FOLDER_NAME , fileListView.getFileElement().getText()); + } + + @After + public void tearDown() throws Exception { + common.takeScreenShotOnFailed(name.getMethodName()); + if(folderHasBeenCreated){ + FileListView fileListView = new FileListView(driver); + Actions.deleteElement(CurrentCreatedFolder, fileListView, driver); + } + driver.removeApp("com.owncloud.android"); + driver.quit(); + } + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunFailingTests.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunFailingTests.java new file mode 100644 index 00000000..9633abca --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunFailingTests.java @@ -0,0 +1,44 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + + +import org.junit.experimental.categories.Categories.ExcludeCategory; +import org.junit.experimental.categories.Categories.IncludeCategory; +import org.junit.runner.RunWith; + +import com.owncloud.android.test.ui.groups.FailingTestCategory; +import com.owncloud.android.test.ui.groups.FlexibleCategories; +import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory; +import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassPrefix; +import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassSuffix; +import com.owncloud.android.test.ui.groups.FlexibleCategories.TestScanPackage; + + +@RunWith(FlexibleCategories.class) +@ExcludeCategory(NoIgnoreTestCategory.class) +@IncludeCategory(FailingTestCategory.class) +@TestScanPackage("com.owncloud.android.test.ui.testSuites") +@TestClassPrefix("") +@TestClassSuffix("TestSuite") +public class RunFailingTests { + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunInProgressTest.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunInProgressTest.java new file mode 100644 index 00000000..9fb14a05 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunInProgressTest.java @@ -0,0 +1,19 @@ +package com.owncloud.android.test.ui.testSuites; + +import org.junit.experimental.categories.Categories.IncludeCategory; +import org.junit.runner.RunWith; +import com.owncloud.android.test.ui.groups.FlexibleCategories; +import com.owncloud.android.test.ui.groups.InProgressCategory; +import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassPrefix; +import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassSuffix; +import com.owncloud.android.test.ui.groups.FlexibleCategories.TestScanPackage; + + +@RunWith(FlexibleCategories.class) +@IncludeCategory(InProgressCategory.class) +@TestScanPackage("com.owncloud.android.test.ui.testSuites") +@TestClassPrefix("") +@TestClassSuffix("TestSuite") +public class RunInProgressTest { + +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunNoIgnoreTests.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunNoIgnoreTests.java new file mode 100644 index 00000000..4d904387 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunNoIgnoreTests.java @@ -0,0 +1,42 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + +import org.junit.experimental.categories.Categories.ExcludeCategory; +import org.junit.experimental.categories.Categories.IncludeCategory; +import org.junit.runner.RunWith; + +import com.owncloud.android.test.ui.groups.FlexibleCategories; +import com.owncloud.android.test.ui.groups.IgnoreTestCategory; +import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory; +import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassPrefix; +import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassSuffix; +import com.owncloud.android.test.ui.groups.FlexibleCategories.TestScanPackage; + + +@RunWith(FlexibleCategories.class) +@ExcludeCategory(IgnoreTestCategory.class) +@IncludeCategory(NoIgnoreTestCategory.class) +@TestScanPackage("com.owncloud.android.test.ui.testSuites") +@TestClassPrefix("") +@TestClassSuffix("TestSuite") +public class RunNoIgnoreTests { +} \ No newline at end of file diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunSmokeTests.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunSmokeTests.java new file mode 100644 index 00000000..5c2e6ebd --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/RunSmokeTests.java @@ -0,0 +1,42 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + +import org.junit.experimental.categories.Categories.ExcludeCategory; +import org.junit.experimental.categories.Categories.IncludeCategory; +import org.junit.runner.RunWith; + +import com.owncloud.android.test.ui.groups.FlexibleCategories; +import com.owncloud.android.test.ui.groups.IgnoreTestCategory; +import com.owncloud.android.test.ui.groups.SmokeTestCategory; +import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassPrefix; +import com.owncloud.android.test.ui.groups.FlexibleCategories.TestClassSuffix; +import com.owncloud.android.test.ui.groups.FlexibleCategories.TestScanPackage; + + +@RunWith(FlexibleCategories.class) +@ExcludeCategory(IgnoreTestCategory.class) +@IncludeCategory(SmokeTestCategory.class) +@TestScanPackage("com.owncloud.android.test.ui.testSuites") +@TestClassPrefix("") +@TestClassSuffix("TestSuite") +public class RunSmokeTests { +} \ No newline at end of file diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/ShareLinkFileTestSuite.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/ShareLinkFileTestSuite.java new file mode 100644 index 00000000..5e604cd3 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/ShareLinkFileTestSuite.java @@ -0,0 +1,133 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + +import static org.junit.Assert.*; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.experimental.categories.Category; +import org.junit.rules.TestName; + +import com.owncloud.android.test.ui.actions.Actions; +import com.owncloud.android.test.ui.groups.IgnoreTestCategory; +import com.owncloud.android.test.ui.groups.InProgressCategory; +import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory; +import com.owncloud.android.test.ui.groups.SmokeTestCategory; +import com.owncloud.android.test.ui.models.FileListView;; + +public class ShareLinkFileTestSuite{ + + AndroidDriver driver; + Common common; + private final String FILE_NAME = Config.fileToTestName; + private Boolean fileHasBeenCreated = false; + + @Rule public TestName name = new TestName(); + + @Before + public void setUp() throws Exception { + common=new Common(); + driver=common.setUpCommonDriver(); + } + + @Test + @Category({NoIgnoreTestCategory.class}) + public void testShareLinkFileByGmail () throws Exception { + AndroidElement sharedElementIndicator; + FileListView fileListView = Actions.login(Config.URL, Config.user, + Config.password, Config.isTrusted, driver); + common.assertIsInFileListView(); + + //TODO. if the file already exists, do not upload + FileListView fileListViewAfterUploadFile = Actions + .uploadFile(FILE_NAME, fileListView); + + fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME); + assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile + .getFileElement().isDisplayed()); + + sharedElementIndicator = Actions.shareLinkElementByGmail(FILE_NAME, + fileListViewAfterUploadFile,driver,common); + assertTrue(sharedElementIndicator.isDisplayed()); + } + + @Test + @Category({NoIgnoreTestCategory.class, SmokeTestCategory.class}) + public void testShareLinkFileByCopyLink () throws Exception { + AndroidElement sharedElementIndicator; + FileListView fileListView = Actions.login(Config.URL, Config.user, + Config.password, Config.isTrusted, driver); + common.assertIsInFileListView(); + + //TODO. if the file already exists, do not upload + FileListView fileListViewAfterUploadFile = Actions + .uploadFile(FILE_NAME, fileListView); + + fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME); + assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile + .getFileElement().isDisplayed()); + + sharedElementIndicator = Actions.shareLinkElementByCopyLink(FILE_NAME, + fileListViewAfterUploadFile,driver,common); + assertTrue(sharedElementIndicator.isDisplayed()); + } + + @Test + @Category({IgnoreTestCategory.class, SmokeTestCategory.class}) + public void testUnshareLinkFile () throws Exception { + AndroidElement sharedElementIndicator; + FileListView fileListView = Actions.login(Config.URL, Config.user, + Config.password, Config.isTrusted, driver); + common.assertIsInFileListView(); + + //TODO. if the file already exists, do not upload + FileListView fileListViewAfterUploadFile = Actions + .uploadFile(FILE_NAME, fileListView); + + fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME); + assertTrue(fileHasBeenCreated = fileListViewAfterUploadFile + .getFileElement().isDisplayed()); + + sharedElementIndicator = Actions.shareLinkElementByCopyLink(FILE_NAME, + fileListViewAfterUploadFile,driver,common); + assertTrue(sharedElementIndicator.isDisplayed()); + Actions.unshareLinkElement(FILE_NAME, + fileListViewAfterUploadFile,driver,common); + assertFalse(sharedElementIndicator.isDisplayed()); + + } + + @After + public void tearDown() throws Exception { + common.takeScreenShotOnFailed(name.getMethodName()); + if (fileHasBeenCreated) { + FileListView fileListView = new FileListView(driver); + Actions.deleteElement(FILE_NAME,fileListView, driver); + } + driver.removeApp("com.owncloud.android"); + driver.quit(); + } +} diff --git a/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/UploadTestSuite.java b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/UploadTestSuite.java new file mode 100644 index 00000000..d8ffeff5 --- /dev/null +++ b/automationTest/src/test/java/com/owncloud/android/test/ui/testSuites/UploadTestSuite.java @@ -0,0 +1,285 @@ +/** + * 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 . + * + */ + +package com.owncloud.android.test.ui.testSuites; + + +import static org.junit.Assert.*; +import io.appium.java_client.MobileBy; +import io.appium.java_client.android.AndroidDriver; + +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.experimental.categories.Category; +import org.junit.rules.TestName; +import org.junit.runners.MethodSorters; +import org.junit.FixMethodOrder; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.NoSuchElementException; +import org.openqa.selenium.support.ui.ExpectedConditions; + +import com.owncloud.android.test.ui.actions.Actions; +import com.owncloud.android.test.ui.groups.FailingTestCategory; +import com.owncloud.android.test.ui.groups.InProgressCategory; +import com.owncloud.android.test.ui.groups.NoIgnoreTestCategory; +import com.owncloud.android.test.ui.groups.SmokeTestCategory; +import com.owncloud.android.test.ui.groups.UnfinishedTestCategory; +import com.owncloud.android.test.ui.models.FileDetailsView; +import com.owncloud.android.test.ui.models.ElementMenuOptions; +import com.owncloud.android.test.ui.models.GmailEmailListView; +import com.owncloud.android.test.ui.models.GmailEmailView; +import com.owncloud.android.test.ui.models.ImageView; +import com.owncloud.android.test.ui.models.FileListView; +import com.owncloud.android.test.ui.models.NotificationView; +import com.owncloud.android.test.ui.models.SettingsView; +import com.owncloud.android.test.ui.models.UploadView; + + +@FixMethodOrder(MethodSorters.NAME_ASCENDING) +@Category({NoIgnoreTestCategory.class}) +public class UploadTestSuite{ + + AndroidDriver driver; + Common common; + String FILE_NAME = Config.fileToTestName; + String BIG_FILE_NAME = Config.bigFileToTestName; + String FILE_GMAIL_NAME = Config.fileToTestSendByEmailName; + private Boolean fileHasBeenUploadedFromGmail = false; + private Boolean fileHasBeenUploaded = false; + + @Rule public TestName name = new TestName(); + + + @Before + public void setUp() throws Exception { + common=new Common(); + driver=common.setUpCommonDriver(); + } + + @Test + @Category({NoIgnoreTestCategory.class, SmokeTestCategory.class}) + public void testUploadFile () throws Exception { + + FileListView fileListView = Actions.login(Config.URL, Config.user, + Config.password, Config.isTrusted, driver); + common.assertIsInFileListView(); + + //check if the file already exists and if true, delete it + Actions.deleteElement(FILE_NAME, fileListView, driver); + + FileListView fileListViewAfterUploadFile = Actions + .uploadFile(FILE_NAME, fileListView); + + fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME); + assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed()); + Common.waitTillElementIsNotPresentWithoutTimeout( + fileListViewAfterUploadFile.getProgressCircular(), 1000); + common.wait.until(ExpectedConditions.visibilityOf( + fileListViewAfterUploadFile.getFileElementLayout() + .findElement(By.id(FileListView.getLocalFileIndicator())))); + assertTrue(fileListViewAfterUploadFile.getFileElementLayout() + .findElement(By.id(FileListView.getLocalFileIndicator())) + .isDisplayed()); + fileListView = new FileListView(driver); + fileListView.scrollTillFindElement(FILE_NAME); + assertTrue( + fileHasBeenUploaded = fileListView.getFileElement().isDisplayed()); + } + + + + @Test + @Category({UnfinishedTestCategory.class}) + public void testUploadBigFile () throws Exception { + + FileListView fileListView = Actions.login(Config.URL, Config.user, + Config.password, Config.isTrusted, driver); + common.assertIsInFileListView(); + + //check if the file already exists and if true, delete it + Actions.deleteElement(BIG_FILE_NAME, fileListView, driver); + + FileListView fileListViewAfterUploadFile = Actions + .uploadFile(BIG_FILE_NAME, fileListView); + + + driver.openNotifications(); + NotificationView notificationView = new NotificationView(driver); + + try{ + if(notificationView.getUploadingNotification().isDisplayed()){ + Common.waitTillElementIsPresent( + notificationView.getUploadSucceededNotification(),300000); + driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME); + driver.startActivity("com.owncloud.android", + ".ui.activity.FileDisplayActivity"); + + } + } catch (NoSuchElementException e) { + driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_HOME); + driver.startActivity("com.owncloud.android", + ".ui.activity.FileDisplayActivity"); + } + + fileListViewAfterUploadFile.scrollTillFindElement(BIG_FILE_NAME); + + assertTrue(fileListViewAfterUploadFile.getFileElement().isDisplayed()); + + Common.waitTillElementIsNotPresentWithoutTimeout( + fileListViewAfterUploadFile.getProgressCircular(), 1000); + common.wait.until(ExpectedConditions.visibilityOf( + fileListViewAfterUploadFile.getFileElementLayout() + .findElement(By.id(FileListView.getLocalFileIndicator())))); + assertTrue(fileListViewAfterUploadFile.getFileElementLayout() + .findElement(By.id(FileListView.getLocalFileIndicator())) + .isDisplayed()); + fileListView = new FileListView(driver); + fileListView.scrollTillFindElement(BIG_FILE_NAME); + assertTrue( + fileHasBeenUploaded = fileListView.getFileElement().isDisplayed()); + } + + + @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"); + GmailEmailListView gmailEmailListView = new GmailEmailListView(driver); + Thread.sleep(3000); + GmailEmailView gmailEmailView = gmailEmailListView.clickOnEmail(); + ImageView imageView = gmailEmailView.clickOnfileButton(); + imageView.clickOnOptionsButton(); + imageView.clickOnShareButton(); + imageView.clickOnOwnCloudButton(); + //justonce button do not appear always + try{ + imageView.clickOnJustOnceButton(); + }catch (NoSuchElementException e) { + } + 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()); + fileListView = new FileListView(driver); + fileListView.scrollTillFindElement(FILE_GMAIL_NAME); + assertTrue(fileHasBeenUploadedFromGmail = fileListView + .getFileElement().isDisplayed()); + //TODO. correct assert if fileListView is shown in grid mode + } + + + @Test + @Category({FailingTestCategory.class}) + public void testKeepFileUpToDate () throws Exception { + + FileListView fileListView = Actions.login(Config.URL, Config.user, + Config.password, Config.isTrusted, driver); + common.assertIsInFileListView(); + + Common.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(), + 1000); + + FileListView fileListViewAfterUploadFile = Actions + .uploadFile(FILE_NAME, fileListView); + fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME); + assertTrue(fileHasBeenUploaded = fileListViewAfterUploadFile + .getFileElement().isDisplayed()); + + ElementMenuOptions menuOptions = fileListViewAfterUploadFile + .longPressOnElement(FILE_NAME); + FileDetailsView fileDetailsView = menuOptions.clickOnDetails(); + fileDetailsView.checkKeepFileUpToDateCheckbox(); + Thread.sleep(3000); + driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_BACK); + assertTrue(common.isElementPresent( + fileListViewAfterUploadFile.getFileElementLayout(), + MobileBy.id(FileListView.getFavoriteFileIndicator()))); + assertTrue(fileListViewAfterUploadFile.getFileElementLayout() + .findElement(By.id(FileListView.getFavoriteFileIndicator())) + .isDisplayed()); + } + + @Test + @Category({NoIgnoreTestCategory.class}) + public void testKeepFileUpToDateAndRefresh () throws Exception { + + FileListView fileListView = Actions.login(Config.URL, Config.user, + Config.password, Config.isTrusted, driver); + common.assertIsInFileListView(); + + Common.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(), + 1000); + + FileListView fileListViewAfterUploadFile = Actions + .uploadFile(FILE_NAME, fileListView); + fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME); + assertTrue(fileHasBeenUploaded = fileListViewAfterUploadFile + .getFileElement().isDisplayed()); + + ElementMenuOptions menuOptions = fileListViewAfterUploadFile + .longPressOnElement(FILE_NAME); + FileDetailsView fileDetailsView = menuOptions.clickOnDetails(); + fileDetailsView.checkKeepFileUpToDateCheckbox(); + Thread.sleep(3000); + driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_BACK); + + fileListViewAfterUploadFile.pulldownToRefresh(); + //assertTrue(fileListView.getProgressCircular().isDisplayed()); + Common.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(), + 100); + + assertTrue(common.isElementPresent( + fileListViewAfterUploadFile.getFileElementLayout(), + MobileBy.id(FileListView.getFavoriteFileIndicator()))); + assertTrue(fileListViewAfterUploadFile.getFileElementLayout() + .findElement(By.id(FileListView.getFavoriteFileIndicator())) + .isDisplayed()); + } + + + @After + public void tearDown() throws Exception { + common.takeScreenShotOnFailed(name.getMethodName()); + FileListView fileListView = new FileListView(driver); + if (fileHasBeenUploadedFromGmail) { + Actions.deleteElement(FILE_GMAIL_NAME,fileListView, driver); + } + if(fileHasBeenUploaded){ + Actions.deleteElement(FILE_NAME,fileListView, driver); + Actions.deleteElement(BIG_FILE_NAME,fileListView, driver); + } + + //driver.removeApp("com.owncloud.android"); + driver.quit(); + } + + +} + diff --git a/automationTest/src/test/resources/.gitignore b/automationTest/src/test/resources/.gitignore new file mode 100644 index 00000000..86d0cb27 --- /dev/null +++ b/automationTest/src/test/resources/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/res/layout/file_details_empty.xml b/res/layout/file_details_empty.xml index 5d16b072..d2429544 100644 --- a/res/layout/file_details_empty.xml +++ b/res/layout/file_details_empty.xml @@ -21,7 +21,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="#F7F7F7" - android:orientation="vertical" > + android:orientation="vertical"> + android:orientation="horizontal" + android:id="@+id/ListLayout" + android:contentDescription="@string/list_layout" + > - \ No newline at end of file + diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml index 50a9c3d7..7e92694e 100644 --- a/res/values-ca/strings.xml +++ b/res/values-ca/strings.xml @@ -23,6 +23,7 @@ Més Comptes Gestió de comptes + Contrasenya Pujada instantànies de fotografies Puja instantàniament les fotografies preses amb la càmera Pujades de vídeos instantanies diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml index 12262e09..d80e6764 100644 --- a/res/values-da/strings.xml +++ b/res/values-da/strings.xml @@ -23,6 +23,7 @@ Mere Konti Administrér konti + Passcode-lås Upload billeder straks Upload straks billeder taget med kameraet Upload videoer straks @@ -74,6 +75,7 @@ Hent Genopfrisk fil Filen blev omdøbt til %1$s under upload + Listevisning Del link Ophæv deling Ja @@ -126,6 +128,15 @@ Lokal: %1$s Fjernplacering: %1$s Der er ikke plads nok til at kopiere de valgte filer ind i mappen %1$s. Vil du flytte dem i stedet? + Indsæt venligst din passcode + Angiv din passcode + Denne passcode vil blive forespurgt hver gang app\'en startes + Angiv venligst din passcode påny + Fjern din passcode + Passcode\'erne er ikke ens + Ukorrekt passcode + Passcode blev fjernet + Passcode blev gendannet %1$s musikafspiller %1$s (afspiller) %1$s (indlæser) @@ -295,4 +306,5 @@ %1$s delt \"%2$s\" med dig Genopfrisk forbindelsen Serveradresse + Ikke tilstrækkelig hukommelse diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml index 3b810e60..a6ddb981 100644 --- a/res/values-el/strings.xml +++ b/res/values-el/strings.xml @@ -75,6 +75,7 @@ Λήψη Ανανέωση αρχείου Το αρχείο μετονομάστηκε σε %1$s κατά τη μεταφόρτωση + Διάταξη Λίστας Διαμοιρασμός συνδέσμου Ακύρωση διαμοιρασμού συνδέσμου Ναι diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml index f7f155c6..582cf705 100644 --- a/res/values-en-rGB/strings.xml +++ b/res/values-en-rGB/strings.xml @@ -306,4 +306,5 @@ %1$s shared \"%2$s\" with you Refresh connection Server address + Not enough memory diff --git a/res/values-eo/strings.xml b/res/values-eo/strings.xml index fd7b2e6e..c4c7bb50 100644 --- a/res/values-eo/strings.xml +++ b/res/values-eo/strings.xml @@ -37,6 +37,7 @@ Alŝutante sekundoj antaŭe Nenio estas ĉi tie. Alŝutu ion! + Ŝargante... dosierujo dosierujoj dosiero @@ -174,6 +175,8 @@ Antaŭvido de bildo Ĉi tiu bildo ne povas montriĝi %1$s ne povis kopiiĝi al la loka dosierujo %2$s + Enigu pasvorton + Vi devas enigi pasvorton Sendi Kopii ligilon Kopiita en la tondejon @@ -182,7 +185,9 @@ Kontoj Aŭtentiĝo nepras Malĝusta pasvorto + Movi Elekti + La dosiero jam ekzistas en la cela dosierujo Sekuro Servila adreso diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index de0703da..0b2d15bc 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -75,6 +75,7 @@ Descargar Actualizar archivo El fichero fue renombrado como %1$s durante la subida + Diseño de lista Compartir con enlace Dejar de compartir Sí diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index 91c83ea8..3f406659 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -76,6 +76,7 @@ Téléchargez-le ici : %2$s Télécharger Actualiser le fichier Le fichier a été renommé en %s pendant le téléversement + Disposition en liste Partager le lien Ne plus partager ce lien Oui @@ -134,7 +135,7 @@ Ci-dessous la liste des fichiers locaux, et les fichiers distants dans %5$s auxq Il n\'y a pas assez de place disponible pour copier les fichiers sélectionnés dans le dossier %1$s. Voulez-vous les déplacer à la place ? Veuillez saisir votre code de sécurité Saisissez votre code de sécurité - Le code de sécurité sera demandé à chaque démarrage de l\'application + Le code de sécurité sera demandé à chaque ouverture de l\'application Veuillez à nouveau saisir votre code de sécurité Supprimer votre code de sécurité Les codes de sécurité ne sont pas identiques diff --git a/res/values-gl/strings.xml b/res/values-gl/strings.xml index 2e8f23a0..4788d926 100644 --- a/res/values-gl/strings.xml +++ b/res/values-gl/strings.xml @@ -76,6 +76,7 @@ Descárgueo de aquí: %2$s Descargar Actualizar o ficheiro O ficheiro foi renomeado a %1$s durante o envío + Deseño da lista Ligazón para compartir Deixar de compartir a ligazón Si @@ -150,7 +151,7 @@ Descárgueo de aquí: %2$s Esgotouse o tempo de espera tentando reproducir Non é posíbel enviar como fluxo o ficheiro multimedia Non é posíbel reproducir o ficheiro multimedia co reprodutor «stock» - Produciuse un erro de seguranza tentando reproducir %1$s + Produciuse un erro de seguridade tentando reproducir %1$s Produciuse un erro de entrada tentando reproducir %1$s Produciuse un erro non agardado tentando reproducir %1$s Botón de retroceso @@ -301,7 +302,7 @@ Descárgueo de aquí: %2$s Produciuse un erro ao tentar mover este ficheiro ou cartafol. para mover este ficheiro Envío instantáneo - Seguranza + Seguridade Enviar a ruta do vídeo Non foi posíbel completar a descarga do cartafol %1$s %1$s compartiu «%2$s» con vostede diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index 51d8ef0f..574a16de 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -75,6 +75,7 @@ Scarica Aggiorna file Il file è stato rinominato in %1$s durante il caricamento + Struttura elenco Condividi collegamento Rimuovi condivisione collegamento Sì diff --git a/res/values-nb-rNO/strings.xml b/res/values-nb-rNO/strings.xml index b8144867..073d5eda 100644 --- a/res/values-nb-rNO/strings.xml +++ b/res/values-nb-rNO/strings.xml @@ -75,6 +75,7 @@ Last ned Oppdater fil Filnavnet ble endret til %1$s under opplasting + Listeoppsett Del lenke Avslutt deling av lenke Ja diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml index 0ab33ba1..c303b870 100644 --- a/res/values-nl/strings.xml +++ b/res/values-nl/strings.xml @@ -76,6 +76,7 @@ Download hier: %2$s Download Bestand verversen Bestand is tijdens het uploaden hernoemd naar %1$s + Lijst layout Deel link Link niet meer delen Ja diff --git a/res/values-oc/strings.xml b/res/values-oc/strings.xml index e71a5829..3cb400cc 100644 --- a/res/values-oc/strings.xml +++ b/res/values-oc/strings.xml @@ -2,7 +2,9 @@ Amontcarga Fichièrs + Novèl dorsièr Configuracion + Mandar General @@ -10,11 +12,13 @@ Comptes Maneja comptes Ajuda + Mencions legalas Nom d\'usancièr Senhal Fichièrs Connecta Amontcarga + Novèl dorsièr Cap de compte trobat Configuracion Quita @@ -30,22 +34,32 @@ Creat : Modificat : Avalcarga + Partiment per ligam Òc Non D\'accòrdi Anulla l\'amontcargar Annula Error + Error Desconeguda A prepaus Cambia lo senhal Escafa lo compte Crea un compte Avalcarga dempuèi ... + Nom del dorsièr Al avalcargar ... Capitada d\'avalcargar Causís lo compte Torna nomenar + Suprimir + País : + Mandar + Copiat dins lo quichapapièrs Comptes + Autentificacion requesida + Senhal incorrècte Causís + Adreça del servidor diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml index 9777f58a..59723ade 100644 --- a/res/values-pl/strings.xml +++ b/res/values-pl/strings.xml @@ -23,6 +23,7 @@ Więcej Konta Zarządzaj kontami + Blokowanie hasła natychmiastowa wysyłka obrazków Wysyłaj od razu zdjęcia zrobione aparatem Natychmiastowa wysyłka wideo @@ -74,6 +75,7 @@ Pobierz Odśwież plik Podczas wysyłania nazwa pliku została zmieniona na %1$s + Lista szablonów wyglądu Udostępnij link Anuluj udostępnianie Tak @@ -126,6 +128,15 @@ Lokalnie: %1$s Zdalnie: %1$s Nie ma wystarczająco miejśca, aby skopiować zaznaczone pliki do folderu %1$s. Chciałbyś je przenieść? + Proszę podać swoje hasło + Wpisz swoje hasło + Hasło będzie wymagane przy każdym uruchomieniu aplikacji + Proszę powtórzyć hasło + Usuń swoje hasło + Podane hasła nie są takie same + Nieprawidłowe hasło + Hasło zostało usunięte + Hasło zostało zapisane %1$s odtwarzacz muzyki %1$s (odtwarzany) %1$s (wczytywany) @@ -201,6 +212,7 @@ Nieoczekiwany problem; spróbuj wybrać plik z innej aplikacji Nie wybrano żadnych plików Wyślij link do ... + Kopiowanie pliku z prywatnego zasobu Loguj przez oAuth2 Łączenie z serwerem oAuth2... Nie można zweryfikować tożsamości strony @@ -295,4 +307,5 @@ %1$s wspólne \"%2$s\" z tobą Odśwież połączenie Adres Serwera + Brak wystarczającej pamięci diff --git a/res/values-pt-rBR/strings.xml b/res/values-pt-rBR/strings.xml index 7d7e96ba..a2fe6bc8 100644 --- a/res/values-pt-rBR/strings.xml +++ b/res/values-pt-rBR/strings.xml @@ -75,6 +75,7 @@ Baixar Atualizar arquivo Arquivo foi renomeado para %1$s durante o envio + Lista de Layout Compartilhar link Descompartilhar o link Sim diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index 04693af1..70d2e4b6 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -202,6 +202,7 @@ Неизвестная ошибка; выберите этот файл из другого приложения Файлы не выбраны Отправить ссылку ... + Копирование файла из частной хранилища Войти через oAuth2 Подключение к серверу oAuth2... Подлинность сайта не может быть проверена @@ -296,4 +297,5 @@ %1$s предоставил вам доступ к \"%2$s\" Обновить соединение Адрес сервера + Недостаточно памяти diff --git a/res/values-sk-rSK/strings.xml b/res/values-sk-rSK/strings.xml index e51cb89b..0f51dcdb 100644 --- a/res/values-sk-rSK/strings.xml +++ b/res/values-sk-rSK/strings.xml @@ -150,6 +150,7 @@ Bez sieťového pripojenia Nie je k dispozícii bezpečné pripojenie Pripojenie vytvorené + Testuje sa pripojenie Nesprávna konfigurácia servera Účet pre tohoto používateľa a tento server už v tomto zariadení existuje Zadané prihlasovacie údaje používateľa sú nesprávne diff --git a/res/values-sl/strings.xml b/res/values-sl/strings.xml index 18e394d7..988723e1 100644 --- a/res/values-sl/strings.xml +++ b/res/values-sl/strings.xml @@ -23,6 +23,7 @@ Več Računi Upravljanje z računi + Zaklep s kodo PIN Takojšnje pošiljanje slik Takojšnje pošiljanje slik, zajetih s fotoaparatom, na strežnik Takojšnje pošiljanje posnetkov @@ -74,6 +75,7 @@ Prejmi Osveži datoteko Datoteka je bila med nalaganjem preimenovana v %1$s + Postavitev seznama Povezava za souporabo Odstrani možnost souporabe Da @@ -126,6 +128,15 @@ Krajevno: %1$s Oddaljeno: %1$s Ni dovolj prostora za kopiranje izbranih datotek v mapo %1$s. Ali jih želite premakniti? + Vnesite kodo PIN programa + Vnesite kodo PIN programa + Koda bo zahtevana vsakič pred zagonom programa. + Ponovno vnesite kodo + Odstrani kodo PIN programa + Vpisani kodi PIN nista enaki + Napačna koda PIN + Koda PIN je odstranjena + Koda PIN je shranjena Predvajalnik glasbe %1$s %1$s (se predvaja) %1$s (se nalaga) @@ -201,6 +212,7 @@ Prišlo je do nepričakovane napake. Poskusite datoteko izbrati z drugim programom. Ni izbranih datotek Pošlji povezavo ... + Kopiranje datoteke iz zasebne shrambe Prijava z oAuth2 Poteka povezovanje s strežnikom oAuth2 ... Istovetnosti strani ni mogoče preveriti @@ -235,7 +247,7 @@ 12:23:45 Pošiljaj slike le preko povezav Wi-Fi Pošlji posnetke le preko povezave Wi-Fi - /TakojšnjePošiljanje + /Poslano Posodobi podatke spora Oddaljena datoteka %s ni usklajena s krajevno. Z nadaljevanem bo datoteka na strežniku zamenjana s krajevno. Ohrani obe @@ -295,4 +307,5 @@ Uporabnik %1$s je omogočil souporabo \"%2$s\". Osveži povezavo Naslov strežnika + Ni dovolj pomnilnika diff --git a/res/values-sr/strings.xml b/res/values-sr/strings.xml index d7cd3751..72c39558 100644 --- a/res/values-sr/strings.xml +++ b/res/values-sr/strings.xml @@ -75,6 +75,7 @@ Преузми Освежи фајл Фајл је преименован у %1$s током отпремања + Распоред листе Веза дељења Не дели везом Да @@ -306,4 +307,5 @@ %1$s подели „%2$s“ са вама Освежи везу Адреса сервера + Нема довољно меморије diff --git a/res/values-th-rTH/strings.xml b/res/values-th-rTH/strings.xml index a5f8e5ab..847179b1 100644 --- a/res/values-th-rTH/strings.xml +++ b/res/values-th-rTH/strings.xml @@ -1,35 +1,68 @@ + %1$s แอพฯ แอนดรอยด์ + รุ่น %1$s + ฟื้นฟูบัญชี อัพโหลดไฟล์ - เนื้อหาจากแอปฯอื่นๆ + เนื้อหาจากแอพฯ อื่นๆ ไฟล์ + เปิดด้วย โฟลเดอร์ใหม่ ตั้งค่า รายละเอียด ส่ง + จัดเรียง + เรียงตาม + + A-Z + ใหม่ที่สุด - เก่าที่สุด + ทั่วไป - มาก + เพิ่มเติม บัญชี บริหารจัดการบัญชี + ล็อค Passcodes + อัพโหลดรูปภาพทันที + อัพโหลดรูปภาพที่ถ่ายโดยกล้องทันที + อัพโหลดวิดีโอทันที + อัพโหลดวิดีโอที่บันทึกโดยกล้องทันที + เปิดใช้งานการบันทึกข้อมูล + นี้จะใช้เพื่อบันทึกปัญหาที่เกิดขึ้น + ประวัติการบันทึกข้อมูล + สิ่งนี้จะแสดงข้อมูลที่ถูกบันทึกไว้ + ลบประวัติ ช่วยเหลือ + แนะนำให้เพื่อน + ข้อเสนอแนะ + ประทับ + จดจำตำแหน่งที่ใช้ร่วมกัน + จดจำตำแหน่งล่าสุดที่ใช้ร่วมกัน + ลองใช้ %1$s บนสมาร์ทโฟนของคุณ! + ฉันอยากจะขอเชิญให้คุณใช้ %1$s บนสมาร์ทโฟนของคุณ!\nดาวน์โหลดที่นี่: %2$s + ตรวจสอบเซิร์ฟเวอร์ + ที่อยู่ของเซิร์ฟเวอร์ https://… ชื่อผู้ใช้ รหัสผ่าน + ใหม่จนถึง %1$s? ไฟล์ เชื่อมต่อ อัพโหลด โฟลเดอร์ใหม่ + เลือกโฟลเดอร์ที่ต้องการอัพโหลด: ไม่พบบัญชีที่ต้องการ ไม่มีบัญชี %1$s บนอุปกรณ์ของคุณ กรุณาตั้งค่าบัญชีของคุณก่อน ตั้งค่า ออก - ยังไม่มีเนื้อหาให้ต้องอัพโหลด - ยังไม่ได้รับเนื้อหา ไม่มีอะไรให้ต้องอัพโหลด - %1$s ไม่อนุญาตให้เข้าถึงเนื้อหาที่ถูกแชร์ไว้ + ยังไม่มีเนื้อหาที่ถูกอัปโหลด + ยังไม่ได้รับเนื้อหา ยังไม่มีการอัพโหลดใดๆ + %1$s ไม่ได้รับอนุญาตให้เข้าถึงเนื้อหาที่ถูกแชร์ไว้ กำลังอัพโหลด วินาที ก่อนหน้านี้ - ยังไม่มีไฟล์ใดๆอยู่ที่นี่ กรุณาอัพโหลดไฟล์! + ยังไม่มีไฟล์ใดๆเลย ลองอัปโหลดดูสิ! + กำลังโหลด ... + ยังไม่มีไฟล์ในโฟลเดอร์นี้ โฟลเดอร์ โฟลเดอร์ ไฟล์ @@ -40,7 +73,10 @@ สร้างเมื่อ: แก้ไขเมื่อ: ดาวน์โหลด + ฟื้นฟูไฟล์ ไฟล์ได้ถูกเปลี่ยนชื่อเป็น %1$s ในระหว่างการอัพโหลด + แชร์ลิงค์ + ยกเลิกการแชร์ลิงค์ ตกลง ไม่ตกลง ตกลง @@ -49,70 +85,135 @@ ยกเลิก บันทึก & ออก ข้อผิดพลาด + กำลังโหลด ... ข้อผิดพลาดที่ไม่ทราบสาเหตุ เกี่ยวกับเรา เปลี่ยนรหัสผ่าน ลบบัญชี สร้างบัญชีใหม่ - อัพโหลดไฟล์จาก... + อัพโหลดไฟล์จาก ... ชื่อโฟลเดอร์ - กำลังอัพโหลด... + กำลังอัพโหลด ... %1$d%% กำลังอัพโหลด %2$s อัพโหลดเสร็จสิ้น %1$s ได้ถูกอัพโหลดเรียบร้อยแล้ว อัพโหลดล้มเหลว - การอัพโหลด %1$s ไม่สามารถดำเนินการให้เสร็จสมบูรณ์ได้ + ไม่สามารถดำเนินการอัพโหลด %1$s ให้เสร็จสมบูรณ์ได้ + อัพโหลดล้มเหลวคุณจะต้องเข้าสู่ระบบใหม่ กำลังดาวน์โหลด ... %1$d%% กำลังดาวน์โหลด %2$s ดาวน์โหลดเสร็จสิ้น %1$s ถูกดาวน์โหลดเรียบร้อยแล้ว ดาวน์โหลดล้มเหลว การดาวน์โหลด %1$s ไม่สามารถดำเนินการให้เสร็จสมบูรณ์ได้ + ยังดาวน์โหลดไม่ได้ + การดาวน์โหลดล้มเหลวคุณจะต้องเข้าสู่ระบบใหม่ เลือกบัญชี การเชื่อมผสานข้อมูลล้มเหลว + การเชื่อมผสานข้อมูลล้มเหลว คุณจะต้องเข้าสู่ระบบใหม่ การเชื่อมผสานข้อมูลของ %1$s ไม่สามารถดำเนินการให้เสร็จสมบูรณ์ได้ + รหัสผ่านไม่ถูกต้องสำหรับ %1$s ตรวจพบความขัดแย้ง - %1$d ไฟล์ kept-in-sync ไม่สามารถผสานเชื่อมข้อมูลได้ + %1$d ไฟล์ kept-in-sync ไม่สามารถเชื่อมผสานข้อมูลได้ ไฟล์ Kept-in-sync ล้มเหลว เนื้อหาของไฟล์ %1$d ไม่สามารถผสานเชื่อมข้อมูลได้ (ความขัดแย้ง %2$d รายการ) - มีบางแฟ้มข้อมูลในเครื่องถูกลืม + มีแฟ้มข้อมูลต้นทางบางแฟ้มถูกลืม + ไม่สามารถคัดลอกไฟล์ %1$d ไปยังโฟลเดอร์ %2$s + ขณะที่รุ่น 1.3.16 ไฟล์ที่อัปโหลดจากเครื่องของคุณจะถูกคัดลอกไปสำรองไว้ที่ต้นทาง %1$s เพื่อป้องกันการสูญเสียข้อมูลเมื่อไฟล์เดียวถูกซิงค์กับบัญชีหลายบัญชี \n\n การเปลี่ยนแปลงนี้ไฟล์ทั้งหมดที่อัปโหลดในรุ่นก่อนหน้า ของ app นี้ถูกคัดลอกลงในโฟลเดอร์ %2$s แต่ก็อาจมีข้อผิดพลาดในการดำเนินการนี้ช่วงระหว่างการประสานบัญชี คุณอาจจะสูญเสียข้อมูล เช่นเดียวกับการลบ หรือย้ายไฟล์และเชื่อมโยงไปยัง %3$s ส่วนโฟลเดอร์ %1$s จะถูกเชื่อมโยงไปยัง %4$s \n\n รายชื่อด้านล่าง เป็นแฟ้มต้นทาง และแฟ้มปลายทาง ใน %5$s มันจะถูกนำมาเชื่อมโยงกัน + โฟลเดอร์ %1$s หายไปแล้ว ย้ายทั้งหมด ทุกแฟ้มข้อมูลถูกย้ายเรียบร้อยแล้ว มีบางแฟ้มข้อมูลไม่สามารถย้ายได้ ต้นทาง: %1$s ปลายทาง: %1$s + พื้นที่ใน %1$s ไม่เพียงพอต่อการย้ายไฟล์ คุณต้องการที่จะย้ายไปที่อื่นแทน? + กรุณาใส่ Passcodes ของคุณ + ใส่ Passcodes ของคุณ + จะมีการร้องขอ Passcodes ทุกครั้งเมื่อเริ่มต้นใช้แอพฯ + กรุณาป้อน Passcodes ของคุณอีกครั้ง + ลบ Passcodes ของคุณ + Passcodes ของคุณไม่ตรงกัน + Passcode ไม่ถูกต้อง + ลบ Passcode + Passcode ที่เก็บไว้ + เล่นเพลง %1$s + %1$s (กำลังเล่น) + %1$s (กำลังโหลด) + %1$s เล่นเสร็จแล้ว + ไม่พบไฟล์สื่อ + ไม่มีบัญชีที่ระบุ + ไฟล์ไม่ได้อยู่ในบัญชีที่ถูกต้อง + สื่อไม่สนับสนุนตัวแปลงสัญญาณ + ไม่สามารถอ่านไฟล์สื่อ + เข้ารหัสไฟล์สื่อไม่ถูกต้อง + หมดเวลาในขณะที่พยายามจะเล่น + ไฟล์สื่อไม่สามารถสตรีม + เล่นไฟล์สื่อกับเครื่องเล่นสื่อไม่ได้ + เกิดข้อผิดพลาดเรื่องความปลอดภัยขณะพยายามที่จะเล่น %1$s + ป้อนข้อมูลผิดพลาดขณะพยายามที่จะเล่น %1$s + เกิดข้อผิดพลาดขณะพยายามที่จะเล่น %1$s + ปุ่มย้อนกลับ + เล่นหรือกดปุ่มหยุดชั่วคราว + ปุ่มเลื่อนไปข้างหน้า + ได้รับการอนุมัติ ... กำลังเข้าสู่ระบบ... ไม่มีการเชื่อมต่อเครือข่ายใดๆ - การเชื่อมต่อแบบรักษาความปลอดภัยไม่สามารถใช้งานได้ + การเชื่อมต่อแบบปลอดภัยไม่สามารถใช้งานได้ ติดตั้งการเชื่อมต่อแล้ว + การทดสอบการเชื่อมต่อ การกำหนดค่า Malformed เซิร์ฟเวอร์ - เกิดข้อผิดพลาดที่ไม่ทราบสาเหตุ! + บัญชีผู้ใช้และเซิร์ฟเวอร์เดียวกันมีอยู่แล้วในเครื่อง + ป้อนผู้ใช้ไม่ตรงกับบัญชีของผู้ใช้นี้ + เกิดข้อผิดพลาดโดยไม่ทราบสาเหตุ! ไม่พบโฮสต์ที่ต้องการ ไม่พบค่าตัวอย่างเซิร์ฟเวอร์ เซิร์ฟเวอร์ดังกล่าวใช้เวลาตอบสนองนานเกินไป Malformed URL การเตรียมใช้งาน SSL ล้มเหลว - รุ่นของเซิร์ฟเวอร์เซิร์ฟเวอร์ ไม่เป็นที่รู้จัก + ไม่สามารถตรวจสอบตัวตนของเซิร์ฟเวอร์ SSL + ไม่รู้จักรุ่นของเซิร์ฟเวอร์ ไม่สามารถเชื่อมต่อได้ - ดำเนินการติดตั้งการเชื่อมต่อแบบปลอดภัยเรียบร้อย + เชื่อมต่อแบบปลอดภัยเสร็จสมบูรณ์ + ชื่อผู้ใช้หรือรหัสผ่านไม่ถูกต้อง + ตรวจสอบสิทธิ์ไม่สำเร็จ + การเข้าถึงถูกปฏิเสธโดยเซิร์ฟเวอร์ตรวจสอบสิทธิ์ + เกิดข้อผิดพลาด โปรดป้อน URL เซิร์ฟเวอร์อีกครั้ง + สิทธิ์การเข้าถึงของคุณหมดอายุแล้ว กรุณาขอสิทธิ์ใหม่ + กรุณาใส่รหัสผ่านปัจจุบัน + เซสชันของคุณหมดอายุ โปรดเชื่อมต่ออีกครั้ง + กำลังเชื่อมต่อกับเซิร์ฟเวอร์เพื่อยืนยันตัวตน + เซิร์ฟเวอร์ไม่สนับสนุนการยืนยันตัวตนนี้ + %1$s ไม่สนับสนุนให้มีหลายบัญชี + เซิร์ฟเวอร์ของคุณไม่ได้ส่งคืนรหัสผู้ใช้ที่ถูกต้อง กรุณาติดต่อผู้ดูแลระบบ! + ไม่สามารถยืนยันตัวตนกับเซิร์ฟเวอร์นี้ + ยังไม่มีบัญชีในอุปกรณ์นี้ ปรับปรุงไฟล์ให้ทันสมัยอยู่เสมอ เปลี่ยนชื่อ ลบออก - เฉพาะเซิร์ฟเวอร์ภายในเท่านั้น - เนื้อหาที่อยู่ในเครื่องเท่านั้น + คุณต้องการที่จะลบ %1$s? + คุณต้องการที่จะลบ %1$s และเนื้อหาของมัน? + เฉพาะต้นทางเท่านั้น + เนื้อหาต้นทางเท่านั้น ลบออกจากเซิร์ฟเวอร์ - ทั้งเซิร์ฟเวอร์ระยะไกลและเซิร์ฟเวอร์ภายใน + ต้นทางและปลายทาง ลบเรียบร้อยแล้ว - การลบออกไม่สามารถดำเนินการได้อย่างเสร็จสมบูรณ์ + ไม่สามารถลบได้ กรอกชื่อใหม่ - ไฟล์คัดลอกภายในไม่สามารถเปลี่ยนชื่อได้, กรุณาเปลี่ยนเป็นชื่อใหม่ + ไฟล์ต้นทางที่คัดลอกไม่สามารถเปลี่ยนชื่อได้, กรุณาเปลี่ยนเป็นชื่อใหม่ ไม่สามารถเปลี่ยนชื่อได้ ไม่สามารถตรวจสอบไฟล์ระยะไกลได้ - เนื้อหาของไฟล์ถูกผสานข้อมูลอยู่แล้ว + เนื้อหาของไฟล์มีข้อมูลอยู่แล้ว + ไม่สามารถสร้างโฟลเดอร์ + ห้ามใช้ตัวอักษรดังนี้: / \\ < > : \" | ? * + ต้องใส่ชื่อไฟล์ กรุณารอสักครู่ - เกิดปัญหาที่ไม่คาดคิด ; กรุณาลองใช้งานแอปฯอื่นๆ เพื่อเลือกไฟล์ + มีปัญหาเกิดขึ้น กรุณาเลือกไฟล์งานแอพฯอื่นๆ ไม่มีไฟล์ที่ถูกเลือก - ไม่สามารถยืนยันความถูกต้องของตัวตนของเว็บไซต์ได้ + ส่งลิงค์ไปยัง ... + คัดลอกไฟล์จากพื้นที่จัดเก็บส่วนตัว + เข้าสู่ระบบด้วย oAuth2 + เชื่อมต่อกับเซิร์ฟเวอร์ oAuth2 ... + ไม่สามารถยืนยันตัวตนของเว็บไซต์ได้ - ใบรับรองความปลอดภัยของเซิร์ฟเวอร์ไม่น่าเชื่อถือ - ใบรับรองความปลอดภัยของเซิร์ฟเวอร์หมดอายุแล้ว - ใบรับรองความปลอดภัยของเซิร์ฟเวอร์ยังมีอายุน้อยอยู่ @@ -134,17 +235,74 @@ ถึง: ลายเซ็นต์: อัลกอริทึ่ม: - นี่เป็นตัวยึด + ไม่สามารถแสดงใบรับรอง + - ไม่มีข้อมูลเกี่ยวกับข้อผิดพลาด + นี่คือ placeholder + placeholder.txt + รูปภาพ PNG + 389 กิโลไบต์ + 2012/05/18 12:23 PM + 12:23:45 อัพโหลดรูปภาพผ่านทาง WiFi เท่านั้น + อัพโหลดวีดีโอผ่านทาง WiFi เท่านั้น /อัพโหลดทันที - ปรับปรุงปัญหาความขัดแย้ง - ไฟล์ระยะไกล %s ยังไม่ได้ถูกผสานข้อมูลกับไฟล์ในเครื่อง การดำเนินการต่อไปจะเป็นการแทนที่เนื้อหาของไฟล์ที่อยู่บนเซิร์ฟเวอร์ + ปรับปรุงข้อผิดพลาด + ไฟล์ระยะไกล %s ยังไม่ได้ผสานข้อมูลกับไฟล์ต้นทาง การดำเนินการต่อไปจะเป็นการแทนที่เนื้อหาของไฟล์ที่มีอยู่บนเซิร์ฟเวอร์ เก็บไว้ทั้งสองอย่าง เขียนทับ ไม่ต้องอัพโหลด + แสดงรูปภาพตัวอย่าง + ไม่สามารถแสดงรูปภาพนี้ได้ + %1$s ไม่สามารถคัดลอกไปยังโฟลเดอร์ %2$s ในเครื่อง + เส้นทางอัพโหลด + ขออภัยการแชร์ไม่ได้เปิดใช้งานบนเซิร์ฟเวอร์ของคุณ กรุณาติดต่อผู้ดูแลระบบ + ไม่สามารถแชร์ กรุณาตรวจสอบไฟล์ที่มีอยู่ + เกิดข้อผิดพลาดในขณะที่พยายามจะแชร์ไฟล์หรือโฟลเดอร์นี้ + ไม่สามารถยกเลิกการแชร์ กรุณาตรวจสอบไฟล์ที่มีอยู่ + เกิดข้อผิดพลาดในขณะที่จะยกเลิกการอชร์ไฟล์หรือโฟลเดอร์นี้ + ป้อนรหัสผ่าน + คุณจะต้องใส่รหัสผ่าน ส่ง + คัดลอกลิงค์ + คัดลอกไปยังคลิปบอร์ด + ข้อผิดพลาด: ไม่สามารถดำเนินการได้ + เกิดข้อผิดพลาดขณะกำลังเชื่อมต่อกับเซิร์ฟเวอร์ + เกิดข้อผิดพลาดขณะที่รอการดำเนินการจากเซิร์ฟเวอร์ + เกิดข้อผิดพลาดขณะที่รอการดำเนินการจากเซิร์ฟเวอร์ + การดำเนินการอาจยังไม่เสร็จสมบูรณ์ เซิร์ฟเวอร์ไม่สามารถใช้งานได้ + คุณไม่ได้รับสิทธิ์ %s + เพื่อเปลี่ยนชื่อไฟล์นี้ + เพื่อลบไฟล์นี้ + เพื่อแชร์ไฟล์นี้ + เพื่อเลิกแชร์ไฟล์นี้ + เพื่อสร้างไฟล์ + เพื่ออัพโหลดในโฟลเดอร์นี้ + ไฟล์ไม่พร้อมใช้งานบนเซิร์ฟเวอร์ บัญชี + เพิ่มบัญชี + การเชื่อมต่อที่ปลอดภัยถูกเปลี่ยนเส้นทางไปยังเส้นทางที่ไม่ปลอดภัย + บันทึก + ส่งประวัติ + ไม่พบการส่งบันทึกของแอพฯ ติดตั้งแอพฯเมล! + %1$s บันทึกแอพแอนดรอยด์ + กำลังโหลดข้อมูล ... + จำเป็นต้องยืนยันตัวตน + รหัสผ่านไม่ถูกต้อง + ย้าย + ไม่มีสิ่งใดในที่นี่ คุณสามารถสร้างโฟลเดอร์! เลือก + ไม่สามารถย้ายไฟล์ กรุณาตรวจสอบว่าไฟล์ยังคงอยู่ + มันเป็นไปไม่ได้ที่จะย้ายโฟลเดอร์ที่มีราก + มีไฟล์อยู่แล้วในโฟลเดอร์ปลายทาง + เกิดข้อผิดพลาดขณะพยายามที่จะย้ายไฟล์หรือโฟลเดอร์นี้ + เพื่อย้ายไฟล์นี้ + อัพโหลดทันที + ความปลอดภัย + อัพโหลดเส้นทางวิดีโอ + การดาวน์โหลดโฟลเดอร์ %1$s อาจไม่สำเร็จ + %1$s แชร์ \"%2$s\" กับคุณ + ฟื้นฟูการเชื่อมต่อ ที่อยู่เซิร์ฟเวอร์ + หน่วยความจำไม่พอ diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml index ab300a6a..b3ad7645 100644 --- a/res/values-tr/strings.xml +++ b/res/values-tr/strings.xml @@ -23,6 +23,7 @@ Daha fazla Hesaplar Hesapları Yönet + Parola kod kilidi Anında fotoğraf yüklemeleri Kamera ile çekilen fotoğrafları anında yükle Anında video yüklemeleri @@ -126,6 +127,15 @@ Yerel: %1$s Uzak: %1$s Seçilen dosyaları %1$s dizinine kopyalamak için yeterli alan yok. Bunun yerine dosyayı içine taşımak ister misiniz? + Lütfen parola kodu kilidini girin + Parola kodunuzu girin + Parola kodu uygulama her başlatıldığında sorulacaktır + Lütfen parola kodunuzu yeniden girin + Parola kodunuzu kaldırın + Parola kodları aynı değil + Hatalı parola kodu + Parola kodu kaldırıldı + Parola kodu depolandı %1$s müzik çalar %1$s (oynatılıyor) %1$s (yükleniyor) @@ -296,4 +306,5 @@ %1$s sizinle \"%2$s\" paylaşımını yaptı Bağlantıyı yenile Sunucu adresi + Yeterli hafıza yok diff --git a/res/values-tzl/strings.xml b/res/values-tzl/strings.xml new file mode 100644 index 00000000..69623e19 --- /dev/null +++ b/res/values-tzl/strings.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml index ee668d90..3059b49e 100644 --- a/res/values-uk/strings.xml +++ b/res/values-uk/strings.xml @@ -201,6 +201,7 @@ Несподівані проблеми ; будь ласка, спробуйте використати іншу програму для вибору файлу Не обрано файл Надіслати посилання... + Копіювання файлу з приватного сховища Увійти через oAuth2 Підключення до серверу oAuth2... Не вдалося перевірити ідентифікацію сайта diff --git a/res/values/strings.xml b/res/values/strings.xml index a4298087..7d180be4 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -86,6 +86,7 @@ Download Refresh file File was renamed to %1$s during upload + List Layout Share link Unshare link Yes