Search in sources :

Example 81 with WebDriverWait

use of org.openqa.selenium.support.ui.WebDriverWait in project archiva by apache.

the class ArchivaAdminTest method testInitialRepositories.

@Test
public void testInitialRepositories() {
    WebDriverWait wait = new WebDriverWait(getWebDriver(), 20);
    WebElement el;
    el = wait.until(ExpectedConditions.elementToBeClickable(By.id("menu-repositories-list-a")));
    tryClick(el, ExpectedConditions.presenceOfElementLocated(By.xpath("//table[@id='managed-repositories-table']//td[contains(text(),'internal')]")), "Managed Repositories not activated");
    wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//table[@id='managed-repositories-table']//td[contains(text(),'snapshots')]")));
    el = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//a[@href='#remote-repositories-content']")));
    tryClick(el, ExpectedConditions.visibilityOfElementLocated(By.xpath("//table[@id='remote-repositories-table']//td[contains(text(),'central')]")), "Remote Repositories View not available");
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) WebElement(org.openqa.selenium.WebElement) AbstractArchivaTest(org.apache.archiva.web.test.parent.AbstractArchivaTest) Test(org.junit.Test)

Example 82 with WebDriverWait

use of org.openqa.selenium.support.ui.WebDriverWait in project archiva by apache.

the class LoginTest method testWithBadPassword.

@Test
public void testWithBadPassword() {
    goToLoginPage();
    setFieldValue("user-login-form-username", getProperty("ADMIN_USERNAME"));
    setFieldValue("user-login-form-password", "badPassword");
    clickLinkWithLocator("modal-login-ok", false);
    WebDriverWait wait = new WebDriverWait(getWebDriver(), 2);
    wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("modal-login"), "You have entered an incorrect username and/or password"));
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) AbstractArchivaTest(org.apache.archiva.web.test.parent.AbstractArchivaTest) Test(org.junit.Test)

Example 83 with WebDriverWait

use of org.openqa.selenium.support.ui.WebDriverWait in project tuerauf-backend-java by dsteinkopf.

the class SeleniumHelper method waitForComponentWithClassName.

public static boolean waitForComponentWithClassName(final WebDriver webDriver, final String className) {
    try {
        final WebDriverWait wait = new WebDriverWait(webDriver, DEFAULT_PAGE_LOAD_WAIT);
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.className(className)));
        return true;
    } catch (final TimeoutException te) {
        logger.error(te);
        return false;
    }
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) TimeoutException(org.openqa.selenium.TimeoutException)

Example 84 with WebDriverWait

use of org.openqa.selenium.support.ui.WebDriverWait in project tuerauf-backend-java by dsteinkopf.

the class SeleniumHelper method waitForComponentWithLocator.

public static boolean waitForComponentWithLocator(final WebDriver webDriver, final By locator) {
    try {
        final WebDriverWait wait = new WebDriverWait(webDriver, DEFAULT_PAGE_LOAD_WAIT);
        wait.until(ExpectedConditions.visibilityOfElementLocated(locator));
        return true;
    } catch (final TimeoutException te) {
        logger.error(te);
        return false;
    }
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) TimeoutException(org.openqa.selenium.TimeoutException)

Example 85 with WebDriverWait

use of org.openqa.selenium.support.ui.WebDriverWait in project CollectiveOneWebapp by CollectiveOne.

the class NotificationsModule method checkTagFillter.

public Boolean checkTagFillter(WebDriver driver) {
    (driver.findElement(By.id("T_goToHomePage"))).click();
    try {
        WebDriverWait wait = new WebDriverWait(driver, 10);
        wait.until(ExpectedConditions.elementToBeClickable(By.name("T_selectTagInputInitiative")));
        WebElement selectTag_InputModal = driver.findElement(By.name("T_selectTagInputInitiative"));
        // 
        selectTag_InputModal.sendKeys("heello");
        selectTag_InputModal.sendKeys(Keys.ENTER);
        return true;
    } catch (Exception exception) {
        System.out.println("Failed @ checkTagFillter(): " + exception);
        return false;
    }
}
Also used : WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) WebElement(org.openqa.selenium.WebElement)

Aggregations

WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)527 WebElement (org.openqa.selenium.WebElement)166 WebDriver (org.openqa.selenium.WebDriver)131 Test (org.junit.Test)86 By (org.openqa.selenium.By)54 Actions (org.openqa.selenium.interactions.Actions)53 JavascriptExecutor (org.openqa.selenium.JavascriptExecutor)43 TimeoutException (org.openqa.selenium.TimeoutException)38 ExpectedCondition (org.openqa.selenium.support.ui.ExpectedCondition)36 IOException (java.io.IOException)28 List (java.util.List)26 Wait (org.openqa.selenium.support.ui.Wait)25 BeforeClass (org.junit.BeforeClass)24 NgWebDriver (com.github.sergueik.jprotractor.NgWebDriver)21 ArrayList (java.util.ArrayList)21 WebDriverException (org.openqa.selenium.WebDriverException)21 FirefoxDriver (org.openqa.selenium.firefox.FirefoxDriver)21 Dimension (org.openqa.selenium.Dimension)20 File (java.io.File)16 NoSuchElementException (org.openqa.selenium.NoSuchElementException)16