Skip to content

Commit

Permalink
HtmlUnit test case to be @NotYetImplemented
Browse files Browse the repository at this point in the history
Moving most of HtmlUnit cases from @ignore
to @NotYetImplemented, few cases already pass.
Few cases are unstable (the test fails if run
one, but succeeds if runs twice!)
Other @ignore cases are left as is, as they
are outside HtmlUnit scope (Remote Driver/
rendering)

Signed-off-by: Luke Inman-Semerau <luke.semerau@gmail.com>
  • Loading branch information
asashour authored and lukeis committed Jul 2, 2015
1 parent 3cff5f0 commit 90f07e5
Show file tree
Hide file tree
Showing 22 changed files with 167 additions and 94 deletions.
5 changes: 3 additions & 2 deletions java/client/test/org/openqa/selenium/AlertsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.JavascriptEnabled;
import org.openqa.selenium.testing.NeedsLocalEnvironment;

import org.openqa.selenium.testing.NotYetImplemented;
import org.junit.Before;
import org.junit.Test;

Expand Down Expand Up @@ -465,7 +465,8 @@ public void testShouldHandleAlertOnWindowClose() {
}

@JavascriptEnabled
@Ignore(value = {CHROME, HTMLUNIT, MARIONETTE})
@Ignore(value = {CHROME, MARIONETTE})
@NotYetImplemented(HTMLUNIT)
@Test
public void testIncludesAlertTextInUnhandledAlertException() {
driver.findElement(By.id("alert")).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.JavascriptEnabled;
import org.openqa.selenium.testing.NotYetImplemented;

import java.net.URI;
import java.util.Date;
Expand Down Expand Up @@ -418,7 +419,8 @@ public void testRetainsCookieSecure() {
assertTrue(retrieved.isSecure());
}

@Ignore(value = {HTMLUNIT, SAFARI})
@Ignore(SAFARI)
@NotYetImplemented(HTMLUNIT)
@Test
public void canHandleHttpOnlyCookie() {
Cookie addedCookie =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.JavascriptEnabled;

import org.openqa.selenium.testing.NotYetImplemented;
import org.openqa.selenium.testing.TestUtilities;
import org.openqa.selenium.testing.drivers.SauceDriver;

Expand Down Expand Up @@ -124,8 +124,9 @@ public void testShouldNotThrowIfEventHandlerThrows() {
}
}

@Ignore(value = {HTMLUNIT, MARIONETTE})
@Ignore(MARIONETTE)
@JavascriptEnabled
@NotYetImplemented(HTMLUNIT)
@Test
public void testShouldFireEventsInTheRightOrder() {
driver.get(pages.javascriptPage);
Expand Down
9 changes: 6 additions & 3 deletions java/client/test/org/openqa/selenium/CssValueTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.JavascriptEnabled;
import org.openqa.selenium.testing.NotYetImplemented;

import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.equalTo;
Expand All @@ -32,7 +33,8 @@
public class CssValueTest extends JUnit4TestBase {

@JavascriptEnabled
@Ignore({HTMLUNIT, MARIONETTE})
@Ignore(MARIONETTE)
@NotYetImplemented(HTMLUNIT)
@Test
public void testShouldPickUpStyleOfAnElement() {
driver.get(pages.javascriptPage);
Expand All @@ -49,7 +51,8 @@ public void testShouldPickUpStyleOfAnElement() {
}

@JavascriptEnabled
@Ignore({HTMLUNIT, MARIONETTE})
@Ignore(MARIONETTE)
@NotYetImplemented(HTMLUNIT)
@Test
public void testGetCssValueShouldReturnStandardizedColour() {
driver.get(pages.colorPage);
Expand All @@ -65,7 +68,7 @@ public void testGetCssValueShouldReturnStandardizedColour() {
}

@JavascriptEnabled
@Ignore({HTMLUNIT})
@NotYetImplemented(HTMLUNIT)
@Test
public void testShouldAllowInheritedStylesToBeUsed() {
driver.get(pages.javascriptPage);
Expand Down
4 changes: 3 additions & 1 deletion java/client/test/org/openqa/selenium/ElementFindingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.JavascriptEnabled;
import org.openqa.selenium.testing.NotYetImplemented;
import org.openqa.selenium.testing.TestUtilities;

import static org.hamcrest.Matchers.containsString;
Expand Down Expand Up @@ -394,7 +395,8 @@ public void testFindingALinkByXpathUsingContainsKeywordShouldWork() {
assertThat(element.getText(), containsString("hello world"));
}

@Ignore({HTMLUNIT, IE, MARIONETTE, SAFARI})
@Ignore({IE, MARIONETTE, SAFARI})
@NotYetImplemented(HTMLUNIT)
@Test
public void testShouldBeAbleToFindElementByXPathWithNamespace() {
driver.get(pages.svgPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.JavascriptEnabled;
import org.openqa.selenium.testing.NeedsLocalEnvironment;
import org.openqa.selenium.testing.NotYetImplemented;

import java.util.Iterator;
import java.util.List;
Expand Down Expand Up @@ -243,7 +244,8 @@ public void shouldNotTimeoutWithMultipleCallsTheFirstOneBeingSynchronous() {

@JavascriptEnabled
@Test
@Ignore(value = {CHROME, HTMLUNIT, IE, PHANTOMJS, SAFARI})
@Ignore(value = {CHROME, IE, PHANTOMJS, SAFARI})
@NotYetImplemented(HTMLUNIT)
public void shouldCatchErrorsWithMessageAndStacktraceWhenExecutingInitialScript() {
driver.get(pages.ajaxyPage);
String js = "function functionB() { throw Error('errormessage'); };"
Expand Down Expand Up @@ -341,7 +343,8 @@ public void shouldBeAbleToMakeXMLHttpRequestsAndWaitForTheResponse() {

@JavascriptEnabled
@Test
@Ignore(value = {CHROME, HTMLUNIT, IE})
@Ignore(value = {CHROME, IE})
@NotYetImplemented(HTMLUNIT)
@NeedsLocalEnvironment(reason = "Relies on timing")
public void throwsIfScriptTriggersAlert() {
driver.get(pages.simpleTestPage);
Expand All @@ -359,7 +362,8 @@ public void throwsIfScriptTriggersAlert() {

@JavascriptEnabled
@Test
@Ignore(value = {CHROME, HTMLUNIT, IE})
@Ignore(value = {CHROME, IE})
@NotYetImplemented(HTMLUNIT)
@NeedsLocalEnvironment(reason = "Relies on timing")
public void throwsIfAlertHappensDuringScript() {
driver.get(pages.slowLoadingAlertPage);
Expand All @@ -375,7 +379,8 @@ public void throwsIfAlertHappensDuringScript() {
}

@Test
@Ignore(value = {CHROME, HTMLUNIT, IE})
@Ignore(value = {CHROME, IE})
@NotYetImplemented(HTMLUNIT)
@NeedsLocalEnvironment(reason = "Relies on timing")
public void throwsIfScriptTriggersAlertWhichTimesOut() {
driver.get(pages.simpleTestPage);
Expand All @@ -393,7 +398,8 @@ public void throwsIfScriptTriggersAlertWhichTimesOut() {

@JavascriptEnabled
@Test
@Ignore(value = {CHROME, HTMLUNIT, IE})
@Ignore(value = {CHROME, IE})
@NotYetImplemented(HTMLUNIT)
@NeedsLocalEnvironment(reason = "Relies on timing")
public void throwsIfAlertHappensDuringScriptWhichTimesOut() {
driver.get(pages.slowLoadingAlertPage);
Expand All @@ -410,7 +416,8 @@ public void throwsIfAlertHappensDuringScriptWhichTimesOut() {

@JavascriptEnabled
@Test
@Ignore(value = {CHROME, HTMLUNIT, IE})
@Ignore(value = {CHROME, IE})
@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 @@ -28,6 +28,7 @@
import org.openqa.selenium.testing.InProject;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.JavascriptEnabled;
import org.openqa.selenium.testing.NotYetImplemented;

import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -284,7 +285,8 @@ public void testShouldThrowAnExceptionWhenTheJavascriptIsBad() {

@JavascriptEnabled
@Test
@Ignore(value = {CHROME, HTMLUNIT, IE, PHANTOMJS, SAFARI, MARIONETTE})
@Ignore(value = {CHROME, IE, PHANTOMJS, SAFARI, MARIONETTE})
@NotYetImplemented(HTMLUNIT)
public void testShouldThrowAnExceptionWithMessageAndStacktraceWhenTheJavascriptIsBad() {
driver.get(pages.xhtmlTestPage);

Expand Down Expand Up @@ -569,7 +571,8 @@ public void testShouldThrowAnExceptionWhenArgumentsWithStaleElementPassed() {

@JavascriptEnabled
@Test
@Ignore(value = {CHROME, HTMLUNIT, IE, PHANTOMJS, SAFARI, MARIONETTE})
@Ignore(value = {CHROME, IE, PHANTOMJS, SAFARI, MARIONETTE})
@NotYetImplemented(HTMLUNIT)
public void testShouldBeAbleToReturnADateObject() {
driver.get(pages.simpleTestPage);

Expand Down
14 changes: 9 additions & 5 deletions java/client/test/org/openqa/selenium/FormHandlingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.junit.Test;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NotYetImplemented;
import org.openqa.selenium.testing.TestUtilities;

import java.io.File;
Expand Down Expand Up @@ -263,8 +264,9 @@ public void testEmptyTextBoxesShouldReturnAnEmptyStringNotNull() {
}

@Test
@Ignore(value = {HTMLUNIT, PHANTOMJS, SAFARI, MARIONETTE},
@Ignore(value = {PHANTOMJS, SAFARI, MARIONETTE},
reason = "untested")
@NotYetImplemented(HTMLUNIT)
public void handleFormWithJavascriptAction() {
String url = appServer.whereIs("form_handling_js_submit.html");
driver.get(url);
Expand All @@ -290,15 +292,17 @@ public void testCanClickOnAnImplicitSubmitButton() {
checkSubmitButton("internal_implicit_submit");
}

@Ignore(value = {HTMLUNIT, IE, SAFARI},
reason = "IE, HtmlUnit: failed; Others: untested")
@Ignore(value = {IE, SAFARI},
reason = "IE: failed; Others: untested")
@NotYetImplemented(HTMLUNIT)
@Test
public void testCanClickOnAnExternalSubmitButton() {
checkSubmitButton("external_explicit_submit");
}

@Ignore(value = {HTMLUNIT, IE, SAFARI},
reason = "IE, HtmlUnit: failed; Others: untested")
@Ignore(value = {IE, SAFARI},
reason = "IE: failed; Others: untested")
@NotYetImplemented(HTMLUNIT)
@Test
public void testCanClickOnAnExternalImplicitSubmitButton() {
checkSubmitButton("external_implicit_submit");
Expand Down
7 changes: 5 additions & 2 deletions java/client/test/org/openqa/selenium/I18nTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.openqa.selenium.environment.GlobalTestEnvironment;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.NotYetImplemented;
import org.openqa.selenium.testing.TestUtilities;

import java.util.Arrays;
Expand Down Expand Up @@ -129,9 +130,10 @@ public void testShouldBeAbleToReturnTheTextInAPage() {
}

@NeedsFreshDriver
@Ignore(value = {IE, CHROME, HTMLUNIT, FIREFOX},
@Ignore(value = {IE, CHROME, FIREFOX},
reason = "Not implemented on anything other than"
+ "Firefox/Linux at the moment.")
@NotYetImplemented(HTMLUNIT)
@Test
public void testShouldBeAbleToActivateIMEEngine() throws InterruptedException {
assumeTrue("IME is supported on Linux only.",
Expand Down Expand Up @@ -179,9 +181,10 @@ public void testShouldBeAbleToActivateIMEEngine() throws InterruptedException {
+ " It was:" + elementValue, elementValue.equals(tokyo));
}

@Ignore(value = {IE, CHROME, HTMLUNIT},
@Ignore(value = {IE, CHROME},
reason = "Not implemented on anything other than"
+ "Firefox/Linux at the moment.")
@NotYetImplemented(HTMLUNIT)
@Test
public void testShouldBeAbleToInputJapanese() {
assumeTrue("IME is supported on Linux only.",
Expand Down
27 changes: 17 additions & 10 deletions java/client/test/org/openqa/selenium/PageLoadingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.JavascriptEnabled;
import org.openqa.selenium.testing.NeedsLocalEnvironment;
import org.openqa.selenium.testing.NotYetImplemented;
import org.openqa.selenium.testing.drivers.SauceDriver;
import org.openqa.selenium.testing.drivers.WebDriverBuilder;

Expand All @@ -79,7 +80,8 @@ private void initLocalDriver(String strategy) {
localDriver = new WebDriverBuilder().setDesiredCapabilities(caps).get();
}

@Ignore(value = {CHROME, SAFARI, MARIONETTE, PHANTOMJS, HTMLUNIT})
@Ignore(value = {CHROME, SAFARI, MARIONETTE, PHANTOMJS})
@NotYetImplemented(HTMLUNIT)
@NeedsLocalEnvironment
@Test
public void testNoneStrategyShouldNotWaitForPageToLoad() {
Expand All @@ -97,7 +99,8 @@ public void testNoneStrategyShouldNotWaitForPageToLoad() {
assertTrue("Took too long to load page: " + duration, duration < 1000);
}

@Ignore(value = {CHROME, SAFARI, MARIONETTE, PHANTOMJS, HTMLUNIT})
@Ignore(value = {CHROME, SAFARI, MARIONETTE, PHANTOMJS})
@NotYetImplemented(HTMLUNIT)
@NeedsLocalEnvironment
@Test
public void testNoneStrategyShouldNotWaitForPageToRefresh() {
Expand All @@ -119,7 +122,7 @@ public void testNoneStrategyShouldNotWaitForPageToRefresh() {
assertTrue("Took too long to load page: " + duration, duration < 1000);
}

@Ignore(value = {IE, CHROME, SAFARI, MARIONETTE, PHANTOMJS, HTMLUNIT})
@Ignore(value = {IE, CHROME, SAFARI, MARIONETTE, PHANTOMJS})
@NeedsLocalEnvironment
@Test
public void testEagerStrategyShouldNotWaitForResources() {
Expand All @@ -140,7 +143,7 @@ public void testEagerStrategyShouldNotWaitForResources() {
assertTrue("Took too long to load page: " + duration, duration < 5 * 1000);
}

@Ignore(value = {IE, CHROME, SAFARI, MARIONETTE, PHANTOMJS, HTMLUNIT})
@Ignore(value = {IE, CHROME, SAFARI, MARIONETTE, PHANTOMJS})
@NeedsLocalEnvironment
@Test
public void testEagerStrategyShouldNotWaitForResourcesOnRefresh() {
Expand Down Expand Up @@ -252,8 +255,9 @@ public void testShouldBeAbleToLoadAPageWithFramesetsAndWaitUntilAllFramesAreLoad
assertThat(pageNumber.getText().trim(), equalTo("2"));
}

@Ignore(value = {SAFARI, HTMLUNIT, MARIONETTE}, issues = {3771},
@Ignore(value = {SAFARI, MARIONETTE}, issues = {3771},
reason = "HtmlUnit: can't execute JavaScript before a page is loaded")
@NotYetImplemented(HTMLUNIT)
@JavascriptEnabled
@NeedsFreshDriver
@NoDriverAfterTest
Expand Down Expand Up @@ -327,7 +331,8 @@ public void testShouldBeAbleToAccessPagesWithAnInsecureSslCertificate() {
assertThat(driver.getTitle(), equalTo("Hello WebDriver"));
}

@Ignore({CHROME, HTMLUNIT, IE, PHANTOMJS, SAFARI, MARIONETTE})
@Ignore({CHROME, IE, PHANTOMJS, SAFARI, MARIONETTE})
@NotYetImplemented(HTMLUNIT)
@Test
public void shouldBeAbleToDisableAcceptOfInsecureSslCertsWithRequiredCapability() {
// TODO: Resolve why this test doesn't work on the remote server
Expand Down Expand Up @@ -378,9 +383,9 @@ public void testShouldNotHangIfDocumentOpenCallIsNeverFollowedByDocumentCloseCal

// Note: If this test ever fixed/enabled on Firefox, check if it also needs @NoDriverAfterTest OR
// if @NoDriverAfterTest can be removed from some other tests in this class.
@Ignore(value = {HTMLUNIT, FIREFOX, MARIONETTE, SAFARI, PHANTOMJS},
@Ignore(value = {FIREFOX, HTMLUNIT, MARIONETTE, SAFARI, PHANTOMJS},
reason = "Firefox: fails; Marionette: Not implemented; Safari: see issue 687, comment 41;"
+ "PHANTOMJS, HTMLUNIT: not tested",
+ "PHANTOMJS: not tested",
issues = {687})
@NeedsLocalEnvironment
@Test
Expand Down Expand Up @@ -411,9 +416,10 @@ public void testShouldTimeoutIfAPageTakesTooLongToLoad() {
wait.until(titleIs("XHTML Test Page"));
}

@Ignore(value = {HTMLUNIT, SAFARI, MARIONETTE},
@Ignore(value = {SAFARI, MARIONETTE},
reason = "Not implemented; Safari: see issue 687, comment 41",
issues = {687})
@NotYetImplemented(HTMLUNIT)
@NeedsLocalEnvironment
@NoDriverAfterTest // Subsequent tests sometimes fail on Firefox.
@Test
Expand Down Expand Up @@ -485,9 +491,10 @@ public void testShouldTimeoutIfAPageTakesTooLongToRefresh() {
wait.until(titleIs("XHTML Test Page"));
}

@Ignore(value = {CHROME, HTMLUNIT, SAFARI, MARIONETTE},
@Ignore(value = {CHROME, SAFARI, MARIONETTE},
reason = "Not implemented; Safari: see issue 687, comment 41",
issues = {687})
@NotYetImplemented(HTMLUNIT)
@NeedsLocalEnvironment
@NoDriverAfterTest // Subsequent tests sometimes fail on Firefox.
@Test
Expand Down
Loading

0 comments on commit 90f07e5

Please sign in to comment.