Modified:
/trunk/java/client/test/org/openqa/selenium/PageLoadingTest.java
/trunk/java/client/test/org/openqa/selenium/PartialLinkTextMatchTest.java
/trunk/java/client/test/org/openqa/selenium/PlatformTest.java
/trunk/java/client/test/org/openqa/selenium/PointTest.java
/trunk/java/client/test/org/openqa/selenium/ProxyTest.java
/trunk/java/client/test/org/openqa/selenium/RenderedWebElementTest.java
/trunk/java/client/test/org/openqa/selenium/RotatableTest.java
/trunk/java/client/test/org/openqa/selenium/SelectElementHandlingTest.java
/trunk/java/client/test/org/openqa/selenium/SlowLoadingPageTest.java
/trunk/java/client/test/org/openqa/selenium/SmallTests.java
/trunk/java/client/test/org/openqa/selenium/StaleElementReferenceTest.java
/trunk/java/client/test/org/openqa/selenium/StandardSeleniumTests.java
/trunk/java/client/test/org/openqa/selenium/SvgElementTest.java
=======================================
--- /trunk/java/client/test/org/openqa/selenium/PageLoadingTest.java Thu
Mar 1 09:34:18 2012
+++ /trunk/java/client/test/org/openqa/selenium/PageLoadingTest.java Sat
Mar 3 08:34:26 2012
@@ -17,40 +17,43 @@
package org.openqa.selenium;
-import static java.util.concurrent.TimeUnit.SECONDS;
-import static org.openqa.selenium.testing.Ignore.Driver.ANDROID;
-import static org.openqa.selenium.testing.Ignore.Driver.CHROME;
-import static org.openqa.selenium.testing.Ignore.Driver.HTMLUNIT;
-import static org.openqa.selenium.testing.Ignore.Driver.IE;
-import static org.openqa.selenium.testing.Ignore.Driver.IPHONE;
-import static org.openqa.selenium.testing.Ignore.Driver.OPERA;
-import static org.openqa.selenium.testing.Ignore.Driver.SELENESE;
-import static org.openqa.selenium.TestWaiter.waitFor;
-import static org.openqa.selenium.WaitingConditions.pageTitleToBe;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.anyOf;
-import static org.hamcrest.Matchers.equalTo;
-
+import org.junit.Test;
import org.openqa.selenium.environment.GlobalTestEnvironment;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.testing.Ignore;
+import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.JavascriptEnabled;
import org.openqa.selenium.testing.NeedsLocalEnvironment;
import org.openqa.selenium.testing.TestUtilities;
import org.openqa.selenium.testing.drivers.SauceDriver;
import org.openqa.selenium.testing.drivers.WebDriverBuilder;
-import java.util.concurrent.TimeUnit;
-
-public class PageLoadingTest extends AbstractDriverTestCase {
-
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.anyOf;
+import static org.hamcrest.Matchers.equalTo;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.openqa.selenium.TestWaiter.waitFor;
+import static org.openqa.selenium.WaitingConditions.pageTitleToBe;
+import static org.openqa.selenium.testing.Ignore.Driver.ANDROID;
+import static org.openqa.selenium.testing.Ignore.Driver.CHROME;
+import static org.openqa.selenium.testing.Ignore.Driver.HTMLUNIT;
+import static org.openqa.selenium.testing.Ignore.Driver.IE;
+import static org.openqa.selenium.testing.Ignore.Driver.IPHONE;
+import static org.openqa.selenium.testing.Ignore.Driver.OPERA;
+import static org.openqa.selenium.testing.Ignore.Driver.SELENESE;
+
+public class PageLoadingTest extends JUnit4TestBase {
+
+ @Test
public void testShouldWaitForDocumentToBeLoaded() {
driver.get(pages.simpleTestPage);
assertThat(driver.getTitle(), equalTo("Hello WebDriver"));
}
+ @Test
public void testShouldFollowRedirectsSentInTheHttpResponseHeaders() {
driver.get(pages.redirectPage);
@@ -58,12 +61,14 @@
}
@Ignore(ANDROID)
+ @Test
public void testShouldFollowMetaRedirects() throws Exception {
driver.get(pages.metaRedirectPage);
assertThat(driver.getTitle(), equalTo("We Arrive Here"));
}
@Ignore(SELENESE)
+ @Test
public void testShouldBeAbleToGetAFragmentOnTheCurrentPage() {
driver.get(pages.xhtmlTestPage);
driver.get(pages.xhtmlTestPage + "#text");
@@ -71,6 +76,7 @@
}
@Ignore(SELENESE)
+ @Test
public void testShouldReturnWhenGettingAUrlThatDoesNotResolve() {
try {
// Of course, we're up the creek if this ever does get registered
@@ -83,12 +89,14 @@
}
@Ignore({IPHONE, SELENESE})
+ @Test
public void testShouldReturnWhenGettingAUrlThatDoesNotConnect() {
// Here's hoping that there's nothing here. There shouldn't be
driver.get("http://localhost:3001");
}
@Ignore({IPHONE, SELENESE, ANDROID})
+ @Test
public void
testShouldBeAbleToLoadAPageWithFramesetsAndWaitUntilAllFramesAreLoaded() {
driver.get(pages.framesetPage);
@@ -103,6 +111,7 @@
@Ignore({IPHONE, SELENESE})
@NeedsFreshDriver
+ @Test
public void testShouldDoNothingIfThereIsNothingToGoBackTo() {
if (SauceDriver.shouldUseSauce() &&
TestUtilities.isInternetExplorer(driver)) {
// Sauce opens about:blank after the browser loads, which IE doesn't
include in history
@@ -121,6 +130,7 @@
}
@Ignore({SELENESE, ANDROID})
+ @Test
public void testShouldBeAbleToNavigateBackInTheBrowserHistory() {
driver.get(pages.formPage);
@@ -132,6 +142,7 @@
}
@Ignore(SELENESE)
+ @Test
public void
testShouldBeAbleToNavigateBackInTheBrowserHistoryInPresenceOfIframes() {
driver.get(pages.xhtmlTestPage);
@@ -146,6 +157,7 @@
}
@Ignore({SELENESE, ANDROID})
+ @Test
public void testShouldBeAbleToNavigateForwardsInTheBrowserHistory() {
driver.get(pages.formPage);
@@ -163,6 +175,7 @@
}
@Ignore({IE, CHROME, SELENESE, IPHONE, OPERA, ANDROID})
+ @Test
public void testShouldBeAbleToAccessPagesWithAnInsecureSslCertificate() {
// TODO(user): Set the SSL capability to true.
String url =
GlobalTestEnvironment.get().getAppServer().whereIsSecure("simpleTest.html");
@@ -172,6 +185,7 @@
}
@Ignore(SELENESE)
+ @Test
public void testShouldBeAbleToRefreshAPage() {
driver.get(pages.xhtmlTestPage);
@@ -191,6 +205,7 @@
@Ignore(value = {IE, SELENESE, IPHONE, OPERA, ANDROID}, reason
= "Untested user-agents")
@NoDriverAfterTest
@JavascriptEnabled
+ @Test
public void
testShouldNotHangIfDocumentOpenCallIsNeverFollowedByDocumentCloseCall()
throws Exception {
driver.get(pages.documentWrite);
@@ -201,6 +216,7 @@
}
@Ignore
+ @Test
public void
testShouldNotWaitIndefinitelyIfAnExternalResourceFailsToLoad() {
String slowPage = appServer.whereIs("slowLoadingResourcePage.html");
@@ -227,6 +243,7 @@
@Ignore(value = {ANDROID, CHROME, HTMLUNIT, IE, IPHONE, OPERA,
SELENESE}, reason = "Not implemented")
@NeedsLocalEnvironment
+ @Test
public void testShouldTimeoutIfAPageTakesTooLongToLoad() {
driver.manage().timeouts().pageLoadTimeout(2, SECONDS);
=======================================
---
/trunk/java/client/test/org/openqa/selenium/PartialLinkTextMatchTest.java
Mon Dec 12 06:22:05 2011
+++
/trunk/java/client/test/org/openqa/selenium/PartialLinkTextMatchTest.java
Sat Mar 3 08:34:26 2012
@@ -17,16 +17,22 @@
package org.openqa.selenium;
+import org.junit.Test;
import org.openqa.selenium.testing.Ignore;
-
+import org.openqa.selenium.testing.JUnit4TestBase;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
import static org.openqa.selenium.testing.Ignore.Driver.REMOTE;
import static org.openqa.selenium.testing.Ignore.Driver.SELENESE;
import java.util.List;
-public class PartialLinkTextMatchTest extends AbstractDriverTestCase {
+public class PartialLinkTextMatchTest extends JUnit4TestBase {
@Ignore({REMOTE, SELENESE})
+ @Test
public void testLinkWithFormattingTags() {
driver.get(pages.simpleTestPage);
WebElement elem = driver.findElement(By.id("links"));
@@ -38,6 +44,7 @@
}
@Ignore({REMOTE})
+ @Test
public void testLinkWithLeadingSpaces() {
driver.get(pages.simpleTestPage);
WebElement elem = driver.findElement(By.id("links"));
@@ -48,6 +55,7 @@
}
@Ignore({REMOTE})
+ @Test
public void testLinkWithTrailingSpace() {
driver.get(pages.simpleTestPage);
WebElement elem = driver.findElement(By.id("links"));
@@ -59,6 +67,7 @@
}
@Ignore({REMOTE})
+ @Test
public void testFindMultipleElements() {
driver.get(pages.simpleTestPage);
WebElement elem = driver.findElement(By.id("links"));
@@ -69,6 +78,7 @@
assertEquals(6, elements.size());
}
+ @Test
public void testDriverCanGetLinkByLinkTestIgnoringTrailingWhitespace() {
driver.get(pages.simpleTestPage);
WebElement link = null;
@@ -80,6 +90,7 @@
assertEquals("linkWithTrailingSpace", link.getAttribute("id"));
}
+ @Test
public void testElementCanGetLinkByLinkTestIgnoringTrailingWhitespace() {
driver.get(pages.simpleTestPage);
WebElement elem = driver.findElement(By.id("links"));
=======================================
--- /trunk/java/client/test/org/openqa/selenium/PlatformTest.java Thu Nov
3 10:48:03 2011
+++ /trunk/java/client/test/org/openqa/selenium/PlatformTest.java Sat Mar
3 08:34:26 2012
@@ -18,26 +18,34 @@
package org.openqa.selenium;
-import junit.framework.TestCase;
-
-public class PlatformTest extends TestCase {
-
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+public class PlatformTest {
+
+ @Test
public void testShouldIdentifyWindowsVariants() {
assertAllAre(Platform.WINDOWS, "Windows 2003");
}
+ @Test
public void testShouldIdentifyMacVariants() {
assertAllAre(Platform.MAC, "Darwin", "Mac OS X");
}
+ @Test
public void testShouldIdentifyUnixVariants() {
assertAllAre(Platform.UNIX, "solaris", "bsd");
}
+ @Test
public void testShouldIdentifyLinux() {
assertAllAre(Platform.LINUX, "Linux");
}
+ @Test
public void testShouldDistinctUnixFromLinux() {
Platform linPlatform = Platform.extractFromSysProperty("Linux");
assertTrue("Linux should be identified as Unix",
linPlatform.is(Platform.UNIX));
=======================================
--- /trunk/java/client/test/org/openqa/selenium/PointTest.java Tue Feb 1
08:14:52 2011
+++ /trunk/java/client/test/org/openqa/selenium/PointTest.java Sat Mar 3
08:34:26 2012
@@ -1,19 +1,24 @@
// Copyright 2011 Google Inc. All Rights Reserved.
package org.openqa.selenium;
-import junit.framework.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotSame;
/**
* Tests WebDriver's Point class.
*/
-public class PointTest extends TestCase {
-
+public class PointTest {
+
+ @Test
public void testSimpleAssignment() {
Point p1 = new Point(30, 50);
assertEquals(30, p1.getX());
assertEquals(50, p1.getY());
}
+ @Test
public void testEquality() {
Point p1 = new Point(30, 60);
Point p2 = new Point(40, 60);
@@ -28,6 +33,7 @@
assertEquals(p1.hashCode(), p1copy.hashCode());
}
+ @Test
public void testMoveBy() {
Point p1 = new Point(31, 42);
=======================================
--- /trunk/java/client/test/org/openqa/selenium/ProxyTest.java Tue Aug 23
14:17:36 2011
+++ /trunk/java/client/test/org/openqa/selenium/ProxyTest.java Sat Mar 3
08:34:26 2012
@@ -1,10 +1,15 @@
package org.openqa.selenium;
+import org.junit.Test;
import org.openqa.selenium.Proxy.ProxyType;
-import junit.framework.TestCase;
-
-public class ProxyTest extends TestCase {
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.fail;
+
+public class ProxyTest {
+ @Test
public void testUnspecified() {
Proxy proxy = new Proxy();
assertEquals(ProxyType.UNSPECIFIED, proxy.getProxyType());
@@ -13,6 +18,7 @@
assertNull(proxy.getProxyAutoconfigUrl());
}
+ @Test
public void testDirect() {
Proxy proxy = new Proxy();
proxy.setProxyType(ProxyType.DIRECT);
@@ -24,6 +30,7 @@
}
}
+ @Test
public void testManual() {
Proxy proxy = new Proxy();
proxy.setHttpProxy("foo:1234");
@@ -46,6 +53,7 @@
}
}
+ @Test
public void testPac() {
Proxy proxy = new Proxy();
proxy.setProxyAutoconfigUrl("http://aaa/bbb.pac");
=======================================
--- /trunk/java/client/test/org/openqa/selenium/RenderedWebElementTest.java
Tue Jan 31 03:50:44 2012
+++ /trunk/java/client/test/org/openqa/selenium/RenderedWebElementTest.java
Sat Mar 3 08:34:26 2012
@@ -16,6 +16,22 @@
*/
package org.openqa.selenium;
+import org.junit.Test;
+import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.testing.Ignore;
+import org.openqa.selenium.testing.JUnit4TestBase;
+import org.openqa.selenium.testing.JavascriptEnabled;
+import org.openqa.selenium.testing.TestUtilities;
+import org.openqa.selenium.testing.drivers.SauceDriver;
+
+import java.util.concurrent.Callable;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.anyOf;
+import static org.hamcrest.Matchers.equalTo;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.openqa.selenium.TestWaiter.waitFor;
import static org.openqa.selenium.testing.Ignore.Driver.ANDROID;
import static org.openqa.selenium.testing.Ignore.Driver.CHROME;
import static org.openqa.selenium.testing.Ignore.Driver.FIREFOX;
@@ -24,25 +40,12 @@
import static org.openqa.selenium.testing.Ignore.Driver.IPHONE;
import static org.openqa.selenium.testing.Ignore.Driver.OPERA;
import static org.openqa.selenium.testing.Ignore.Driver.SELENESE;
-import static org.openqa.selenium.TestWaiter.waitFor;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.anyOf;
-import static org.hamcrest.Matchers.equalTo;
-
-import org.openqa.selenium.interactions.Actions;
-import org.openqa.selenium.remote.CapabilityType;
-import org.openqa.selenium.testing.Ignore;
-import org.openqa.selenium.testing.JavascriptEnabled;
-import org.openqa.selenium.testing.TestUtilities;
-import org.openqa.selenium.testing.drivers.SauceDriver;
-
-import java.util.concurrent.Callable;
-
-public class RenderedWebElementTest extends AbstractDriverTestCase {
+
+public class RenderedWebElementTest extends JUnit4TestBase {
@JavascriptEnabled
@Ignore({SELENESE, OPERA, ANDROID})
+ @Test
public void testShouldPickUpStyleOfAnElement() {
driver.get(pages.javascriptPage);
@@ -69,6 +72,7 @@
@JavascriptEnabled
@Ignore({IE, CHROME, SELENESE, IPHONE, OPERA, ANDROID})
// Reason for Chrome: WebKit bug 28804
+ @Test
public void testShouldHandleNonIntegerPositionAndSize() {
driver.get(pages.rectanglesPage);
@@ -87,6 +91,7 @@
@JavascriptEnabled
@Ignore({SELENESE, IPHONE, OPERA, ANDROID})
+ @Test
public void testShouldAllowInheritedStylesToBeUsed() {
driver.get(pages.javascriptPage);
@@ -103,6 +108,7 @@
@Ignore(
value = {FIREFOX, HTMLUNIT, IPHONE, SELENESE, OPERA},
reason = "HtmlUnit: Advanced mouse actions only implemented in
rendered browsers. Firefox: hover is broken again.")
+ @Test
public void testShouldAllowUsersToHoverOverElements() {
if (!hasInputDevices()) {
return;
@@ -142,6 +148,7 @@
@Ignore(
value = {FIREFOX, HTMLUNIT, IPHONE, SELENESE, OPERA},
reason = "HtmlUnit: Advanced mouse actions only implemented in
rendered browsers")
+ @Test
public void testHoverPersists() throws Exception {
if (!hasInputDevices()) {
return;
@@ -180,6 +187,7 @@
}
@JavascriptEnabled
+ @Test
public void testShouldCorrectlyIdentifyThatAnElementHasWidth() {
driver.get(pages.xhtmlTestPage);
@@ -191,6 +199,7 @@
@JavascriptEnabled
@Ignore(SELENESE)
+ @Test
public void testCorrectlyDetectMapElementsAreShown() {
driver.get(pages.mapVisibilityPage);
@@ -202,6 +211,7 @@
@Ignore
@JavascriptEnabled
+ @Test
public void testCanClickOnSuckerFishMenuItem() throws Exception {
if (!hasInputDevices()) {
return;
@@ -228,6 +238,7 @@
@JavascriptEnabled
@Ignore(value = {HTMLUNIT, SELENESE},
reason = "Advanced mouse actions only implemented in rendered
browsers")
+ @Test
public void testMovingMouseByRelativeOffset() {
if (!hasInputDevices() |
| !TestUtilities.isNativeEventsEnabled(driver)) {
System.out.println(
@@ -253,6 +264,7 @@
@JavascriptEnabled
@Ignore(value = {HTMLUNIT, SELENESE},
reason = "Advanced mouse actions only implemented in rendered
browsers")
+ @Test
public void testMovingMouseToRelativeElementOffset() {
if (!hasInputDevices() |
| !TestUtilities.isNativeEventsEnabled(driver)) {
System.out.println(
@@ -275,6 +287,7 @@
@JavascriptEnabled
@NeedsFreshDriver
@Ignore(value = {CHROME, HTMLUNIT, SELENESE}, reason = "Advanced mouse
actions only implemented in rendered browsers")
+ @Test
public void testMoveRelativeToBody() {
if (!hasInputDevices() |
| !TestUtilities.isNativeEventsEnabled(driver)) {
System.out.println(
=======================================
--- /trunk/java/client/test/org/openqa/selenium/RotatableTest.java Wed Aug
24 13:25:56 2011
+++ /trunk/java/client/test/org/openqa/selenium/RotatableTest.java Sat Mar
3 08:34:26 2012
@@ -17,12 +17,19 @@
package org.openqa.selenium;
-public class RotatableTest extends AbstractDriverTestCase {
+import org.junit.Test;
+import org.openqa.selenium.testing.JUnit4TestBase;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+public class RotatableTest extends JUnit4TestBase {
private boolean isRotatable() {
- return (driver instanceof Rotatable) ? true : false;
+ return driver instanceof Rotatable;
}
+ @Test
public void testRotateToLandscapeMode() {
if (!isRotatable()) {
return;
@@ -32,6 +39,7 @@
assertEquals(ScreenOrientation.LANDSCAPE, rotatable.getOrientation());
}
+ @Test
public void testRotateToPortrait() {
if (!isRotatable()) {
return;
@@ -41,6 +49,7 @@
assertEquals(ScreenOrientation.PORTRAIT, rotatable.getOrientation());
}
+ @Test
public void testGetOrientationReturnsInitialValue() {
if (!isRotatable()) {
return;
=======================================
---
/trunk/java/client/test/org/openqa/selenium/SelectElementHandlingTest.java
Tue Jan 17 11:20:41 2012
+++
/trunk/java/client/test/org/openqa/selenium/SelectElementHandlingTest.java
Sat Mar 3 08:34:26 2012
@@ -17,8 +17,11 @@
package org.openqa.selenium;
+import org.junit.Test;
import org.openqa.selenium.testing.Ignore;
-
+import org.openqa.selenium.testing.JUnit4TestBase;
+
+import static org.junit.Assert.assertTrue;
import static org.openqa.selenium.testing.Ignore.Driver.ANDROID;
import static org.openqa.selenium.testing.Ignore.Driver.CHROME;
import static org.openqa.selenium.testing.Ignore.Driver.IPHONE;
@@ -30,9 +33,10 @@
import java.util.List;
-public class SelectElementHandlingTest extends AbstractDriverTestCase {
+public class SelectElementHandlingTest extends JUnit4TestBase {
@Ignore({CHROME, SELENESE, IPHONE, OPERA, ANDROID})
+ @Test
public void
testShouldBePossibleToDeselectASingleOptionFromASelectWhichAllowsMultipleChoices()
{
driver.get(pages.formPage);
@@ -51,6 +55,7 @@
}
@Ignore({OPERA, SELENESE, ANDROID})
+ @Test
public void testShouldBeAbleToChangeTheSelectedOptionInASelect() {
driver.get(pages.formPage);
WebElement selectBox =
driver.findElement(By.xpath("//select[@name='selectomatic']"));
@@ -66,6 +71,7 @@
}
@Ignore({SELENESE, ANDROID})
+ @Test
public void
testShouldBeAbleToSelectMoreThanOneOptionFromASelectWhichAllowsMultipleChoices()
{
driver.get(pages.formPage);
@@ -85,6 +91,7 @@
}
@Ignore({SELENESE, ANDROID})
+ @Test
public void testShouldSelectFirstOptionByDefaultIfNoneIsSelected() {
driver.get(pages.formPage);
WebElement selectBox =
driver.findElement(By.xpath("//select[@name='select-default']"));
@@ -100,13 +107,15 @@
}
@Ignore({SELENESE, CHROME})
+ @Test
public void testCanSelectElementsInOptGroups() {
driver.get(pages.selectPage);
WebElement element = driver.findElement(By.id("two-in-group"));
element.click();
assertTrue("Expected to be selected", element.isSelected());
}
-
+
+ @Test
public void
testCanGetValueFromOptionViaAttributeWhenAttributeDoesntExist() {
driver.get(pages.formPage);
WebElement element =
driver.findElement(By.cssSelector("select[name='select-default'] option"));
@@ -114,7 +123,8 @@
element = driver.findElement(By.id("blankOption"));
assertThat(element.getAttribute("value"), is(""));
}
-
+
+ @Test
public void
testCanGetValueFromOptionViaAttributeWhenAttributeIsEmptyString() {
driver.get(pages.formPage);
WebElement element = driver.findElement(By.id("optionEmptyValueSet"));
=======================================
--- /trunk/java/client/test/org/openqa/selenium/SlowLoadingPageTest.java
Mon Dec 12 06:22:05 2011
+++ /trunk/java/client/test/org/openqa/selenium/SlowLoadingPageTest.java
Sat Mar 3 08:34:26 2012
@@ -1,17 +1,21 @@
package org.openqa.selenium;
+import org.junit.Test;
import org.openqa.selenium.testing.Ignore;
-
+import org.openqa.selenium.testing.JUnit4TestBase;
+
+import static org.junit.Assert.assertTrue;
import static org.openqa.selenium.testing.Ignore.Driver.IE;
import static org.openqa.selenium.testing.Ignore.Driver.IPHONE;
import static org.openqa.selenium.testing.Ignore.Driver.OPERA;
import static org.openqa.selenium.testing.Ignore.Driver.SELENESE;
-public class SlowLoadingPageTest extends AbstractDriverTestCase {
+public class SlowLoadingPageTest extends JUnit4TestBase {
private static final long LOAD_TIME_IN_SECONDS = 3;
@Ignore(value = {IPHONE}, reason = "Untested browsers")
+ @Test
public void testShouldBlockUntilPageLoads() throws Exception {
long start = System.currentTimeMillis();
driver.get(pages.sleepingPage + "?time=" + LOAD_TIME_IN_SECONDS);
@@ -20,6 +24,7 @@
}
@Ignore(SELENESE)
+ @Test
public void testShouldBlockUntilIFramesAreLoaded() throws Exception {
long start = System.currentTimeMillis();
driver.get(pages.slowIframes);
@@ -29,6 +34,7 @@
@Ignore(value = {IE, IPHONE, SELENESE, OPERA},
reason = "Selenium: refresh is unsupported; IE: fails in IE 6,7,8,
works in IE 9, Others: untested")
+ @Test
public void testRefreshShouldBlockUntilPageLoads() {
long start = System.currentTimeMillis();
driver.get(pages.sleepingPage + "?time=" + LOAD_TIME_IN_SECONDS);
=======================================
--- /trunk/java/client/test/org/openqa/selenium/SmallTests.java Fri Mar 2
05:35:52 2012
+++ /trunk/java/client/test/org/openqa/selenium/SmallTests.java Sat Mar 3
08:34:26 2012
@@ -33,6 +33,9 @@
IgnoreComparitorUnitTest.class,
IndividualKeyboardActionsTest.class,
IndividualMouseActionsTest.class,
+ PlatformTest.class,
+ PointTest.class,
+ ProxyTest.class,
WebDriverExceptionTest.class
})
public class SmallTests {}
=======================================
---
/trunk/java/client/test/org/openqa/selenium/StaleElementReferenceTest.java
Thu Dec 29 10:57:19 2011
+++
/trunk/java/client/test/org/openqa/selenium/StaleElementReferenceTest.java
Sat Mar 3 08:34:26 2012
@@ -17,13 +17,17 @@
package org.openqa.selenium;
+import org.junit.Test;
import org.openqa.selenium.testing.Ignore;
+import org.openqa.selenium.testing.JUnit4TestBase;
import org.openqa.selenium.testing.JavascriptEnabled;
+import static org.junit.Assert.fail;
import static org.openqa.selenium.testing.Ignore.Driver.SELENESE;
-public class StaleElementReferenceTest extends AbstractDriverTestCase {
-
+public class StaleElementReferenceTest extends JUnit4TestBase {
+
+ @Test
public void testOldPage() {
driver.get(pages.simpleTestPage);
WebElement elem = driver.findElement(By.id("links"));
@@ -37,6 +41,7 @@
}
@JavascriptEnabled
+ @Test
public void testShouldNotCrashWhenCallingGetSizeOnAnObsoleteElement() {
driver.get(pages.simpleTestPage);
WebElement elem = driver.findElement(By.id("links"));
@@ -51,6 +56,7 @@
@JavascriptEnabled
@Ignore(SELENESE)
+ @Test
public void testShouldNotCrashWhenQueryingTheAttributeOfAStaleElement() {
driver.get(pages.xhtmlTestPage);
WebElement heading = driver.findElement(By.xpath("//h1"));
=======================================
--- /trunk/java/client/test/org/openqa/selenium/StandardSeleniumTests.java
Fri Mar 2 08:23:54 2012
+++ /trunk/java/client/test/org/openqa/selenium/StandardSeleniumTests.java
Sat Mar 3 08:34:26 2012
@@ -28,6 +28,14 @@
AlertsTest.class,
ExecutingAsyncJavascriptTest.class,
ImplicitWaitTest.class,
+ PageLoadingTest.class,
+ PartialLinkTextMatchTest.class,
+ RenderedWebElementTest.class,
+ RotatableTest.class,
+ SelectElementHandlingTest.class,
+ SlowLoadingPageTest.class,
+ StaleElementReferenceTest.class,
+ SvgElementTest.class,
TagNameTest.class,
TakesScreenshotTest.class,
TextHandlingTest.class,
=======================================
--- /trunk/java/client/test/org/openqa/selenium/SvgElementTest.java Fri Dec
16 07:07:14 2011
+++ /trunk/java/client/test/org/openqa/selenium/SvgElementTest.java Sat
Mar 3 08:34:26 2012
@@ -17,8 +17,12 @@
package org.openqa.selenium;
+import org.junit.Test;
import org.openqa.selenium.testing.Ignore;
-
+import org.openqa.selenium.testing.JUnit4TestBase;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.openqa.selenium.testing.Ignore.Driver.CHROME;
import static org.openqa.selenium.testing.Ignore.Driver.HTMLUNIT;
import static org.openqa.selenium.testing.Ignore.Driver.IE;
@@ -35,8 +39,9 @@
@Ignore(
value = {HTMLUNIT, IE, CHROME, REMOTE, SELENESE, OPERA},
reason = "HtmlUnit: SVG interaction is only implemented in rendered
browsers")
-public class SvgElementTest extends AbstractDriverTestCase {
-
+public class SvgElementTest extends JUnit4TestBase {
+
+ @Test
public void testShouldClickOnGraphVisualElements() {
driver.get(pages.svgPage);
WebElement svg = driver.findElement(By.tagName("svg:svg"));
@@ -73,6 +78,7 @@
return null;
}
+ @Test
public void testShouldClickOnGraphTextElements() {
driver.get(pages.svgPage);
WebElement svg = driver.findElement(By.tagName("svg:svg"));