Example usage for org.openqa.selenium.support.ui ExpectedConditions invisibilityOfAllElements

List of usage examples for org.openqa.selenium.support.ui ExpectedConditions invisibilityOfAllElements

Introduction

In this page you can find the example usage for org.openqa.selenium.support.ui ExpectedConditions invisibilityOfAllElements.

Prototype

public static ExpectedCondition<Boolean> invisibilityOfAllElements(final List<WebElement> elements) 

Source Link

Document

An expectation for checking all elements from given list to be invisible

Usage

From source file:ca.nrc.cadc.web.selenium.AbstractTestWebPage.java

License:Open Source License

protected void waitForElementInvisible(final WebElement webElement) throws Exception {
    final List<WebElement> elementList = new ArrayList<>();
    elementList.add(webElement);/*from w w w .j  a  va  2 s.  com*/

    assert (waitUntil(ExpectedConditions.invisibilityOfAllElements(elementList)));
}

From source file:com.liferay.faces.bridge.test.integration.issue.primefaces.FACES_3328PortletTester.java

License:Open Source License

@Test
public void testFACES_3328PortletTester() {

    String container = TestUtil.getContainer();
    Assume.assumeTrue("This is a SennaJS/SPA related test for Liferay 7.0+",
            (container.startsWith("liferay") && !container.equals("liferay62")));

    // Navigate the browser to the portal page that contains the FACES-1513-2185 portlet.
    BrowserDriver browserDriver = getBrowserDriver();
    browserDriver.navigateWindowTo(BridgeTestUtil.getIssuePageURL("faces-3328-start"));
    browserDriver.clickElement("//a[@href='" + BridgeTestUtil.getIssuePageURL("faces-3328") + "']");

    String datePickerButtonXpath = "//button[contains(@class, 'ui-datepicker-trigger')]";
    browserDriver.waitForElementEnabled(datePickerButtonXpath);
    browserDriver.clickElement(datePickerButtonXpath);

    String dateCellXpath = "//table[contains(@class, 'ui-datepicker-calendar')]//a[contains(text(), '14')]";
    browserDriver.waitForElementEnabled(dateCellXpath);
    browserDriver.clickElement(dateCellXpath);
    browserDriver.clickElement("//a[@href='" + BridgeTestUtil.getIssuePageURL("faces-3328-end") + "']");

    WaitingAsserter waitingAsserter = getWaitingAsserter();
    List<WebElement> elements = browserDriver
            .findElementsByXpath("//table[contains(@class, 'ui-datepicker-calendar')]");
    waitingAsserter.assertTrue(ExpectedConditions.invisibilityOfAllElements(elements));
    elements = browserDriver.findElementsByXpath("//*[contains(@id,'p_selectOneMenu')]");
    waitingAsserter.assertTrue(ExpectedConditions.invisibilityOfAllElements(elements));
}

From source file:com.technophobia.webdriver.substeps.impl.ActionWebDriverSubStepImplementations.java

License:Open Source License

/**
 * Waits until the current element is invisible, either visibility: hidden or display:none
 *
 * @example AssertCurrentElement is invisible
 * @section Assertions//from   w  w w .  j  a va 2  s . c om
 *
 */
@Step("AssertCurrentElement is invisible")
public void assertCurrentElementIsInVisible() {
    WebElement currentElement = webDriverContext().getCurrentElement();

    List<WebElement> elems = new ArrayList<>();
    elems.add(currentElement);
    waitUntil(ExpectedConditions.invisibilityOfAllElements(elems));

}

From source file:org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper.java

License:Open Source License

/**
 * Waits until each item from specified {@code elements} be invisible.
 *
 * @param elements web elements which should be checked
 *//* w ww.ja v a  2s. c o m*/
public void waitAllInvisibility(List<WebElement> elements) {
    webDriverWaitFactory.get(DEFAULT_TIMEOUT).until(ExpectedConditions.invisibilityOfAllElements(elements));
}

From source file:org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper.java

License:Open Source License

/**
 * Waits during {@code timeout} until each item from specified {@code elements} be invisible.
 *
 * @param elements web elements which should be checked
 * @param timeout waiting timeout in seconds
 *///w  w w  .  j  a va 2  s .c  o m
public void waitAllInvisibility(List<WebElement> elements, int timeout) {
    webDriverWaitFactory.get(timeout).until(ExpectedConditions.invisibilityOfAllElements(elements));
}

From source file:org.eclipse.che.selenium.pageobject.Wizard.java

License:Open Source License

/** wait for the archetype section in the import widget to be invisible */
public void waitInvisibilityOfAchetypeSection() {
    new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
            .until(ExpectedConditions.invisibilityOfAllElements(singletonList(fromArchetypeChkBox)));
    new WebDriverWait(seleniumWebDriver, REDRAW_UI_ELEMENTS_TIMEOUT_SEC)
            .until(ExpectedConditions.invisibilityOfAllElements(singletonList(archetypeDropDown)));
}