Skip to content

Commit

Permalink
Removing tests for SeleniumBackedWebDriver
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Apr 20, 2013
1 parent f5157fb commit ee8ae7d
Show file tree
Hide file tree
Showing 63 changed files with 246 additions and 533 deletions.
4 changes: 0 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,6 @@ task :android_server => ['//android:android-server']
# TODO(simon): test-core should go first, but it's changing the least for now.
task :test_selenium => [ :'test-rc', :'test-v1-emulation', :'test-selenium-backed-webdriver', :'test-core']

task :'test-selenium-backed-webdriver' => [
'//javascript/selenium-atoms:test:run',
'//java/client/test/org/openqa/selenium/v1:selenium-backed-webdriver-test:run'
]
task :'test-v1-emulation' => [ '//java/client/test/com/thoughtworks/selenium:firefox-emulation-test:run' ]
task :'test-rc' => ['//java/client/test/org/openqa/selenium:RcBrowserLauncherTests:run',
'//java/server/test/org/openqa/selenium/server:RcServerUnitTests:run',
Expand Down
1 change: 0 additions & 1 deletion java/client/src/org/openqa/selenium/build.desc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ java_library(name = "client-combined",
"//java/client/src/org/openqa/selenium/remote",
"//java/client/src/org/openqa/selenium/safari",
"//java/client/src/org/openqa/selenium:selenium-api",
"//java/client/src/org/openqa/selenium:selenium-backed-webdriver",
"//java/client/src/org/openqa/selenium/support",
"//java/client/src/org/openqa/selenium:webdriver-backed-selenium",
"//java/client/src/org/openqa/selenium/remote:augmenter",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import org.openqa.selenium.testing.InProject;
import org.openqa.selenium.testing.drivers.Browser;
import org.openqa.selenium.testing.drivers.WebDriverBuilder;
import org.openqa.selenium.v1.SeleneseBackedWebDriver;
import org.openqa.selenium.v1.SeleniumTestEnvironment;

import java.io.File;
Expand Down Expand Up @@ -154,10 +153,13 @@ protected void before() throws Throwable {
caps.setCapability("selenium.base.url", baseUrl);
caps.setCapability("selenium.server.url", seleniumServerUrl);

WebDriver driver = new WebDriverBuilder().setDesiredCapabilities(caps).get();
if (driver instanceof SeleneseBackedWebDriver) {
selenium = ((SeleneseBackedWebDriver) driver).getWrappedSelenium();
if (Boolean.getBoolean("selenium.browser.selenium")) {
URL serverUrl = new URL(seleniumServerUrl);
selenium = new DefaultSelenium(serverUrl.getHost(), serverUrl.getPort(), determineBrowserName(), baseUrl);
selenium.start();

} else {
WebDriver driver = new WebDriverBuilder().setDesiredCapabilities(caps).get();
selenium = new WebDriverBackedSelenium(driver, baseUrl);
}

Expand All @@ -166,6 +168,37 @@ protected void before() throws Throwable {
}
};

private String determineBrowserName() {
String property = System.getProperty("selenium.browser");
if (property == null) {
return "*chrome"; // Default to firefox
}

if (property.startsWith("*")) {
return property;
}

Browser browser = Browser.valueOf(property);
switch (browser) {
case chrome:
return "*googlechrome";

case ie:
return "*iexplore";

case ff:
return "*firefox";

case safari:
return "*safari";

default:
fail("Attempt to use an unsupported browser: " + property);
}

return null; // we never get here.
}

public ExternalResource addNecessaryJavascriptCommands = new ExternalResource() {
@Override
protected void before() throws Throwable {
Expand Down
5 changes: 2 additions & 3 deletions java/client/test/org/openqa/selenium/AlertsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import static org.openqa.selenium.testing.Ignore.Driver.OPERA;
import static org.openqa.selenium.testing.Ignore.Driver.PHANTOMJS;
import static org.openqa.selenium.testing.Ignore.Driver.SAFARI;
import static org.openqa.selenium.testing.Ignore.Driver.SELENESE;
import static org.openqa.selenium.testing.Ignore.Driver.OPERA_MOBILE;

import org.openqa.selenium.testing.Ignore;
Expand All @@ -50,7 +49,7 @@

import java.util.Set;

@Ignore({ANDROID, HTMLUNIT, IPHONE, OPERA, PHANTOMJS, SAFARI, SELENESE, OPERA_MOBILE})
@Ignore({ANDROID, HTMLUNIT, IPHONE, OPERA, PHANTOMJS, SAFARI, OPERA_MOBILE})
public class AlertsTest extends JUnit4TestBase {

@Before
Expand Down Expand Up @@ -418,7 +417,7 @@ public void testShouldHandleAlertOnWindowClose() {
}

@JavascriptEnabled
@Ignore(value = {ANDROID, CHROME, HTMLUNIT, IPHONE, OPERA, SELENESE})
@Ignore(value = {ANDROID, CHROME, HTMLUNIT, IPHONE, OPERA})
@Test
public void testIncludesAlertTextInUnhandledAlertException() {
driver.findElement(By.id("alert")).click();
Expand Down
3 changes: 0 additions & 3 deletions java/client/test/org/openqa/selenium/ChildrenFindingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
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;

Expand All @@ -27,7 +26,6 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.openqa.selenium.testing.Ignore.Driver.SELENESE;


public class ChildrenFindingTest extends JUnit4TestBase {
Expand All @@ -39,7 +37,6 @@ public void testFindElementByXPath() {
assertThat(child.getAttribute("id"), is("2"));
}

@Ignore(value = SELENESE, reason = "Apparently Selenium is filtering results")
@Test
public void testFindingElementsOnElementByXPathShouldFindTopLevelElements() {
driver.get(pages.simpleTestPage);
Expand Down
3 changes: 1 addition & 2 deletions java/client/test/org/openqa/selenium/ClearTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
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.OPERA_MOBILE;
import static org.openqa.selenium.testing.Ignore.Driver.SELENESE;

@Ignore({SELENESE, ANDROID})
@Ignore({ANDROID})
public class ClearTest extends JUnit4TestBase {

@Test
Expand Down
15 changes: 7 additions & 8 deletions java/client/test/org/openqa/selenium/ClickScrollingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import static org.openqa.selenium.testing.Ignore.Driver.OPERA;
import static org.openqa.selenium.testing.Ignore.Driver.PHANTOMJS;
import static org.openqa.selenium.testing.Ignore.Driver.SAFARI;
import static org.openqa.selenium.testing.Ignore.Driver.SELENESE;

@Ignore(value = {ANDROID, HTMLUNIT}, reason = "Android: Race condition when click returns, "
+ "the UI did not finish scrolling..\nHtmlUnit: Scrolling requires rendering")
Expand Down Expand Up @@ -91,7 +90,7 @@ public void testShouldBeAbleToClickOnAnElementHiddenByOverflow() {
}

@JavascriptEnabled
@Ignore({OPERA, SELENESE})
@Ignore({OPERA})
@Test
public void testShouldNotScrollOverflowElementsWhichAreVisible() {
driver.get(appServer.whereIs("scroll2.html"));
Expand All @@ -104,7 +103,7 @@ public void testShouldNotScrollOverflowElementsWhichAreVisible() {
}

@JavascriptEnabled
@Ignore(value = {CHROME, IPHONE, PHANTOMJS, SAFARI, SELENESE},
@Ignore(value = {CHROME, IPHONE, PHANTOMJS, SAFARI},
reason = "Safari: button1 is scrolled to the bottom edge of the view, " +
"so additonal scrolling is still required for button2")
@Test
Expand Down Expand Up @@ -132,7 +131,7 @@ public void testShouldScrollOverflowElementsIfClickPointIsOutOfViewButElementIsI
}

@Test
@Ignore(value = {OPERA, IPHONE, SAFARI, SELENESE},
@Ignore(value = {OPERA, IPHONE, SAFARI},
reason = "Opera: fails, others: not tested")
public void testShouldBeAbleToClickElementInAFrameThatIsOutOfView() {
try {
Expand All @@ -147,7 +146,7 @@ public void testShouldBeAbleToClickElementInAFrameThatIsOutOfView() {
}

@Test
@Ignore(value = {OPERA, IPHONE, SAFARI, SELENESE},
@Ignore(value = {OPERA, IPHONE, SAFARI},
reason = "Opera: fails, others: not tested")
public void testShouldBeAbleToClickElementThatIsOutOfViewInAFrame() {
try {
Expand Down Expand Up @@ -175,7 +174,7 @@ public void testShouldNotBeAbleToClickElementThatIsOutOfViewInANonScrollableFram
}

@Test
@Ignore(value = {OPERA, IPHONE, SAFARI, SELENESE},
@Ignore(value = {OPERA, IPHONE, SAFARI},
reason = "Opera: fails, others: not tested")
public void testShouldBeAbleToClickElementThatIsOutOfViewInAFrameThatIsOutOfView() {
try {
Expand All @@ -190,7 +189,7 @@ public void testShouldBeAbleToClickElementThatIsOutOfViewInAFrameThatIsOutOfView
}

@Test
@Ignore(value = {OPERA, IPHONE, SAFARI, SELENESE},
@Ignore(value = {OPERA, IPHONE, SAFARI},
reason = "Opera: fails, others: not tested")
public void testShouldBeAbleToClickElementThatIsOutOfViewInANestedFrame() {
try {
Expand All @@ -206,7 +205,7 @@ public void testShouldBeAbleToClickElementThatIsOutOfViewInANestedFrame() {
}

@Test
@Ignore(value = {OPERA, IPHONE, SAFARI, SELENESE},
@Ignore(value = {OPERA, IPHONE, SAFARI},
reason = "Opera: fails, others: not tested")
public void testShouldBeAbleToClickElementThatIsOutOfViewInANestedFrameThatIsOutOfView() {
try {
Expand Down
25 changes: 12 additions & 13 deletions java/client/test/org/openqa/selenium/ClickTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import static org.openqa.selenium.testing.Ignore.Driver.OPERA;
import static org.openqa.selenium.testing.Ignore.Driver.OPERA_MOBILE;
import static org.openqa.selenium.testing.Ignore.Driver.SAFARI;
import static org.openqa.selenium.testing.Ignore.Driver.SELENESE;

public class ClickTest extends JUnit4TestBase {

Expand All @@ -63,7 +62,7 @@ public void testCanClickOnALinkAndFollowIt() {
waitFor(WaitingConditions.pageTitleToBe(driver, "XHTML Test Page"));
}

@Ignore(value = {CHROME, OPERA, SELENESE},
@Ignore(value = {CHROME, OPERA},
reason = "Not tested on these browsers.")
@Test
public void testCanClickOnALinkThatOverflowsAndFollowIt() {
Expand Down Expand Up @@ -99,7 +98,7 @@ public void testCanClickOnALinkThatUpdatesAnotherFrame() {
}

@JavascriptEnabled
@Ignore(value = {SELENESE, OPERA, ANDROID, OPERA_MOBILE},
@Ignore(value = {OPERA, ANDROID, OPERA_MOBILE},
reason = "Opera: Incorrect runtime retrieved; " +
"Android: fails when running with other tests.")
@Test
Expand All @@ -117,10 +116,10 @@ public void testElementsFoundByJsCanLoadUpdatesInAnotherFrame() {
}

@JavascriptEnabled
@Ignore(value = {SELENESE, OPERA, ANDROID, OPERA_MOBILE}, reason =
@Ignore(value = {OPERA, ANDROID, OPERA_MOBILE}, reason =
"Opera: Incorrect runtime retrieved, Android: fails when running with other tests.")
@Test
public void testJsLoactedElementsCanUpdateFramesIfFoundSomehowElse() {
public void testJsLocatedElementsCanUpdateFramesIfFoundSomehowElse() {
driver.switchTo().frame("source");

// Prime the cache of elements
Expand Down Expand Up @@ -150,15 +149,15 @@ public void testCanClickOnAnElementWithTopSetToANegativeNumber() {
assertEquals("click", log);
}

@Ignore(value = {ANDROID, IPHONE, SAFARI, SELENESE, OPERA_MOBILE}, reason = "Not tested")
@Ignore(value = {ANDROID, IPHONE, SAFARI, OPERA_MOBILE}, reason = "Not tested")
@Test
public void testShouldClickOnFirstBoundingClientRectWithNonZeroSize() {
driver.findElement(By.id("twoClientRects")).click();
waitFor(WaitingConditions.pageTitleToBe(driver, "XHTML Test Page"));
}

@JavascriptEnabled
@Ignore(value = {ANDROID, CHROME, OPERA, SELENESE}, reason = "Not implemented")
@Ignore(value = {ANDROID, CHROME, OPERA}, reason = "Not implemented")
@Test
public void testShouldSetRelatedTargetForMouseOver() {
driver.get(pages.javascriptPage);
Expand All @@ -179,7 +178,7 @@ public void testShouldSetRelatedTargetForMouseOver() {

@JavascriptEnabled
@NoDriverAfterTest
@Ignore(value = {ANDROID, IPHONE, OPERA, SAFARI, SELENESE, OPERA_MOBILE},
@Ignore(value = {ANDROID, IPHONE, OPERA, SAFARI, OPERA_MOBILE},
reason = "Doesn't support multiple windows; Safari: issue 3693")
@Test
public void testShouldOnlyFollowHrefOnce() {
Expand All @@ -199,7 +198,7 @@ public void testShouldOnlyFollowHrefOnce() {

@Ignore
public void testShouldSetRelatedTargetForMouseOut() {
fail("Must. Write. Meamingful. Test (but we don't fire mouse outs synthetically");
fail("Must. Write. Meaningful. Test (but we don't fire mouse outs synthetically");
}

@Test
Expand Down Expand Up @@ -270,8 +269,8 @@ public void testClicksASurroundingStrongTag() {
}

@Test
@Ignore(value = {CHROME, IE, OPERA, OPERA_MOBILE, ANDROID, IPHONE, SELENESE}, reason
= "Chrome: element is no clickable, Opera, IE: failed, others: not tested")
@Ignore(value = {CHROME, IE, OPERA, OPERA_MOBILE, ANDROID, IPHONE}, reason
= "Chrome: element is not clickable, Opera, IE: failed, others: not tested")
public void testCanClickAnImageMapArea() {
driver.get(appServer.whereIs("click_tests/google_map.html"));
driver.findElement(By.id("rectG")).click();
Expand All @@ -287,7 +286,7 @@ public void testCanClickAnImageMapArea() {
}

@Test
@Ignore(value = {HTMLUNIT, OPERA, OPERA_MOBILE, ANDROID, IPHONE, SELENESE}, reason
@Ignore(value = {HTMLUNIT, OPERA, OPERA_MOBILE, ANDROID, IPHONE}, reason
= "Not tested against these browsers")
public void testShouldBeAbleToClickOnAnElementGreaterThanTwoViewports() {
String url = appServer.whereIs("click_too_big.html");
Expand All @@ -301,7 +300,7 @@ public void testShouldBeAbleToClickOnAnElementGreaterThanTwoViewports() {
}

@Test
@Ignore(value = {CHROME, FIREFOX, HTMLUNIT, OPERA, OPERA_MOBILE, ANDROID, IPHONE, SELENESE}, reason
@Ignore(value = {CHROME, FIREFOX, HTMLUNIT, OPERA, OPERA_MOBILE, ANDROID, IPHONE}, reason
= "Chrome, Firefox: failed, others: not tested")
public void testShouldBeAbleToClickOnAnElementInFrameGreaterThanTwoViewports() {
String url = appServer.whereIs("click_too_big_in_frame.html");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@
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.REMOTE;
import static org.openqa.selenium.testing.Ignore.Driver.SELENESE;

@Ignore(SELENESE)
public class CookieImplementationTest extends JUnit4TestBase {

private DomainHelper domainHelper;
Expand Down Expand Up @@ -90,7 +88,6 @@ public void testShouldGetCookieByName() {
}

@JavascriptEnabled
@Ignore(SELENESE)
@Test
public void testShouldBeAbleToAddCookie() {
String key = generateUniqueKey();
Expand Down Expand Up @@ -218,7 +215,7 @@ public void testShouldNotGetCookieOnDifferentDomain() {
assertCookieIsNotPresentWithName(cookieName);
}

@Ignore(value = {ANDROID, CHROME, HTMLUNIT, IE, IPHONE, OPERA, SELENESE},
@Ignore(value = {ANDROID, CHROME, HTMLUNIT, IE, IPHONE, OPERA},
reason = "Untested browsers.")
@Test
public void testShouldBeAbleToAddToADomainWhichIsRelatedToTheCurrentDomain() {
Expand Down
3 changes: 1 addition & 2 deletions java/client/test/org/openqa/selenium/CoordinatesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@
import static org.openqa.selenium.testing.Ignore.Driver.SAFARI;
import static org.openqa.selenium.testing.Ignore.Driver.ANDROID;
import static org.openqa.selenium.testing.Ignore.Driver.IPHONE;
import static org.openqa.selenium.testing.Ignore.Driver.SELENESE;

import org.junit.Test;
import org.openqa.selenium.internal.Locatable;
import org.openqa.selenium.testing.Ignore;
import org.openqa.selenium.testing.JUnit4TestBase;

@Ignore(value = {HTMLUNIT, OPERA, OPERA_MOBILE, SAFARI, ANDROID, IPHONE, SELENESE},
@Ignore(value = {HTMLUNIT, OPERA, OPERA_MOBILE, SAFARI, ANDROID, IPHONE},
reason = "HtmlUnit: Getting coordinates requires rendering, "
+ "Opera: Not implemented, others: not tested")
public class CoordinatesTest extends JUnit4TestBase {
Expand Down
Loading

0 comments on commit ee8ae7d

Please sign in to comment.