use of com.owncloud.android.test.ui.models.ShareView in project android by owncloud.
the class Actions method shareLinkElementByGmail.
public static AndroidElement shareLinkElementByGmail(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("Gmail", shareView.getListViewLayout(), driver).click();
GmailSendMailView gmailSendMailView = new GmailSendMailView(driver);
gmailSendMailView.typeToEmailAdress(Config.gmailAccount);
gmailSendMailView.clickOnSendButton();
Common.waitTillElementIsNotPresentWithoutTimeout(fileListView.getProgressCircular(), 1000);
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.ShareView 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()));
}
Aggregations