use of com.gargoylesoftware.htmlunit.junit.BrowserRunner.HtmlUnitNYI in project htmlunit by HtmlUnit.
the class HtmlAreaTest method isDisplayedEmptyCircle.
/**
* @throws Exception if an error occurs
*/
@Test
@Alerts(DEFAULT = { "false", "false", "true" }, IE = { "false", "false", "false" })
@HtmlUnitNYI(IE = { "false", "false", "true" })
public void isDisplayedEmptyCircle() throws Exception {
final String html = "<html><head><title>Page A</title></head>\n" + "<body>\n" + " <img id='myImg' usemap='#imgmap'" + " src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAA" + "HElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='>\n" + " <map id='myMap' name='imgmap'>\n" + " <area id='myArea1' shape='circle' coords='0,0,0'>\n" + " <area id='myArea2' shape='circle' >\n" + " <area id='myArea3' shape='circle' coords='0,0,0.8'>\n" + " </map>\n" + "</body></html>";
final String[] expected = getExpectedAlerts();
setExpectedAlerts(new String[] {});
final WebDriver driver = loadPage2(html);
boolean displayed = driver.findElement(By.id("myArea1")).isDisplayed();
assertEquals(Boolean.parseBoolean(expected[0]), displayed);
displayed = driver.findElement(By.id("myArea2")).isDisplayed();
assertEquals(Boolean.parseBoolean(expected[1]), displayed);
displayed = driver.findElement(By.id("myArea3")).isDisplayed();
assertEquals(Boolean.parseBoolean(expected[2]), displayed);
}
use of com.gargoylesoftware.htmlunit.junit.BrowserRunner.HtmlUnitNYI in project htmlunit by HtmlUnit.
the class FocusableElement2Test method bodyLoad.
/**
* @throws Exception if the test fails
*/
@Test
@Alerts(DEFAULT = { "body", "active: body", "onload", "active: body", "onfocus:[object Window]", "active: body" }, CHROME = { "body", "active: body", "onload", "active: body" }, EDGE = { "body", "active: body", "onload", "active: body" }, IE = { "body", "active: null", "onfocusin:body", "active: body", "onload", "active: body", "onfocus:[object Window]", "active: body" })
@HtmlUnitNYI(FF = { "body", "active: body", "onload", "active: body" }, FF_ESR = { "body", "active: body", "onload", "active: body" }, IE = { "body", "active: body", "onload", "active: body" })
public // TODO FF & FF68 fail due to wrong body vs. window event handling
void bodyLoad() throws Exception {
final String html = "<html>\n" + " <head>\n" + " <script>\n" + logger() + " function test() {\n" + " log('onload');\n" + " }\n" + " </script>\n" + " </head>\n" + " <body id='body' onload='test()' " + logEvents("") + ">\n" + " <script>\n" + " log('body');" + " </script>\n" + " </body>\n" + "</html>\n";
final WebDriver driver = loadPage2(html);
assertTitle(driver, String.join(";", getExpectedAlerts()) + (getExpectedAlerts().length > 0 ? ";" : ""));
}
use of com.gargoylesoftware.htmlunit.junit.BrowserRunner.HtmlUnitNYI in project htmlunit by HtmlUnit.
the class FocusableElement2Test method bodySwitchFromBodyToNotFocusable.
/**
* @throws Exception if the test fails
*/
@Test
@Alerts(DEFAULT = { "onfocus:[object Window]", "active: body", "before", "active: body", "after", "active: body" }, CHROME = { "before", "active: body", "after", "active: body" }, EDGE = { "before", "active: body", "after", "active: body" }, IE = { "onfocusin:body", "active: body", "onfocus:[object Window]", "active: body", "before", "active: body", "after", "active: body" })
@HtmlUnitNYI(FF = { "before", "active: body", "after", "active: body" }, FF_ESR = { "before", "active: body", "after", "active: body" }, IE = { "before", "active: body", "after", "active: body" })
public // TODO FF & FF68 fail due to wrong body vs. window event handling
void bodySwitchFromBodyToNotFocusable() throws Exception {
final String html = "<html>\n" + " <head>\n" + " <script>\n" + logger() + " function test() {\n" + " log('before');\n" + " document.getElementById('focusId').focus();\n" + " document.getElementById('focusId').blur();\n" + " log('after');\n" + " }\n" + " </script>\n" + " </head>\n" + " <body id='body' onload='setTimeout(test, 10)' " + logEvents("") + ">\n" + " <div id='focusId' " + logEvents("F") + ">div</div>\n" + " </body>\n" + "</html>\n";
final WebDriver driver = loadPage2(html);
assertTitle(driver, String.join(";", getExpectedAlerts()) + (getExpectedAlerts().length > 0 ? ";" : ""));
}
use of com.gargoylesoftware.htmlunit.junit.BrowserRunner.HtmlUnitNYI in project htmlunit by HtmlUnit.
the class FocusableElement2Test method bodySwitchFromBodyToFocusable.
/**
* @throws Exception if the test fails
*/
@Test
@Alerts(DEFAULT = { "onfocus:[object Window]", "active: body", "before", "active: body", "onfocusF:focusId", "active: focusId", "onfocusinF:focusId", "active: focusId", "onfocusin:focusId", "active: focusId", "onblurF:focusId", "active: body", "onfocusoutF:focusId", "active: body", "onfocusout:focusId", "active: body", "after", "active: body" }, CHROME = { "before", "active: body", "onfocusF:focusId", "active: focusId", "onfocusinF:focusId", "active: focusId", "onfocusin:focusId", "active: focusId", "onblurF:focusId", "active: body", "onfocusoutF:focusId", "active: body", "onfocusout:focusId", "active: body", "after", "active: body" }, EDGE = { "before", "active: body", "onfocusF:focusId", "active: focusId", "onfocusinF:focusId", "active: focusId", "onfocusin:focusId", "active: focusId", "onblurF:focusId", "active: body", "onfocusoutF:focusId", "active: body", "onfocusout:focusId", "active: body", "after", "active: body" }, IE = { "onfocusin:body", "active: body", "onfocus:[object Window]", "active: body", "before", "active: body", "onfocusout:body", "active: focusId", "onfocusinF:focusId", "active: focusId", "onfocusin:focusId", "active: focusId", "onfocusoutF:focusId", "active: body", "onfocusout:focusId", "active: body", "onfocusin:body", "active: body", "after", "active: body", "onfocusF:focusId", "active: body", "onblurF:focusId", "active: body" })
@HtmlUnitNYI(FF = { "before", "active: body", "onfocusF:focusId", "active: focusId", "onfocusinF:focusId", "active: focusId", "onfocusin:focusId", "active: focusId", "onblurF:focusId", "active: body", "onfocusoutF:focusId", "active: body", "onfocusout:focusId", "active: body", "after", "active: body" }, FF_ESR = { "before", "active: body", "onfocusF:focusId", "active: focusId", "onfocusinF:focusId", "active: focusId", "onfocusin:focusId", "active: focusId", "onblurF:focusId", "active: body", "onfocusoutF:focusId", "active: body", "onfocusout:focusId", "active: body", "after", "active: body" }, IE = { "before", "active: body", "onfocusout:body", "active: body", "onfocusinF:focusId", "active: body", "onfocusin:focusId", "active: body", "onfocusF:focusId", "active: focusId", "onfocusoutF:focusId", "active: body", "onfocusout:focusId", "active: body", "onblurF:focusId", "active: body", "after", "active: body" })
public // TODO FF & FF68 fail due to wrong body vs. window event handling
void bodySwitchFromBodyToFocusable() throws Exception {
final String html = "<html>\n" + " <head>\n" + " <script>\n" + logger() + " function test() {\n" + " log('before');\n" + " document.getElementById('focusId').focus();\n" + " document.getElementById('focusId').blur();\n" + " log('after');\n" + " }\n" + " </script>\n" + " </head>\n" + " <body id='body' onload='setTimeout(test, 10)' " + logEvents("") + ">\n" + " <input type='text' id='focusId' " + logEvents("F") + ">\n" + " </body>\n" + "</html>\n";
final WebDriver driver = loadPage2(html);
assertTitle(driver, String.join(";", getExpectedAlerts()) + (getExpectedAlerts().length > 0 ? ";" : ""));
}
use of com.gargoylesoftware.htmlunit.junit.BrowserRunner.HtmlUnitNYI in project htmlunit by HtmlUnit.
the class FocusableElement2Test method body.
/**
* @throws Exception if the test fails
*/
@Test
@Alerts(DEFAULT = { "onfocus:[object Window]", "active: focusId", "before", "active: focusId", "after", "active: focusId" }, CHROME = { "before", "active: focusId", "after", "active: focusId" }, EDGE = { "before", "active: focusId", "after", "active: focusId" }, IE = { "onfocusin:focusId", "active: focusId", "onfocus:[object Window]", "active: focusId", "before", "active: focusId", "after", "active: focusId" })
@HtmlUnitNYI(FF = { "before", "active: focusId", "after", "active: focusId" }, FF_ESR = { "before", "active: focusId", "after", "active: focusId" }, IE = { "before", "active: focusId", "onfocusout:focusId", "active: focusId", "after", "active: focusId" })
public // TODO FF & FF68 fail due to wrong body vs. window event handling
void body() throws Exception {
final String html = "<html>\n" + " <head>\n" + " <script>\n" + logger() + " function test() {\n" + " log('before');\n" + " document.getElementById('focusId').focus();\n" + " document.getElementById('focusId').focus();\n" + " document.getElementById('focusId').blur();\n" + " document.getElementById('focusId').blur();\n" + " log('after');\n" + " }\n" + " </script>\n" + " </head>\n" + " <body id='focusId' onload='setTimeout(test, 10)' " + logEvents("") + ">\n" + " </body>\n" + "</html>\n";
final WebDriver driver = loadPage2(html);
assertTitle(driver, String.join(";", getExpectedAlerts()) + (getExpectedAlerts().length > 0 ? ";" : ""));
}
Aggregations