Search in sources :

Example 1 with FileListView

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

the class Actions method uploadFile.

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

Example 2 with FileListView

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

the class PasscodeTestSuite method testPincodeEnable.

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

Example 3 with FileListView

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

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

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

the class RenameFileTestSuite method tearDown.

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

Example 5 with FileListView

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

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