use of com.owncloud.android.test.ui.models.FileListView in project android by owncloud.
the class LoginTestSuite method test4ExistingAccountRotate.
@Test
@Category({ NoIgnoreTestCategory.class })
public void test4ExistingAccountRotate() throws Exception {
driver.rotate(ScreenOrientation.PORTRAIT);
FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
common.assertIsInFileListView();
driver.rotate(ScreenOrientation.LANDSCAPE);
MenuList menu = fileListView.clickOnMenuButton();
SettingsView settingsView = menu.clickOnSettingsButton();
settingsView.tapOnAddAccount(1, 1000);
LoginForm loginForm = new LoginForm(driver);
fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
assertTrue(common.waitForTextPresent("An account for the same user and" + " server already exists in the device", loginForm.getAuthStatusText()));
}
use of com.owncloud.android.test.ui.models.FileListView 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());
}
use of com.owncloud.android.test.ui.models.FileListView in project android by owncloud.
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();
}
use of com.owncloud.android.test.ui.models.FileListView 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());
}
use of com.owncloud.android.test.ui.models.FileListView in project android by nextcloud.
the class CreateFolderTestSuite method testCreateNewFolder.
@Test
@Category({ NoIgnoreTestCategory.class, SmokeTestCategory.class })
public void testCreateNewFolder() throws Exception {
String NEW_FOLDER_NAME = "testCreateFolder";
FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
common.assertIsInFileListView();
// check if the folder already exists and if true, delete them
Actions.deleteElement(NEW_FOLDER_NAME, fileListView, driver);
WaitAMomentPopUp waitAMomentPopUp = Actions.createFolder(NEW_FOLDER_NAME, fileListView);
Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
fileListView.scrollTillFindElement(FOLDER_NAME);
assertNotNull(fileListView.getFileElement());
assertTrue(folderHasBeenCreated = fileListView.getFileElement().isDisplayed());
CurrentCreatedFolder = FOLDER_NAME;
assertEquals(FOLDER_NAME, fileListView.getFileElement().getText());
}
Aggregations