Search in sources :

Example 1 with ShareView

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()));
}
Also used : ShareView(com.owncloud.android.test.ui.models.ShareView) ElementMenuOptions(com.owncloud.android.test.ui.models.ElementMenuOptions) GmailSendMailView(com.owncloud.android.test.ui.models.GmailSendMailView) AndroidElement(io.appium.java_client.android.AndroidElement) NoSuchElementException(org.openqa.selenium.NoSuchElementException)

Example 2 with ShareView

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()));
}
Also used : ShareView(com.owncloud.android.test.ui.models.ShareView) ElementMenuOptions(com.owncloud.android.test.ui.models.ElementMenuOptions) AndroidElement(io.appium.java_client.android.AndroidElement) WaitAMomentPopUp(com.owncloud.android.test.ui.models.WaitAMomentPopUp) NoSuchElementException(org.openqa.selenium.NoSuchElementException)

Aggregations

ElementMenuOptions (com.owncloud.android.test.ui.models.ElementMenuOptions)2 ShareView (com.owncloud.android.test.ui.models.ShareView)2 AndroidElement (io.appium.java_client.android.AndroidElement)2 NoSuchElementException (org.openqa.selenium.NoSuchElementException)2 GmailSendMailView (com.owncloud.android.test.ui.models.GmailSendMailView)1 WaitAMomentPopUp (com.owncloud.android.test.ui.models.WaitAMomentPopUp)1