Search in sources :

Example 1 with RemoveConfirmationView

use of com.owncloud.android.test.ui.models.RemoveConfirmationView in project android by owncloud.

the class Actions method deleteElement.

public static AndroidElement deleteElement(String elementName, FileListView fileListView, AndroidDriver driver) throws Exception {
    AndroidElement fileElement;
    WaitAMomentPopUp waitAMomentPopUp;
    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");
        fileElement = (AndroidElement) driver.findElementByName(elementName);
        ElementMenuOptions menuOptions = fileListView.longPressOnElement(elementName);
        RemoveConfirmationView removeConfirmationView = menuOptions.clickOnRemove();
        ;
        waitAMomentPopUp = removeConfirmationView.clickOnRemoteAndLocalButton();
        Common.waitTillElementIsNotPresent(waitAMomentPopUp.getWaitAMomentTextElement(), 100);
    } catch (NoSuchElementException e) {
        fileElement = null;
    }
    return fileElement;
}
Also used : RemoveConfirmationView(com.owncloud.android.test.ui.models.RemoveConfirmationView) 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)1 RemoveConfirmationView (com.owncloud.android.test.ui.models.RemoveConfirmationView)1 WaitAMomentPopUp (com.owncloud.android.test.ui.models.WaitAMomentPopUp)1 AndroidElement (io.appium.java_client.android.AndroidElement)1 NoSuchElementException (org.openqa.selenium.NoSuchElementException)1