Search in sources :

Example 1 with ElementMenuOptions

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

the class Actions method shareLinkElementByGmail.

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

Example 2 with ElementMenuOptions

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

the class RenameFolderTestSuite method testRenameFolder.

@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());
}
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 3 with ElementMenuOptions

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

the class MoveFileTestSuite method testMoveFile.

@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());
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) ElementMenuOptions(com.owncloud.android.test.ui.models.ElementMenuOptions) MoveView(com.owncloud.android.test.ui.models.MoveView) 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 4 with ElementMenuOptions

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

the class MoveFolderTestSuite method testMoveFolder.

@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());
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) ElementMenuOptions(com.owncloud.android.test.ui.models.ElementMenuOptions) MoveView(com.owncloud.android.test.ui.models.MoveView) 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 5 with ElementMenuOptions

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

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)

Aggregations

ElementMenuOptions (com.owncloud.android.test.ui.models.ElementMenuOptions)20 WaitAMomentPopUp (com.owncloud.android.test.ui.models.WaitAMomentPopUp)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 NoSuchElementException (org.openqa.selenium.NoSuchElementException)8 AndroidElement (io.appium.java_client.android.AndroidElement)6 FailingTestCategory (com.owncloud.android.test.ui.groups.FailingTestCategory)4 InProgressCategory (com.owncloud.android.test.ui.groups.InProgressCategory)4 UnfinishedTestCategory (com.owncloud.android.test.ui.groups.UnfinishedTestCategory)4 FileDetailsView (com.owncloud.android.test.ui.models.FileDetailsView)4 MoveView (com.owncloud.android.test.ui.models.MoveView)4 NewFolderPopUp (com.owncloud.android.test.ui.models.NewFolderPopUp)4 ShareView (com.owncloud.android.test.ui.models.ShareView)4 GmailSendMailView (com.owncloud.android.test.ui.models.GmailSendMailView)2 RemoveConfirmationView (com.owncloud.android.test.ui.models.RemoveConfirmationView)2