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;
}
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();
}
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
}
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();
}
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());
}
Aggregations