Skip to content

Commit

Permalink
Update HtmlUnit and HtmlUnitDriver to 2.26
Browse files Browse the repository at this point in the history
Signed-off-by: Alexei Barantsev <barancev@gmail.com>
  • Loading branch information
asashour authored and barancev committed Apr 13, 2017
1 parent 138e3ab commit d063185
Show file tree
Hide file tree
Showing 51 changed files with 68 additions and 97 deletions.
4 changes: 2 additions & 2 deletions .idea/libraries/cssparser.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions .idea/libraries/htmlunit.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions .idea/libraries/websocket.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions java/client/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
<classpathentry kind="lib" path="/third-party/java/hamcrest/hamcrest-core-1.3.jar"/>
<classpathentry kind="lib" path="/third-party/java/hamcrest/hamcrest-library-1.3.jar"/>
<classpathentry kind="lib" path="/third-party/java/guava/guava-21.0.jar" sourcepath="/third-party/java/guava/guava-21.0-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/htmlunit/htmlunit-2.24.jar" sourcepath="/third-party/java/htmlunit/htmlunit-2.24-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/htmlunit/neko-htmlunit-2.24.jar" sourcepath="/third-party/java/htmlunit/neko-htmlunit-2.24-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/htmlunit/htmlunit-core-js-2.23.jar"/>
<classpathentry kind="lib" path="/third-party/java/selenium/htmlunit-driver-2.24.jar" sourcepath="/third-party/java/selenium/htmlunit-driver-2.24.jar"/>
<classpathentry kind="lib" path="/third-party/java/htmlunit/htmlunit-2.26.jar" sourcepath="/third-party/java/htmlunit/htmlunit-2.26-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/htmlunit/neko-htmlunit-2.25.jar" sourcepath="/third-party/java/htmlunit/neko-htmlunit-2.25-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/htmlunit/htmlunit-core-js-2.26.jar" sourcepath="/third-party/java/htmlunit/htmlunit-core-js-2.26-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/selenium/htmlunit-driver-2.26.jar" sourcepath="/third-party/java/selenium/htmlunit-driver-2.26.jar"/>
<classpathentry kind="lib" path="/third-party/java/jna/jna-4.1.0.jar" sourcepath="/third-party/java/jna/jna-4.1.0-src.jar"/>
<classpathentry kind="lib" path="/third-party/java/jna/jna-platform-4.1.0.jar" sourcepath="/third-party/java/jna/jna-platform-4.1.0-src.jar"/>
<classpathentry kind="lib" path="/third-party/java/commons/commons-exec-1.3.jar" sourcepath="/third-party/java/commons/commons-exec-1.3-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/jetty/jetty-repacked.jar"/>
<classpathentry kind="lib" path="/third-party/java/jetty/jetty-util-9.4.1.v20170120.jar" sourcepath="/third-party/java/jetty/jetty-util-9.4.1.v20170120-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/cglib/cglib-nodep-3.2.4.jar"/>
<classpathentry kind="lib" path="/third-party/java/servlet/javax.servlet-api-3.1.0.jar" sourcepath="/third-party/java/servlet/javax.servlet-api-3.1.0-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/phantomjs-driver/phantomjsdriver-1.4.0.jar" sourcepath="/third-party/java/phantomjs-driver/phantomjsdriver-1.4.0-sources.jar"/>
Expand All @@ -23,15 +24,18 @@
<classpathentry kind="lib" path="/third-party/java/commons-logging/commons-logging-1.2.jar"/>
<classpathentry kind="lib" path="/third-party/java/commons-io/commons-io-2.5.jar" sourcepath="/third-party/java/commons-io/commons-io-2.5-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/commons-codec/commons-codec-1.10.jar" sourcepath="/third-party/java/commons-codec/commons-codec-1.10-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/css/sac-1.3.jar"/>
<classpathentry kind="lib" path="/third-party/java/css/sac-1.3.jar" sourcepath="/third-party/java/css/sac-1.3-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/commons/commons-lang3-3.5.jar" sourcepath="/third-party/java/commons/commons-lang3-3.5-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/httpcomponents/httpmime-4.5.3.jar" sourcepath="/third-party/java/httpcomponents/httpmime-4.5.3-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/commons-collections/commons-collections-3.2.2.jar" sourcepath="/third-party/java/commons-collections/commons-collections-3.2.2-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/cssparser/cssparser-0.9.21.jar"/>
<classpathentry kind="lib" path="/third-party/java/cssparser/cssparser-0.9.22.jar" sourcepath="/third-party/java/cssparser/cssparser-0.9.22-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/xerces/xercesImpl-2.11.0.jar" sourcepath="/third-party/java/xerces/xercesImpl-2.11.0-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/xalan/xalan-2.7.2.jar"/>
<classpathentry kind="lib" path="/third-party/java/commons-fileupload/commons-fileupload-1.2.2.jar" sourcepath="/third-party/java/commons-fileupload/commons-fileupload-1.2.2-src.jar"/>
<classpathentry kind="lib" path="/third-party/java/little_proxy/littleproxy-0.5.3.jar" sourcepath="/third-party/java/little_proxy/littleproxy-0.5.3-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/websocket/websocket-api-9.4.3.v20170317.jar" sourcepath="/third-party/java/websocket/websocket-api-9.4.3.v20170317-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/websocket/websocket-client-9.4.3.v20170317.jar" sourcepath="/third-party/java/websocket/websocket-client-9.4.3.v20170317-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/websocket/websocket-common-9.4.3.v20170317.jar" sourcepath="/third-party/java/websocket/websocket-common-9.4.3.v20170317-sources.jar"/>
<classpathentry kind="lib" path="/third-party/java/netty/netty-3.5.7.Final.jar"/>
<classpathentry kind="lib" path="/third-party/java/xml-apis/xml-apis-1.4.01.jar"/>
<classpathentry kind="lib" path="/third-party/java/mockito/mockito-core-1.9.5.jar"/>
Expand Down
21 changes: 3 additions & 18 deletions java/client/test/org/openqa/selenium/AlertsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ public void testShouldAllowUsersToAcceptAnAlertWithNoTextManually() {
@Test
@Ignore(CHROME)
@Ignore(MARIONETTE)
@NotYetImplemented(HTMLUNIT)
public void testShouldGetTextOfAlertOpenedInSetTimeout() throws Exception {
driver.get(appServer.create(new Page()
.withTitle("Testing Alerts")
Expand Down Expand Up @@ -160,8 +159,6 @@ public void testShouldAllowUsersToDismissAnAlertManually() {

@JavascriptEnabled
@Test
@NotYetImplemented(value = HTMLUNIT,
reason = "HtmlUnit: click()/prompt need to run in different threads.")
public void testShouldAllowAUserToAcceptAPrompt() {
driver.get(promptPage(null));

Expand All @@ -175,8 +172,6 @@ public void testShouldAllowAUserToAcceptAPrompt() {

@JavascriptEnabled
@Test
@NotYetImplemented(value = HTMLUNIT,
reason = "HtmlUnit: click()/prompt need to run in different threads.")
public void testShouldAllowAUserToDismissAPrompt() {
driver.get(promptPage(null));

Expand All @@ -189,8 +184,6 @@ public void testShouldAllowAUserToDismissAPrompt() {
}

@JavascriptEnabled
@Test
@NotYetImplemented(value = HTMLUNIT, reason = "click()/prompt need to run in different threads")
@NotYetImplemented(value = MARIONETTE, reason = "https://github.com/mozilla/geckodriver/issues/607")
public void testShouldAllowAUserToSetTheValueOfAPrompt() {
driver.get(promptPage(null));
Expand Down Expand Up @@ -235,8 +228,7 @@ public void testShouldAllowTheUserToGetTheTextOfAnAlert() {
}

@Test
@NotYetImplemented(value = HTMLUNIT,
reason = "HtmlUnit: click()/prompt need to run in different threads.")
@Ignore(value = HTMLUNIT, reason="test should enable JavaScript")
public void testShouldAllowTheUserToGetTheTextOfAPrompt() {
driver.get(promptPage(null));

Expand Down Expand Up @@ -337,8 +329,6 @@ public void testSwitchingToMissingAlertInAClosedWindowThrows() throws Exception

@JavascriptEnabled
@Test
@NotYetImplemented(value = HTMLUNIT,
reason = "HtmlUnit: runs on the same test thread.")
public void testPromptShouldUseDefaultValueIfNoKeysSent() {
driver.get(promptPage("This is a default value"));

Expand All @@ -351,8 +341,6 @@ public void testPromptShouldUseDefaultValueIfNoKeysSent() {

@JavascriptEnabled
@Test
@NotYetImplemented(value = HTMLUNIT,
reason = "HtmlUnit: click()/prompt need to run in different threads.")
public void testPromptShouldHaveNullValueIfDismissed() {
driver.get(promptPage("This is a default value"));

Expand All @@ -365,7 +353,6 @@ public void testPromptShouldHaveNullValueIfDismissed() {

@JavascriptEnabled
@Test
@NotYetImplemented(value = HTMLUNIT, reason = "click()/prompt need to run in different threads")
@NotYetImplemented(value = MARIONETTE, reason = "https://github.com/mozilla/geckodriver/issues/607")
public void testHandlesTwoAlertsFromOneInteraction() {
driver.get(appServer.create(new Page()
Expand Down Expand Up @@ -436,6 +423,7 @@ public void testShouldHandleAlertOnPageLoadUsingGet() {
@Ignore(FIREFOX)
@Ignore(value = IE, reason = "Fails in versions 6 and 7")
@Ignore(MARIONETTE)
@NotYetImplemented(HTMLUNIT)
public void testShouldNotHandleAlertInAnotherWindow() {
String pageWithOnLoad = appServer.create(new Page()
.withOnLoad("javascript:alert(\"onload\")")
Expand Down Expand Up @@ -489,8 +477,6 @@ public void testShouldHandleAlertOnPageUnload() {

@JavascriptEnabled
@Test
@NotYetImplemented(value = HTMLUNIT,
reason = "HtmlUnit: runs on the same test thread, and .click() already changs the current window.")
public void testShouldHandleAlertOnPageBeforeUnload() {
String blank = appServer.create(new Page().withTitle("Success"));
driver.get(appServer.create(new Page()
Expand All @@ -515,8 +501,7 @@ public void testShouldHandleAlertOnPageBeforeUnload() {

@NoDriverAfterTest
@Test
@NotYetImplemented(value = HTMLUNIT,
reason = "HtmlUnit: runs on the same test thread.")
@Ignore(value = HTMLUNIT, reason="test should enable JavaScript")
public void testShouldHandleAlertOnPageBeforeUnloadAtQuit() {
String blank = appServer.create(new Page().withTitle("Success"));
driver.get(appServer.create(new Page()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public void testSendingKeysToAFocusedElementShouldNotBlurThatElement() {
@JavascriptEnabled
@Test
@Ignore(SAFARI)
@Ignore(HTMLUNIT)
@NotYetImplemented(HTMLUNIT)
public void testClickingAnUnfocusableChildShouldNotBlurTheParent() {
assumeFalse(isOldIe(driver));
driver.get(pages.javascriptPage);
Expand Down
3 changes: 0 additions & 3 deletions java/client/test/org/openqa/selenium/ElementFindingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import static org.junit.Assert.assertThat;
import static org.junit.Assume.assumeFalse;
import static org.openqa.selenium.testing.Driver.CHROME;
import static org.openqa.selenium.testing.Driver.HTMLUNIT;
import static org.openqa.selenium.testing.Driver.IE;
import static org.openqa.selenium.testing.Driver.MARIONETTE;
import static org.openqa.selenium.testing.Driver.SAFARI;
Expand All @@ -38,7 +37,6 @@
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.JavascriptEnabled;
import org.openqa.selenium.testing.NeedsFreshDriver;
import org.openqa.selenium.testing.NotYetImplemented;
import org.openqa.selenium.testing.SwitchToTopAfterTest;
import org.openqa.selenium.testing.TestUtilities;

Expand Down Expand Up @@ -447,7 +445,6 @@ public void testShouldBeAbleToFindElementByXPathWithNamespace() {
@Ignore(IE)
@Ignore(SAFARI)
@Ignore(CHROME)
@NotYetImplemented(value = HTMLUNIT, reason = "This used to work in HtmlUnit 2.23")
public void testShouldBeAbleToFindElementByXPathInXmlDocument() {
driver.get(pages.simpleXmlDocument);
WebElement element = driver.findElement(By.xpath("//foo"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ public void shouldBeAbleToMakeXMLHttpRequestsAndWaitForTheResponse() {
@Ignore(CHROME)
@Ignore(IE)
@Ignore(MARIONETTE)
@NotYetImplemented(HTMLUNIT)
@NeedsLocalEnvironment(reason = "Relies on timing")
public void throwsIfScriptTriggersAlert() {
driver.get(pages.simpleTestPage);
Expand All @@ -349,7 +348,6 @@ public void throwsIfScriptTriggersAlert() {
@Ignore(CHROME)
@Ignore(IE)
@Ignore(MARIONETTE)
@NotYetImplemented(HTMLUNIT)
@NeedsLocalEnvironment(reason = "Relies on timing")
public void throwsIfAlertHappensDuringScript() {
driver.get(pages.slowLoadingAlertPage);
Expand All @@ -364,7 +362,7 @@ public void throwsIfAlertHappensDuringScript() {
@Ignore(CHROME)
@Ignore(IE)
@Ignore(MARIONETTE)
@NotYetImplemented(HTMLUNIT)
@Ignore(value = HTMLUNIT, reason="test should enable JavaScript")
@NeedsLocalEnvironment(reason = "Relies on timing")
public void throwsIfScriptTriggersAlertWhichTimesOut() {
driver.get(pages.simpleTestPage);
Expand All @@ -381,7 +379,6 @@ public void throwsIfScriptTriggersAlertWhichTimesOut() {
@Ignore(CHROME)
@Ignore(IE)
@Ignore(MARIONETTE)
@NotYetImplemented(HTMLUNIT)
@NeedsLocalEnvironment(reason = "Relies on timing")
public void throwsIfAlertHappensDuringScriptWhichTimesOut() {
driver.get(pages.slowLoadingAlertPage);
Expand All @@ -397,7 +394,6 @@ public void throwsIfAlertHappensDuringScriptWhichTimesOut() {
@Ignore(CHROME)
@Ignore(IE)
@Ignore(MARIONETTE)
@NotYetImplemented(HTMLUNIT)
@NeedsLocalEnvironment(reason = "Relies on timing")
public void includesAlertTextInUnhandledAlertException() {
driver.manage().timeouts().setScriptTimeout(5000, TimeUnit.MILLISECONDS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,6 @@ public void testShouldThrowAnExceptionWhenArgumentsWithStaleElementPassed() {
@Ignore(PHANTOMJS)
@Ignore(SAFARI)
@Ignore(MARIONETTE)
@NotYetImplemented(HTMLUNIT)
public void testShouldBeAbleToReturnADateObject() {
driver.get(pages.simpleTestPage);

Expand Down
1 change: 0 additions & 1 deletion java/client/test/org/openqa/selenium/FormHandlingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ public void testCanClickOnASubmitButton() {
checkSubmitButton("internal_explicit_submit");
}


@Test
@Ignore(SAFARI)
@NotYetImplemented(value = MARIONETTE, reason = "https://github.com/mozilla/geckodriver/issues/594")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,11 +483,11 @@ public void testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUsWithWe
@JavascriptEnabled
@Test
@Ignore(CHROME)
@Ignore(HTMLUNIT)
@Ignore(IE)
@Ignore(value = MARIONETTE, issue = "https://github.com/mozilla/geckodriver/issues/614")
@Ignore(PHANTOMJS)
@Ignore(SAFARI)
@NotYetImplemented(HTMLUNIT)
public void testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs() {
driver.get(appServer.whereIs("frame_switching_tests/deletingFrame.html"));

Expand Down
2 changes: 0 additions & 2 deletions java/client/test/org/openqa/selenium/I18nTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import java.util.Arrays;
import java.util.List;


public class I18nTest extends JUnit4TestBase {

/**
Expand Down Expand Up @@ -177,7 +176,6 @@ public void testShouldBeAbleToActivateIMEEngine() throws InterruptedException {
@Ignore(IE)
@Ignore(CHROME)
@Ignore(FIREFOX)
@Ignore(HTMLUNIT)
@NotYetImplemented(value = MARIONETTE, reason = "https://github.com/mozilla/geckodriver/issues/594")
public void testShouldBeAbleToInputJapanese() {
assumeTrue("IME is supported on Linux only.",
Expand Down
6 changes: 2 additions & 4 deletions java/client/test/org/openqa/selenium/PageLoadingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ private void initLocalDriver(String strategy) {
@Ignore(SAFARI)
@Ignore(MARIONETTE)
@Ignore(PHANTOMJS)
@NotYetImplemented(HTMLUNIT)
@NeedsLocalEnvironment
public void testNoneStrategyShouldNotWaitForPageToLoad() {
initLocalDriver("none");
Expand All @@ -108,7 +107,6 @@ public void testNoneStrategyShouldNotWaitForPageToLoad() {
@Ignore(SAFARI)
@Ignore(MARIONETTE)
@Ignore(PHANTOMJS)
@NotYetImplemented(HTMLUNIT)
@NeedsLocalEnvironment
public void testNoneStrategyShouldNotWaitForPageToRefresh() {
initLocalDriver("none");
Expand Down Expand Up @@ -373,7 +371,6 @@ public void testShouldBeAbleToAccessPagesWithAnInsecureSslCertificate() {
@Ignore(SAFARI)
@Ignore(PHANTOMJS)
@Ignore(MARIONETTE)
@NotYetImplemented(HTMLUNIT)
public void shouldBeAbleToDisableAcceptOfInsecureSslCertsWithRequiredCapability() {
// TODO: Resolve why this test doesn't work on the remote server
assumeTrue(isLocal());
Expand Down Expand Up @@ -456,13 +453,14 @@ public void testShouldTimeoutIfAPageTakesTooLongToLoad() {
@Test
@Ignore(MARIONETTE)
@Ignore(value = SAFARI, reason = "issue 687, comment 41")
@NotYetImplemented(HTMLUNIT)
@NeedsLocalEnvironment
public void testShouldTimeoutIfAPageTakesTooLongToLoadAfterClick() {
// Fails on Chrome 44 (and higher?) https://code.google.com/p/chromedriver/issues/detail?id=1125
assumeFalse(
"chrome".equals(((HasCapabilities) driver).getCapabilities().getBrowserName())
&& "44".compareTo(((HasCapabilities) driver).getCapabilities().getVersion()) <= 0);
assumeFalse(
"htmlunit".equals(((HasCapabilities) driver).getCapabilities().getBrowserName()));

driver.manage().timeouts().pageLoadTimeout(2, SECONDS);

Expand Down
Loading

0 comments on commit d063185

Please sign in to comment.