Search in sources :

Example 11 with WaitAMomentPopUp

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

the class Actions method deleteElement.

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;
}
Also used : RemoveConfirmationView(com.owncloud.android.test.ui.models.RemoveConfirmationView) ElementMenuOptions(com.owncloud.android.test.ui.models.ElementMenuOptions) AndroidElement(io.appium.java_client.android.AndroidElement) WaitAMomentPopUp(com.owncloud.android.test.ui.models.WaitAMomentPopUp) NoSuchElementException(org.openqa.selenium.NoSuchElementException)

Example 12 with WaitAMomentPopUp

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

the class Actions method shareLinkElementByCopyLink.

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()));
}
Also used : ShareView(com.owncloud.android.test.ui.models.ShareView) ElementMenuOptions(com.owncloud.android.test.ui.models.ElementMenuOptions) AndroidElement(io.appium.java_client.android.AndroidElement) WaitAMomentPopUp(com.owncloud.android.test.ui.models.WaitAMomentPopUp) NoSuchElementException(org.openqa.selenium.NoSuchElementException)

Example 13 with WaitAMomentPopUp

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

the class Actions method unshareLinkElement.

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) {
    }
}
Also used : ElementMenuOptions(com.owncloud.android.test.ui.models.ElementMenuOptions) WaitAMomentPopUp(com.owncloud.android.test.ui.models.WaitAMomentPopUp) NoSuchElementException(org.openqa.selenium.NoSuchElementException)

Example 14 with WaitAMomentPopUp

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

the class RenameFileTestSuite method testRenameFile.

@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;
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) ElementMenuOptions(com.owncloud.android.test.ui.models.ElementMenuOptions) NewFolderPopUp(com.owncloud.android.test.ui.models.NewFolderPopUp) WaitAMomentPopUp(com.owncloud.android.test.ui.models.WaitAMomentPopUp) Category(org.junit.experimental.categories.Category) SmokeTestCategory(com.owncloud.android.test.ui.groups.SmokeTestCategory) NoIgnoreTestCategory(com.owncloud.android.test.ui.groups.NoIgnoreTestCategory) Test(org.junit.Test)

Example 15 with WaitAMomentPopUp

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

the class CreateFolderTestSuite method testCreateNewFolder.

@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());
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) WaitAMomentPopUp(com.owncloud.android.test.ui.models.WaitAMomentPopUp) Category(org.junit.experimental.categories.Category) SmokeTestCategory(com.owncloud.android.test.ui.groups.SmokeTestCategory) NoIgnoreTestCategory(com.owncloud.android.test.ui.groups.NoIgnoreTestCategory) Test(org.junit.Test)

Aggregations

WaitAMomentPopUp (com.owncloud.android.test.ui.models.WaitAMomentPopUp)20 ElementMenuOptions (com.owncloud.android.test.ui.models.ElementMenuOptions)14 NoIgnoreTestCategory (com.owncloud.android.test.ui.groups.NoIgnoreTestCategory)12 SmokeTestCategory (com.owncloud.android.test.ui.groups.SmokeTestCategory)12 FileListView (com.owncloud.android.test.ui.models.FileListView)12 Test (org.junit.Test)12 Category (org.junit.experimental.categories.Category)12 NewFolderPopUp (com.owncloud.android.test.ui.models.NewFolderPopUp)6 NoSuchElementException (org.openqa.selenium.NoSuchElementException)6 MoveView (com.owncloud.android.test.ui.models.MoveView)4 AndroidElement (io.appium.java_client.android.AndroidElement)4 RemoveConfirmationView (com.owncloud.android.test.ui.models.RemoveConfirmationView)2 ShareView (com.owncloud.android.test.ui.models.ShareView)2