use of com.owncloud.android.test.ui.models.ElementMenuOptions in project android by owncloud.
the class Actions method shareLinkElementByCopyLink.
public static AndroidElement shareLinkElementByCopyLink(String elementName, FileListView fileListView, AndroidDriver driver, Common common) throws Exception {
try {
//To open directly the "file list view" and
//we don't need to know in which view we are
driver.startActivity("com.owncloud.android", ".ui.activity.FileDisplayActivity");
ElementMenuOptions menuOptions = fileListView.longPressOnElement(elementName);
ShareView shareView = menuOptions.clickOnShareLinkElement();
Actions.scrollTillFindElement("Copy link", shareView.getListViewLayout(), driver).click();
WaitAMomentPopUp waitAMomentPopUp = new WaitAMomentPopUp(driver);
Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
common.wait.until(ExpectedConditions.visibilityOf(fileListView.getFileElementLayout().findElement(By.id(FileListView.getSharedElementIndicator()))));
} catch (NoSuchElementException e) {
return null;
}
return (AndroidElement) fileListView.getFileElementLayout().findElement(By.id(FileListView.getSharedElementIndicator()));
}
use of com.owncloud.android.test.ui.models.ElementMenuOptions in project android by owncloud.
the class Actions method unshareLinkElement.
public static void unshareLinkElement(String elementName, FileListView fileListView, AndroidDriver driver, Common common) throws Exception {
try {
//To open directly the "file list view" and
//we don't need to know in which view we are
driver.startActivity("com.owncloud.android", ".ui.activity.FileDisplayActivity");
ElementMenuOptions menuOptions = fileListView.longPressOnElement(elementName);
WaitAMomentPopUp waitAMomentPopUp = menuOptions.clickOnUnshareLinkElement();
Common.waitTillElementIsNotPresentWithoutTimeout(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
Common.waitTillElementIsNotPresent((AndroidElement) fileListView.getFileElementLayout().findElement(By.id(FileListView.getSharedElementIndicator())), 100);
} catch (NoSuchElementException e) {
}
}
use of com.owncloud.android.test.ui.models.ElementMenuOptions 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;
}
use of com.owncloud.android.test.ui.models.ElementMenuOptions in project android by owncloud.
the class UploadTestSuite method testKeepFileUpToDate.
@Test
@Category({ FailingTestCategory.class })
public void testKeepFileUpToDate() throws Exception {
FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
common.assertIsInFileListView();
Common.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(), 1000);
FileListView fileListViewAfterUploadFile = Actions.uploadFile(FILE_NAME, fileListView);
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
assertTrue(fileHasBeenUploaded = fileListViewAfterUploadFile.getFileElement().isDisplayed());
ElementMenuOptions menuOptions = fileListViewAfterUploadFile.longPressOnElement(FILE_NAME);
FileDetailsView fileDetailsView = menuOptions.clickOnDetails();
fileDetailsView.checkKeepFileUpToDateCheckbox();
Thread.sleep(3000);
driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_BACK);
assertTrue(common.isElementPresent(fileListViewAfterUploadFile.getFileElementLayout(), MobileBy.id(FileListView.getFavoriteFileIndicator())));
assertTrue(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getFavoriteFileIndicator())).isDisplayed());
}
use of com.owncloud.android.test.ui.models.ElementMenuOptions in project android by owncloud.
the class UploadTestSuite method testKeepFileUpToDateAndRefresh.
@Test
@Category({ NoIgnoreTestCategory.class })
public void testKeepFileUpToDateAndRefresh() throws Exception {
FileListView fileListView = Actions.login(Config.URL, Config.user, Config.password, Config.isTrusted, driver);
common.assertIsInFileListView();
Common.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(), 1000);
FileListView fileListViewAfterUploadFile = Actions.uploadFile(FILE_NAME, fileListView);
fileListViewAfterUploadFile.scrollTillFindElement(FILE_NAME);
assertTrue(fileHasBeenUploaded = fileListViewAfterUploadFile.getFileElement().isDisplayed());
ElementMenuOptions menuOptions = fileListViewAfterUploadFile.longPressOnElement(FILE_NAME);
FileDetailsView fileDetailsView = menuOptions.clickOnDetails();
fileDetailsView.checkKeepFileUpToDateCheckbox();
Thread.sleep(3000);
driver.sendKeyEvent(android.view.KeyEvent.KEYCODE_BACK);
fileListViewAfterUploadFile.pulldownToRefresh();
//assertTrue(fileListView.getProgressCircular().isDisplayed());
Common.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(), 100);
assertTrue(common.isElementPresent(fileListViewAfterUploadFile.getFileElementLayout(), MobileBy.id(FileListView.getFavoriteFileIndicator())));
assertTrue(fileListViewAfterUploadFile.getFileElementLayout().findElement(By.id(FileListView.getFavoriteFileIndicator())).isDisplayed());
}
Aggregations