Search in sources :

Example 51 with NotYetImplemented

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

the class XMLSerializerTest method htmlAttributes.

/**
 * @throws Exception if the test fails
 */
@Test
@Alerts(DEFAULT = "no ActiveX", IE = {})
@NotYetImplemented(IE)
public // so far we are not able to add the XML header
void htmlAttributes() throws Exception {
    final String expectedString = getExpectedAlerts().length != 0 ? "" : "<?xml32version=\"1.0\"?>\\r\\n<html32xmlns=\"http://www.w3.org/1999/xhtml\">" + "<head><title>html</title></head>" + "<body32id=\"bodyId\">" + "<span32class=\"spanClass\">foo</span>" + "</body>" + "</html>\\r\\n";
    final String serializationText = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>" + "<html xmlns=\"http://www.w3.org/1999/xhtml\">" + "<head><title>html</title></head>" + "<body id=\"bodyId\">" + "<span class=\"spanClass\">foo</span>" + "</body>" + "</html>";
    final WebDriver driver = loadPageVerifyTitle2(constructPageContent(serializationText));
    final WebElement textArea = driver.findElement(By.id("myTextArea"));
    assertEquals(expectedString, textArea.getAttribute("value"));
}
Also used : WebDriver(org.openqa.selenium.WebDriver) MSXMLTestHelper.callSerializeXMLDOMDocumentToString(com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callSerializeXMLDOMDocumentToString) MSXMLTestHelper.callLoadXMLDOMDocumentFromString(com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromString) WebElement(org.openqa.selenium.WebElement) NotYetImplemented(com.gargoylesoftware.htmlunit.junit.BrowserRunner.NotYetImplemented) Test(org.junit.Test) Alerts(com.gargoylesoftware.htmlunit.junit.BrowserRunner.Alerts)

Example 52 with NotYetImplemented

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

the class XMLDOMDocumentTest method lastChild_xmlDeclaration.

/**
 * @throws Exception if the test fails
 */
@Test
@Alerts(DEFAULT = "no ActiveX", IE = "xml(7)=version=\"1.0\"")
@NotYetImplemented(IE)
public // Xerces does not offer any way to access the XML declaration
void lastChild_xmlDeclaration() throws Exception {
    final String xml = "" + "<foo>\n" + "  <foofoo name='first'>something</foofoo>\n" + "  <foofoo name='second'>something else</foofoo>\n" + "</foo>" + "<?xml version=\"1.0\"?>\n";
    tester("debug(doc.lastChild);\n", xml);
}
Also used : MSXMLTestHelper.callLoadXMLDOMDocumentFromString(com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromString) NotYetImplemented(com.gargoylesoftware.htmlunit.junit.BrowserRunner.NotYetImplemented) Test(org.junit.Test) Alerts(com.gargoylesoftware.htmlunit.junit.BrowserRunner.Alerts)

Example 53 with NotYetImplemented

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

the class XMLDOMDocumentTest method firstChild_xmlDeclaration.

/**
 * @throws Exception if the test fails
 */
@Test
@Alerts(DEFAULT = "no ActiveX", IE = "xml(7)=version=\"1.0\"")
@NotYetImplemented(IE)
public // Xerces does not offer any way to access the XML declaration
void firstChild_xmlDeclaration() throws Exception {
    final String xml = "" + "<?xml version=\"1.0\"?>\n" + "<foo>\n" + "  <foofoo name='first'>something</foofoo>\n" + "  <foofoo name='second'>something else</foofoo>\n" + "</foo>";
    tester("debug(doc.firstChild);\n", xml);
}
Also used : MSXMLTestHelper.callLoadXMLDOMDocumentFromString(com.gargoylesoftware.htmlunit.activex.javascript.msxml.MSXMLTestHelper.callLoadXMLDOMDocumentFromString) NotYetImplemented(com.gargoylesoftware.htmlunit.junit.BrowserRunner.NotYetImplemented) Test(org.junit.Test) Alerts(com.gargoylesoftware.htmlunit.junit.BrowserRunner.Alerts)

Example 54 with NotYetImplemented

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

the class HtmlFrame2Test method frameOnloadFrameInFrame.

/**
 * @throws Exception if an error occurs
 */
@Test
@Alerts("second fourth third first")
@NotYetImplemented
public void frameOnloadFrameInFrame() throws Exception {
    final String html = "<FRAMESET rows='50%,50%' onload=\"document.title += ' first'\">\n" + "  <FRAME name='second' src='second.html'>\n" + "  <FRAME name='third' src='third.html'>\n" + "</FRAMESET>";
    final String secondHtml = "<html>\n" + "<body onload=\"top.document.title += ' second'\">\n" + "  <h1>second</h1>\n" + "</body></html>";
    final String thirdHtml = "<FRAMESET cols='100%' onload=\"top.document.title += ' third'\">\n" + "  <FRAME name='fourth' src='fourth.html'>\n" + "</FRAMESET>";
    final String fourthHtml = "<html>\n" + "<body onload=\"top.document.title += ' fourth'\">\n" + "  <h1>fourth</h1>\n" + "</body></html>";
    getMockWebConnection().setResponse(new URL(URL_FIRST, "second.html"), secondHtml);
    getMockWebConnection().setResponse(new URL(URL_FIRST, "third.html"), thirdHtml);
    getMockWebConnection().setResponse(new URL(URL_FIRST, "fourth.html"), fourthHtml);
    final WebDriver driver = loadPage2(html);
    assertEquals(4, getMockWebConnection().getRequestCount());
    assertTitle(driver, getExpectedAlerts()[0]);
}
Also used : WebDriver(org.openqa.selenium.WebDriver) URL(java.net.URL) NotYetImplemented(com.gargoylesoftware.htmlunit.junit.BrowserRunner.NotYetImplemented) Test(org.junit.Test) Alerts(com.gargoylesoftware.htmlunit.junit.BrowserRunner.Alerts)

Example 55 with NotYetImplemented

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

the class HtmlElement2Test method contentEditable.

/**
 * @throws Exception if the test fails
 */
@Test
@NotYetImplemented
public // this could be a general attribute issue
void contentEditable() throws Exception {
    final String html = "<html>\n" + "<body contentEditable><p>initial</p></body>\n" + "</html>";
    final WebDriver driver = loadPage2(html);
    final WebElement body = driver.findElement(By.xpath("//body"));
    body.clear();
    body.sendKeys("something");
    assertEquals("something", body.getText());
}
Also used : WebDriver(org.openqa.selenium.WebDriver) BuggyWebDriver(com.gargoylesoftware.htmlunit.junit.BrowserRunner.BuggyWebDriver) WebElement(org.openqa.selenium.WebElement) NotYetImplemented(com.gargoylesoftware.htmlunit.junit.BrowserRunner.NotYetImplemented) Test(org.junit.Test)

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