Search in sources :

Example 36 with NotYetImplemented

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

the class HtmlAnchorTest method doubleClick.

/**
 * FF behaves is different.
 * @throws Exception if an error occurs
 */
@Test
@Alerts(DEFAULT = "click href click doubleClick href ", IE = "click href click doubleClick ")
@BuggyWebDriver(FF = "click doubleClick click href href ", FF_ESR = "click doubleClick click href href ")
@NotYetImplemented
public void doubleClick() throws Exception {
    final String html = "<html>\n" + "<body>\n" + "  <a id='myAnchor' " + "href=\"javascript:document.getElementById('myTextarea').value+='href ';void(0);\" " + "onClick=\"document.getElementById('myTextarea').value+='click ';\" " + "onDblClick=\"document.getElementById('myTextarea').value+='doubleClick ';\">foo</a>\n" + "  <textarea id='myTextarea'></textarea>\n" + "</body></html>";
    final WebDriver driver = loadPage2(html);
    final Actions action = new Actions(driver);
    action.doubleClick(driver.findElement(By.id("myAnchor")));
    action.perform();
    assertEquals(getExpectedAlerts()[0], driver.findElement(By.id("myTextarea")).getAttribute("value"));
}
Also used : WebDriver(org.openqa.selenium.WebDriver) BuggyWebDriver(com.gargoylesoftware.htmlunit.junit.BrowserRunner.BuggyWebDriver) Actions(org.openqa.selenium.interactions.Actions) NotYetImplemented(com.gargoylesoftware.htmlunit.junit.BrowserRunner.NotYetImplemented) Test(org.junit.Test) BuggyWebDriver(com.gargoylesoftware.htmlunit.junit.BrowserRunner.BuggyWebDriver) Alerts(com.gargoylesoftware.htmlunit.junit.BrowserRunner.Alerts)

Example 37 with NotYetImplemented

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

the class HtmlTimeInputTest method typing.

/**
 * @throws Exception if the test fails
 */
@Test
@Alerts(DEFAULT = "", IE = "8:04")
@NotYetImplemented(IE)
public void typing() throws Exception {
    final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form id='form1'>\n" + "  <input type='time' id='foo'>\n" + "</form></body></html>";
    final WebDriver driver = loadPage2(htmlContent);
    final WebElement input = driver.findElement(By.id("foo"));
    input.sendKeys("8:04");
    assertEquals(getExpectedAlerts()[0], input.getAttribute("value"));
}
Also used : WebDriver(org.openqa.selenium.WebDriver) WebElement(org.openqa.selenium.WebElement) NotYetImplemented(com.gargoylesoftware.htmlunit.junit.BrowserRunner.NotYetImplemented) Test(org.junit.Test) Alerts(com.gargoylesoftware.htmlunit.junit.BrowserRunner.Alerts)

Example 38 with NotYetImplemented

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

the class HtmlTextArea2Test method getVisibleTextValueChangedWithTyping.

/**
 * @throws Exception if the test fails
 */
@Test
@Alerts(DEFAULT = "Hello World", IE = "Hello WorldHtmlUnit")
@NotYetImplemented(IE)
public void getVisibleTextValueChangedWithTyping() throws Exception {
    final String html = "<html>" + "<head></head>\n" + "<body>\n" + "<form id='form1'>\n" + "<textarea id='tester'>Hello World</textarea>\n" + "</form>\n" + "</body></html>";
    final WebDriver driver = loadPage2(html);
    final WebElement textArea = driver.findElement(By.id("tester"));
    textArea.sendKeys("HtmlUnit");
    final String text = textArea.getText();
    assertEquals(getExpectedAlerts()[0], text);
    if (driver instanceof HtmlUnitDriver) {
        final HtmlPage page = (HtmlPage) getWebWindowOf((HtmlUnitDriver) driver).getEnclosedPage();
        assertEquals(getExpectedAlerts()[0], page.getElementById("tester").getVisibleText());
    }
}
Also used : WebDriver(org.openqa.selenium.WebDriver) WebElement(org.openqa.selenium.WebElement) HtmlUnitDriver(org.openqa.selenium.htmlunit.HtmlUnitDriver) NotYetImplemented(com.gargoylesoftware.htmlunit.junit.BrowserRunner.NotYetImplemented) Test(org.junit.Test) Alerts(com.gargoylesoftware.htmlunit.junit.BrowserRunner.Alerts)

Example 39 with NotYetImplemented

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

the class HtmlWeekInputTest method typing.

/**
 * @throws Exception if the test fails
 */
@Test
@Alerts(DEFAULT = "36", CHROME = "", EDGE = "")
@NotYetImplemented({ FF, FF_ESR, IE })
public void typing() throws Exception {
    final String htmlContent = "<html><head><title>foo</title></head><body>\n" + "<form id='form1'>\n" + "  <input type='week' id='foo'>\n" + "</form></body></html>";
    final WebDriver driver = loadPage2(htmlContent);
    final WebElement input = driver.findElement(By.id("foo"));
    input.sendKeys("36");
    assertEquals(getExpectedAlerts()[0], input.getAttribute("value"));
}
Also used : WebDriver(org.openqa.selenium.WebDriver) WebElement(org.openqa.selenium.WebElement) NotYetImplemented(com.gargoylesoftware.htmlunit.junit.BrowserRunner.NotYetImplemented) Test(org.junit.Test) Alerts(com.gargoylesoftware.htmlunit.junit.BrowserRunner.Alerts)

Example 40 with NotYetImplemented

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

the class HttpWebConnection3Test method queryString.

/**
 * Test case for Bug #1882.
 *
 * @throws Exception if the test fails
 */
@Test
@NotYetImplemented
public void queryString() throws Exception {
    final String response = "HTTP/1.1 302 Found\r\n" + "Content-Length: 0\r\n" + "\r\n";
    shutDownAll();
    try (PrimitiveWebServer primitiveWebServer = new PrimitiveWebServer(null, response, null)) {
        final WebDriver driver = getWebDriver();
        driver.get("http://localhost:" + primitiveWebServer.getPort() + "?para=%u65E5");
        assertTrue(primitiveWebServer.getRequests().get(0), primitiveWebServer.getRequests().get(0).contains("para=%u65E5"));
    }
}
Also used : WebDriver(org.openqa.selenium.WebDriver) 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