Skip to content

Commit 9d132ee

Browse files
committed
Cleaning native event checks out of the tests
1 parent 73cffa2 commit 9d132ee

17 files changed

+17
-301
lines changed

Rakefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ task :tests => [
109109
"//java/client/test/org/openqa/selenium/htmlunit:test_basic",
110110
"//java/client/test/org/openqa/selenium/htmlunit:test_js",
111111
"//java/client/test/org/openqa/selenium/firefox:test_synthesized",
112-
"//java/client/test/org/openqa/selenium/firefox:test_native",
113112
"//java/client/test/org/openqa/selenium/ie:test",
114113
"//java/client/test/org/openqa/selenium/chrome:test",
115114
"//java/client/test/org/openqa/selenium/opera:test_blink",
@@ -179,7 +178,6 @@ task :test_grid => [
179178
task :test_ie => [ "//java/client/test/org/openqa/selenium/ie:test:run" ]
180179
task :test_jobbie => [ :test_ie ]
181180
task :test_firefox => [ "//java/client/test/org/openqa/selenium/firefox:test_synthesized:run" ]
182-
task :test_firefox_native => [ "//java/client/test/org/openqa/selenium/firefox:test_native:run" ]
183181
task :test_opera => [ "//java/client/test/org/openqa/selenium/opera:test_blink:run" ]
184182
task :test_remote_server => [ '//java/server/test/org/openqa/selenium/remote/server:small-tests:run' ]
185183
task :test_remote => [

java/client/test/org/openqa/selenium/AlertsTest.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import static org.junit.Assert.assertTrue;
2424
import static org.junit.Assert.fail;
2525
import static org.junit.Assume.assumeFalse;
26-
import static org.junit.Assume.assumeTrue;
2726
import static org.openqa.selenium.support.ui.ExpectedConditions.alertIsPresent;
2827
import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated;
2928
import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs;
@@ -34,12 +33,8 @@
3433
import static org.openqa.selenium.testing.Ignore.Driver.MARIONETTE;
3534
import static org.openqa.selenium.testing.Ignore.Driver.PHANTOMJS;
3635
import static org.openqa.selenium.testing.Ignore.Driver.SAFARI;
37-
import static org.openqa.selenium.testing.TestUtilities.getEffectivePlatform;
3836
import static org.openqa.selenium.testing.TestUtilities.getFirefoxVersion;
3937
import static org.openqa.selenium.testing.TestUtilities.isFirefox;
40-
import static org.openqa.selenium.testing.TestUtilities.isNativeEventsEnabled;
41-
42-
import java.util.Set;
4338

4439
import org.junit.Before;
4540
import org.junit.Test;
@@ -51,6 +46,8 @@
5146
import org.openqa.selenium.testing.NeedsLocalEnvironment;
5247
import org.openqa.selenium.testing.NotYetImplemented;
5348

49+
import java.util.Set;
50+
5451
@Ignore({PHANTOMJS, SAFARI})
5552
public class AlertsTest extends JUnit4TestBase {
5653

@@ -275,11 +272,6 @@ public void testSwitchingToMissingAlertThrows() throws Exception {
275272
@JavascriptEnabled
276273
@Test
277274
public void testSwitchingToMissingAlertInAClosedWindowThrows() throws Exception {
278-
assumeFalse("This test does not fail on itself, but it causes the subsequent tests to fail",
279-
isFirefox(driver) &&
280-
isNativeEventsEnabled(driver) &&
281-
getEffectivePlatform().is(Platform.LINUX));
282-
283275
String mainWindow = driver.getWindowHandle();
284276
try {
285277
driver.findElement(By.id("open-new-window")).click();
@@ -465,12 +457,6 @@ public void testShouldHandleAlertOnPageBeforeUnloadAtQuit() {
465457
@NotYetImplemented(value = HTMLUNIT,
466458
reason = "HtmlUnit: runs on the same test thread.")
467459
public void testShouldHandleAlertOnWindowClose() {
468-
if (isFirefox(driver) &&
469-
isNativeEventsEnabled(driver) &&
470-
getEffectivePlatform().is(Platform.LINUX)) {
471-
System.err.println("x_ignore_nofocus can cause a firefox crash here. Ignoring test. See issue 2987.");
472-
assumeTrue(false);
473-
}
474460
assumeFalse("Firefox 27 does not trigger alerts on unload",
475461
isFirefox(driver) && getFirefoxVersion(driver) >= 27);
476462
String mainWindow = driver.getWindowHandle();

java/client/test/org/openqa/selenium/ClickTest.java

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@
2929
import static org.openqa.selenium.testing.Ignore.Driver.IE;
3030
import static org.openqa.selenium.testing.Ignore.Driver.MARIONETTE;
3131
import static org.openqa.selenium.testing.Ignore.Driver.SAFARI;
32-
import static org.openqa.selenium.testing.TestUtilities.isChrome;
3332
import static org.openqa.selenium.testing.TestUtilities.getEffectivePlatform;
34-
import static org.openqa.selenium.testing.TestUtilities.isFirefox;
35-
import static org.openqa.selenium.testing.TestUtilities.isNativeEventsEnabled;
33+
import static org.openqa.selenium.testing.TestUtilities.isChrome;
3634

3735
import org.junit.After;
3836
import org.junit.Before;
@@ -163,14 +161,7 @@ public void testShouldSetRelatedTargetForMouseOver() {
163161

164162
String log = driver.findElement(By.id("result")).getText();
165163

166-
// Note: It is not guaranteed that the relatedTarget property of the mouseover
167-
// event will be the parent, when using native events. Only check that the mouse
168-
// has moved to this element, not that the parent element was the related target.
169-
if (isNativeEventsEnabled(driver)) {
170-
assertTrue("Should have moved to this element.", log.startsWith("parent matches?"));
171-
} else {
172-
assertEquals("parent matches? true", log);
173-
}
164+
assertEquals("parent matches? true", log);
174165
}
175166

176167
@JavascriptEnabled
@@ -299,10 +290,8 @@ public void testShouldBeAbleToClickOnAnElementGreaterThanTwoViewports() {
299290

300291
@Test
301292
@Ignore(value = {CHROME, MARIONETTE},
302-
reason = "Chrome: failed, Firefox: failed with native event")
293+
reason = "Chrome: failed")
303294
public void testShouldBeAbleToClickOnAnElementInFrameGreaterThanTwoViewports() {
304-
assumeFalse(isFirefox(driver) && isNativeEventsEnabled(driver));
305-
306295
String url = appServer.whereIs("click_too_big_in_frame.html");
307296
driver.get(url);
308297

@@ -374,7 +363,6 @@ public void testShouldBeAbleToClickOnALinkThatWrapsToTheNextLine() {
374363
@Test
375364
@Ignore(value = {MARIONETTE})
376365
public void testShouldBeAbleToClickOnASpanThatWrapsToTheNextLine() {
377-
assumeFalse(isFirefox(driver) && isNativeEventsEnabled(driver));
378366
driver.get(appServer.whereIs("click_tests/span_that_wraps.html"));
379367

380368
driver.findElement(By.id("span")).click();

java/client/test/org/openqa/selenium/I18nTest.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ public void testEnteringSupplementaryCharacters() {
9292
assumeFalse("IE: versions less thank 10 have issue 5069",
9393
TestUtilities.isInternetExplorer(driver) &&
9494
TestUtilities.getIEVersion(driver) < 10);
95-
assumeFalse("FF: native events at linux broke it - see issue 5069",
96-
TestUtilities.isFirefox(driver) &&
97-
TestUtilities.isNativeEventsEnabled(driver) &&
98-
TestUtilities.getEffectivePlatform().is(Platform.LINUX));
9995
driver.get(pages.chinesePage);
10096

10197
String input = "";
@@ -132,8 +128,6 @@ public void testShouldBeAbleToReturnTheTextInAPage() {
132128
public void testShouldBeAbleToActivateIMEEngine() throws InterruptedException {
133129
assumeTrue("IME is supported on Linux only.",
134130
TestUtilities.getEffectivePlatform().is(Platform.LINUX));
135-
assumeTrue("Native events are disabled, IME will not work.",
136-
TestUtilities.isNativeEventsEnabled(driver));
137131

138132
driver.get(pages.formPage);
139133

@@ -175,16 +169,14 @@ public void testShouldBeAbleToActivateIMEEngine() throws InterruptedException {
175169
+ " It was:" + elementValue, elementValue.equals(tokyo));
176170
}
177171

178-
@Ignore(value = {IE, CHROME},
172+
@Ignore(value = {IE, CHROME, FIREFOX},
179173
reason = "Not implemented on anything other than"
180174
+ "Firefox/Linux at the moment.")
181175
@NotYetImplemented(HTMLUNIT)
182176
@Test
183177
public void testShouldBeAbleToInputJapanese() {
184178
assumeTrue("IME is supported on Linux only.",
185179
TestUtilities.getEffectivePlatform().is(Platform.LINUX));
186-
assumeTrue("Native events are disabled, IME will not work.",
187-
TestUtilities.isNativeEventsEnabled(driver));
188180

189181
driver.get(pages.formPage);
190182

java/client/test/org/openqa/selenium/PageLoadingTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,7 @@
4848
import static org.openqa.selenium.testing.Ignore.Driver.SAFARI;
4949
import static org.openqa.selenium.testing.TestUtilities.getEffectivePlatform;
5050
import static org.openqa.selenium.testing.TestUtilities.isChrome;
51-
import static org.openqa.selenium.testing.TestUtilities.isFirefox;
5251
import static org.openqa.selenium.testing.TestUtilities.isLocal;
53-
import static org.openqa.selenium.testing.TestUtilities.isNativeEventsEnabled;
5452

5553
import org.junit.After;
5654
import org.junit.Test;
@@ -423,7 +421,6 @@ public void testShouldTimeoutIfAPageTakesTooLongToLoad() {
423421
@NoDriverAfterTest // Subsequent tests sometimes fail on Firefox.
424422
@Test
425423
public void testShouldTimeoutIfAPageTakesTooLongToLoadAfterClick() {
426-
assumeFalse(isFirefox(driver) && isNativeEventsEnabled(driver));
427424
// Fails on Chrome 44 (and higher?) https://code.google.com/p/chromedriver/issues/detail?id=1125
428425
assumeFalse(
429426
"chrome".equals(((HasCapabilities) driver).getCapabilities().getBrowserName())

java/client/test/org/openqa/selenium/TypingTest.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import static org.junit.Assert.assertEquals;
2525
import static org.junit.Assert.assertThat;
2626
import static org.junit.Assume.assumeFalse;
27-
import static org.junit.Assume.assumeTrue;
2827
import static org.openqa.selenium.WaitingConditions.elementValueToEqual;
2928
import static org.openqa.selenium.testing.Ignore.Driver.ALL;
3029
import static org.openqa.selenium.testing.Ignore.Driver.HTMLUNIT;
@@ -35,18 +34,16 @@
3534
import static org.openqa.selenium.testing.TestUtilities.getEffectivePlatform;
3635
import static org.openqa.selenium.testing.TestUtilities.getFirefoxVersion;
3736
import static org.openqa.selenium.testing.TestUtilities.isFirefox;
38-
import static org.openqa.selenium.testing.TestUtilities.isNativeEventsEnabled;
37+
38+
import com.google.common.base.Joiner;
3939

4040
import org.junit.Test;
41-
import org.openqa.selenium.remote.CapabilityType;
4241
import org.openqa.selenium.testing.Ignore;
4342
import org.openqa.selenium.testing.JUnit4TestBase;
4443
import org.openqa.selenium.testing.JavascriptEnabled;
4544
import org.openqa.selenium.testing.NotYetImplemented;
4645
import org.openqa.selenium.testing.drivers.Browser;
4746

48-
import com.google.common.base.Joiner;
49-
5047
public class TypingTest extends JUnit4TestBase {
5148

5249
@JavascriptEnabled
@@ -569,10 +566,6 @@ public void testChordReveseShiftHomeSelectionDeletes() {
569566
public void testChordControlCutAndPaste() {
570567
assumeFalse("FIXME: macs don't have HOME keys, would PGUP work?",
571568
getEffectivePlatform().is(Platform.MAC));
572-
assumeFalse("FIXME: Fails in Firefox on Linux with native events",
573-
isFirefox(driver) &&
574-
isNativeEventsEnabled(driver) &&
575-
getEffectivePlatform().is(Platform.LINUX));
576569

577570
driver.get(pages.javascriptPage);
578571

@@ -683,7 +676,6 @@ public void testTypingIntoAnIFrameWithContentEditableOrDesignModeSet() {
683676
public void testNonPrintableCharactersShouldWorkWithContentEditableOrDesignModeSet() {
684677
assumeFalse("FIXME: Fails in Firefox on Linux with synthesized events",
685678
isFirefox(driver) &&
686-
!isNativeEventsEnabled(driver) &&
687679
(getEffectivePlatform().is(Platform.LINUX) || getEffectivePlatform().is(Platform.MAC)));
688680

689681
driver.get(pages.richTextPage);

java/client/test/org/openqa/selenium/firefox/BUCK

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,6 @@ java_test(name = 'test-synthesized',
1414
],
1515
)
1616

17-
java_test(name = 'test-native',
18-
srcs = [
19-
'SynthesizedFirefoxDriverTests.java'
20-
],
21-
vm_args = [
22-
'-Dselenium.browser=ff',
23-
'-D"selenium.browser.native_events=true',
24-
],
25-
deps = [
26-
':tests',
27-
'//java/client/src/org/openqa/selenium:webdriver-api',
28-
'//java/client/test/org/openqa/selenium/testing:test-base',
29-
'//java/client/test/org/openqa/selenium:large-tests',
30-
'//third_party/java/junit:junit',
31-
],
32-
)
33-
3417
java_library(name = 'tests',
3518
srcs = glob(['*Test.java', 'internal/*.java']) + [
3619
'FirefoxSpecificTests.java',

java/client/test/org/openqa/selenium/firefox/FirefoxCapabilitiesTest.java

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -104,20 +104,6 @@ public void testEnableRotatableCapability() {
104104
}
105105
}
106106

107-
@Test
108-
public void enableNativeEventCapability() {
109-
assumeFalse(TestUtilities.getEffectivePlatform().is(Platform.MAC));
110-
111-
configureCapability(CapabilityType.HAS_NATIVE_EVENTS, true);
112-
}
113-
114-
@Test
115-
public void disableNativeEventCapability() {
116-
assumeFalse(TestUtilities.getEffectivePlatform().is(Platform.MAC));
117-
118-
configureCapability(CapabilityType.HAS_NATIVE_EVENTS, false);
119-
}
120-
121107
private void configureCapability(String capability, boolean isEnabled) {
122108
DesiredCapabilities requiredCaps = new DesiredCapabilities();
123109
requiredCaps.setCapability(capability, isEnabled);
@@ -131,25 +117,6 @@ private void configureCapability(String capability, boolean isEnabled) {
131117
isEnabled == (Boolean) caps.getCapability(capability));
132118
}
133119

134-
@Test
135-
public void requiredNativeEventCapabilityShouldHavePriority() {
136-
assumeFalse(TestUtilities.getEffectivePlatform().is(Platform.MAC));
137-
138-
DesiredCapabilities desiredCaps = new DesiredCapabilities();
139-
desiredCaps.setCapability(HAS_NATIVE_EVENTS, false);
140-
DesiredCapabilities requiredCaps = new DesiredCapabilities();
141-
requiredCaps.setCapability(HAS_NATIVE_EVENTS, true);
142-
WebDriverBuilder builder = new WebDriverBuilder().setDesiredCapabilities(desiredCaps).
143-
setRequiredCapabilities(requiredCaps);
144-
localDriver = builder.get();
145-
146-
Capabilities caps = ((HasCapabilities)localDriver).getCapabilities();
147-
assertTrue("The native events capability should be included in " +
148-
"capabilities for the session", caps.getCapability(HAS_NATIVE_EVENTS) != null);
149-
assertTrue("Native events capability should be set enabled",
150-
(Boolean) caps.getCapability(HAS_NATIVE_EVENTS));
151-
}
152-
153120
@After
154121
public void quitDriver() {
155122
if (this.localDriver != null) {

java/client/test/org/openqa/selenium/firefox/FirefoxDriverTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import static org.junit.Assert.assertThat;
2828
import static org.junit.Assert.assertTrue;
2929
import static org.junit.Assert.fail;
30-
import static org.junit.Assume.assumeFalse;
3130
import static org.junit.Assume.assumeTrue;
3231
import static org.openqa.selenium.WaitingConditions.elementValueToEqual;
3332
import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs;
@@ -45,7 +44,6 @@
4544
import org.openqa.selenium.NoSuchElementException;
4645
import org.openqa.selenium.ParallelTestRunner;
4746
import org.openqa.selenium.ParallelTestRunner.Worker;
48-
import org.openqa.selenium.Platform;
4947
import org.openqa.selenium.WebDriver;
5048
import org.openqa.selenium.WebElement;
5149
import org.openqa.selenium.environment.GlobalTestEnvironment;
@@ -57,7 +55,6 @@
5755
import org.openqa.selenium.testing.Ignore;
5856
import org.openqa.selenium.testing.JUnit4TestBase;
5957
import org.openqa.selenium.testing.NeedsLocalEnvironment;
60-
import org.openqa.selenium.testing.TestUtilities;
6158
import org.openqa.selenium.testing.drivers.SauceDriver;
6259
import org.openqa.selenium.testing.drivers.SynthesizedFirefoxDriver;
6360
import org.openqa.selenium.testing.drivers.WebDriverBuilder;
@@ -487,9 +484,6 @@ private static String randomString() {
487484

488485
@Test
489486
public void multipleFirefoxDriversRunningConcurrently() throws Exception {
490-
assumeFalse("Unfortunately native events on linux mean mucking around with the window's focus",
491-
TestUtilities.getEffectivePlatform().is(Platform.LINUX) && TestUtilities.isNativeEventsEnabled(driver));
492-
493487
int numThreads;
494488
if (!SauceDriver.shouldUseSauce()) {
495489
numThreads = 6;

java/client/test/org/openqa/selenium/firefox/FirefoxSpecificTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
FirefoxDriverTest.class,
3333
// FirefoxDriverUtilitiesTest.class, // TODO: Fix these tests
3434
FirefoxProfileTest.class,
35-
NativeEventsTest.class,
3635
NewProfileExtensionConnectionTest.class,
3736
PreferencesTest.class,
3837
SocketLockTest.class,

0 commit comments

Comments
 (0)