Search in sources :

Example 66 with NotYetImplemented

use of com.gargoylesoftware.htmlunit.junit.BrowserRunner.NotYetImplemented in project htmlunit by HtmlUnit.

the class MooTools121Test method mooTools.

/**
 * @throws Exception if an error occurs
 */
@Alerts(DEFAULT = { "364", "1", "0", "should return the function bound to an object with multiple arguments" }, IE = { "364", "2", "0", "should return the function bound to an object with multiple arguments", "should return a CSS string representing the Element's styles" })
@Test
@NotYetImplemented(IE)
public void mooTools() throws Exception {
    final WebDriver driver = getWebDriver();
    driver.get(URL_FIRST + "Specs/index.html");
    driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
    driver.findElement(By.xpath("id('progress')[text() = '100']"));
    // usually this need 40s but sometimes our build machine is slower
    // this is not a performance test, we only like to ensure that all
    // functionality is running
    final List<WebElement> failed = driver.findElements(By.xpath("//li[@class = 'exception']/h4"));
    final List<String> failures = new ArrayList<>();
    for (final WebElement elt : failed) {
        failures.add(elt.getText());
    }
    // final File tmpFile = File.createTempFile("htmlunit", "mootools.html");
    // System.out.println(tmpFile.getAbsolutePath());
    // FileUtils.writeStringToFile(tmpFile, driver.getPageSource());
    assertEquals(Arrays.copyOfRange(getExpectedAlerts(), 3, getExpectedAlerts().length), failures);
    assertEquals(getExpectedAlerts()[0], driver.findElement(By.id("total_examples")).getText());
    assertEquals(getExpectedAlerts()[1], driver.findElement(By.id("total_failures")).getText());
    assertEquals(getExpectedAlerts()[2], driver.findElement(By.id("total_errors")).getText());
}
Also used : WebDriver(org.openqa.selenium.WebDriver) ArrayList(java.util.ArrayList) WebElement(org.openqa.selenium.WebElement) NotYetImplemented(com.gargoylesoftware.htmlunit.junit.BrowserRunner.NotYetImplemented) Test(org.junit.Test) Alerts(com.gargoylesoftware.htmlunit.junit.BrowserRunner.Alerts)

Aggregations

NotYetImplemented (com.gargoylesoftware.htmlunit.junit.BrowserRunner.NotYetImplemented)66 Test (org.junit.Test)65 Alerts (com.gargoylesoftware.htmlunit.junit.BrowserRunner.Alerts)54 WebDriver (org.openqa.selenium.WebDriver)54 HtmlPageTest (com.gargoylesoftware.htmlunit.html.HtmlPageTest)16 URL (java.net.URL)15 BuggyWebDriver (com.gargoylesoftware.htmlunit.junit.BrowserRunner.BuggyWebDriver)12 WebElement (org.openqa.selenium.WebElement)11 ArrayList (java.util.ArrayList)6 HtmlPage (com.gargoylesoftware.htmlunit.html.HtmlPage)5 HtmlUnitDriver (org.openqa.selenium.htmlunit.HtmlUnitDriver)5 MockWebConnection (com.gargoylesoftware.htmlunit.MockWebConnection)4 MSXMLTestHelper.callLoadXMLDOMDocumentFromString (com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromString)4 NameValuePair (com.gargoylesoftware.htmlunit.util.NameValuePair)4 WebClient (com.gargoylesoftware.htmlunit.WebClient)3 InputStream (java.io.InputStream)3 CollectingAlertHandler (com.gargoylesoftware.htmlunit.CollectingAlertHandler)2 MSXMLTestHelper.callSerializeXMLDOMDocumentToString (com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callSerializeXMLDOMDocumentToString)2 HtmlElement (com.gargoylesoftware.htmlunit.html.HtmlElement)2 File (java.io.File)2