Search in sources :

Example 16 with NgWebDriver

use of com.github.sergueik.jprotractor.NgWebDriver in project selenium_java by sergueik.

the class NgIgnoreSyncIntegrationTest method testNonAngularIgnoreSync.

// @Ignore
@Test
public void testNonAngularIgnoreSync() {
    if (isCIBuild) {
        return;
    }
    NgWebDriver ngDriver = new NgWebDriver(seleniumDriver, true);
    ngDriver.navigate().to("http://www.google.com");
    long startTime = System.currentTimeMillis();
    ngDriver.waitForAngular();
    long estimatedTime = System.currentTimeMillis() - startTime;
    System.err.println("waitForAngular: " + estimatedTime);
    NgWebElement element = ngDriver.findElement(By.cssSelector("input#gs_htif0"));
    try {
        element.getAttribute("id");
    } catch (TimeoutException exception) {
        fullStackTrace = org.apache.commons.lang.exception.ExceptionUtils.getFullStackTrace(exception);
        System.err.println("TimeoutException thrown: " + fullStackTrace);
        return;
    }
}
Also used : NgWebDriver(com.github.sergueik.jprotractor.NgWebDriver) NgWebElement(com.github.sergueik.jprotractor.NgWebElement) TimeoutException(org.openqa.selenium.TimeoutException) Test(org.junit.Test)

Example 17 with NgWebDriver

use of com.github.sergueik.jprotractor.NgWebDriver in project selenium_java by sergueik.

the class NgLocalFileIntegrationTest method setup.

@BeforeClass
public static void setup() throws IOException {
    sb = new StringBuilder();
    formatter = new Formatter(sb, Locale.US);
    isCIBuild = CommonFunctions.checkEnvironment();
    seleniumDriver = CommonFunctions.getSeleniumDriver();
    seleniumDriver.manage().window().setSize(new Dimension(width, height));
    seleniumDriver.manage().timeouts().pageLoadTimeout(50, TimeUnit.SECONDS).implicitlyWait(implicitWait, TimeUnit.SECONDS).setScriptTimeout(10, TimeUnit.SECONDS);
    wait = new WebDriverWait(seleniumDriver, flexibleWait);
    wait.pollingEvery(pollingInterval, TimeUnit.MILLISECONDS);
    actions = new Actions(seleniumDriver);
    ngDriver = new NgWebDriver(seleniumDriver);
}
Also used : NgWebDriver(com.github.sergueik.jprotractor.NgWebDriver) Actions(org.openqa.selenium.interactions.Actions) Formatter(java.util.Formatter) WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) Dimension(org.openqa.selenium.Dimension) BeforeClass(org.junit.BeforeClass)

Example 18 with NgWebDriver

use of com.github.sergueik.jprotractor.NgWebDriver in project selenium_java by sergueik.

the class NgMultiSelectIntegrationTest method setup.

@BeforeClass
public static void setup() throws IOException {
    isCIBuild = CommonFunctions.checkEnvironment();
    seleniumDriver = CommonFunctions.getSeleniumDriver();
    seleniumDriver.manage().window().setSize(new Dimension(width, height));
    seleniumDriver.manage().timeouts().pageLoadTimeout(50, TimeUnit.SECONDS).implicitlyWait(implicitWait, TimeUnit.SECONDS).setScriptTimeout(10, TimeUnit.SECONDS);
    wait = new WebDriverWait(seleniumDriver, flexibleWait);
    wait.pollingEvery(pollingInterval, TimeUnit.MILLISECONDS);
    actions = new Actions(seleniumDriver);
    ngDriver = new NgWebDriver(seleniumDriver);
}
Also used : NgWebDriver(com.github.sergueik.jprotractor.NgWebDriver) Actions(org.openqa.selenium.interactions.Actions) WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) Dimension(org.openqa.selenium.Dimension) BeforeClass(org.junit.BeforeClass)

Example 19 with NgWebDriver

use of com.github.sergueik.jprotractor.NgWebDriver in project selenium_java by sergueik.

the class NgQualityShepherdIntegrationTest method setup.

@BeforeClass
public static void setup() throws IOException {
    isCIBuild = CommonFunctions.checkEnvironment();
    seleniumDriver = CommonFunctions.getSeleniumDriver();
    seleniumDriver.manage().window().setSize(new Dimension(width, height));
    seleniumDriver.manage().timeouts().pageLoadTimeout(50, TimeUnit.SECONDS).implicitlyWait(implicitWait, TimeUnit.SECONDS).setScriptTimeout(10, TimeUnit.SECONDS);
    wait = new WebDriverWait(seleniumDriver, flexibleWait);
    wait.pollingEvery(pollingInterval, TimeUnit.MILLISECONDS);
    actions = new Actions(seleniumDriver);
    ngDriver = new NgWebDriver(seleniumDriver);
    CommonFunctions.setHighlightTimeout(1000);
}
Also used : NgWebDriver(com.github.sergueik.jprotractor.NgWebDriver) Actions(org.openqa.selenium.interactions.Actions) WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) Dimension(org.openqa.selenium.Dimension) BeforeClass(org.junit.BeforeClass)

Example 20 with NgWebDriver

use of com.github.sergueik.jprotractor.NgWebDriver in project selenium_java by sergueik.

the class NgTodoListIntegrationTest method setup.

@BeforeClass
public static void setup() throws IOException {
    isCIBuild = CommonFunctions.checkEnvironment();
    seleniumDriver = CommonFunctions.getSeleniumDriver();
    seleniumDriver.manage().window().setSize(new Dimension(width, height));
    seleniumDriver.manage().timeouts().pageLoadTimeout(50, TimeUnit.SECONDS).implicitlyWait(implicitWait, TimeUnit.SECONDS).setScriptTimeout(10, TimeUnit.SECONDS);
    wait = new WebDriverWait(seleniumDriver, flexibleWait);
    wait.pollingEvery(pollingInterval, TimeUnit.MILLISECONDS);
    actions = new Actions(seleniumDriver);
    ngDriver = new NgWebDriver(seleniumDriver);
}
Also used : NgWebDriver(com.github.sergueik.jprotractor.NgWebDriver) Actions(org.openqa.selenium.interactions.Actions) WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) Dimension(org.openqa.selenium.Dimension) BeforeClass(org.junit.BeforeClass)

Aggregations

NgWebDriver (com.github.sergueik.jprotractor.NgWebDriver)25 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)18 BeforeClass (org.junit.BeforeClass)16 Actions (org.openqa.selenium.interactions.Actions)16 Dimension (org.openqa.selenium.Dimension)15 File (java.io.File)6 Before (org.junit.Before)6 ChromeDriver (org.openqa.selenium.chrome.ChromeDriver)6 DesiredCapabilities (org.openqa.selenium.remote.DesiredCapabilities)6 HashMap (java.util.HashMap)5 NgWebElement (com.github.sergueik.jprotractor.NgWebElement)2 Formatter (java.util.Formatter)2 Test (org.junit.Test)2 Boolean.parseBoolean (java.lang.Boolean.parseBoolean)1 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 NgScrollableTablePage (org.henrrich.jpagefactory.example.scrollabletable.NgScrollableTablePage)1 TodoListPage (org.henrrich.jpagefactory.example.todolist.TodoListPage)1 NoSuchElementException (org.openqa.selenium.NoSuchElementException)1 TimeoutException (org.openqa.selenium.TimeoutException)1 WebDriver (org.openqa.selenium.WebDriver)1