Search in sources :

Example 56 with FileListView

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

the class MoveFolderTestSuite method tearDown.

@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();
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) After(org.junit.After)

Example 57 with FileListView

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

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 58 with FileListView

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

the class RefreshFolderTestSuite method testPulldownToRefreshFolder.

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

Example 59 with FileListView

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

the class RenameFolderTestSuite method tearDown.

@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();
}
Also used : FileListView(com.owncloud.android.test.ui.models.FileListView) After(org.junit.After)

Example 60 with FileListView

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

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)

Aggregations

FileListView (com.owncloud.android.test.ui.models.FileListView)64 Test (org.junit.Test)46 Category (org.junit.experimental.categories.Category)46 NoIgnoreTestCategory (com.owncloud.android.test.ui.groups.NoIgnoreTestCategory)34 SmokeTestCategory (com.owncloud.android.test.ui.groups.SmokeTestCategory)32 InProgressCategory (com.owncloud.android.test.ui.groups.InProgressCategory)16 After (org.junit.After)16 UnfinishedTestCategory (com.owncloud.android.test.ui.groups.UnfinishedTestCategory)12 ElementMenuOptions (com.owncloud.android.test.ui.models.ElementMenuOptions)12 MenuList (com.owncloud.android.test.ui.models.MenuList)12 SettingsView (com.owncloud.android.test.ui.models.SettingsView)12 WaitAMomentPopUp (com.owncloud.android.test.ui.models.WaitAMomentPopUp)12 FailingTestCategory (com.owncloud.android.test.ui.groups.FailingTestCategory)10 IgnoreTestCategory (com.owncloud.android.test.ui.groups.IgnoreTestCategory)6 LoginForm (com.owncloud.android.test.ui.models.LoginForm)6 AndroidElement (io.appium.java_client.android.AndroidElement)6 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 NoSuchElementException (org.openqa.selenium.NoSuchElementException)4