Search in sources :

Example 1 with NewFolderPopUp

use of com.owncloud.android.test.ui.models.NewFolderPopUp 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 2 with NewFolderPopUp

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

the class Actions method createFolder.

public static WaitAMomentPopUp createFolder(String folderName, FileListView fileListView) {
    NewFolderPopUp newFolderPopUp = fileListView.clickOnNewFolderButton();
    newFolderPopUp.typeNewFolderName(folderName);
    WaitAMomentPopUp waitAMomentPopUp = newFolderPopUp.clickOnNewFolderOkButton();
    //TODO. assert here
    return waitAMomentPopUp;
}
Also used : NewFolderPopUp(com.owncloud.android.test.ui.models.NewFolderPopUp) WaitAMomentPopUp(com.owncloud.android.test.ui.models.WaitAMomentPopUp)

Example 3 with NewFolderPopUp

use of com.owncloud.android.test.ui.models.NewFolderPopUp 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)

Aggregations

NewFolderPopUp (com.owncloud.android.test.ui.models.NewFolderPopUp)3 WaitAMomentPopUp (com.owncloud.android.test.ui.models.WaitAMomentPopUp)3 NoIgnoreTestCategory (com.owncloud.android.test.ui.groups.NoIgnoreTestCategory)2 SmokeTestCategory (com.owncloud.android.test.ui.groups.SmokeTestCategory)2 ElementMenuOptions (com.owncloud.android.test.ui.models.ElementMenuOptions)2 FileListView (com.owncloud.android.test.ui.models.FileListView)2 Test (org.junit.Test)2 Category (org.junit.experimental.categories.Category)2