|
17 | 17 |
|
18 | 18 | package org.openqa.selenium;
|
19 | 19 |
|
| 20 | +import static org.hamcrest.CoreMatchers.instanceOf; |
20 | 21 | import static org.junit.Assert.assertEquals;
|
| 22 | +import static org.junit.Assert.assertThat; |
21 | 23 | import static org.junit.Assume.assumeFalse;
|
22 | 24 | import static org.openqa.selenium.Platform.ANDROID;
|
23 | 25 | import static org.openqa.selenium.WaitingConditions.elementTextToEqual;
|
24 | 26 | import static org.openqa.selenium.support.ui.ExpectedConditions.not;
|
25 | 27 | import static org.openqa.selenium.support.ui.ExpectedConditions.visibilityOf;
|
| 28 | +import static org.openqa.selenium.testing.Driver.CHROME; |
| 29 | +import static org.openqa.selenium.testing.Driver.FIREFOX; |
| 30 | +import static org.openqa.selenium.testing.Driver.HTMLUNIT; |
26 | 31 | import static org.openqa.selenium.testing.Driver.IE;
|
| 32 | +import static org.openqa.selenium.testing.Driver.MARIONETTE; |
27 | 33 | import static org.openqa.selenium.testing.Driver.PHANTOMJS;
|
28 | 34 | import static org.openqa.selenium.testing.Driver.SAFARI;
|
| 35 | +import static org.openqa.selenium.testing.TestUtilities.catchThrowable; |
29 | 36 |
|
30 | 37 | import com.google.common.base.Charsets;
|
31 | 38 | import com.google.common.io.Files;
|
@@ -89,6 +96,21 @@ public void testCleanFileInput() throws Exception {
|
89 | 96 | assertEquals("", element.getAttribute("value"));
|
90 | 97 | }
|
91 | 98 |
|
| 99 | + @Test |
| 100 | + @Ignore(IE) |
| 101 | + @Ignore(MARIONETTE) |
| 102 | + @Ignore(FIREFOX) |
| 103 | + @Ignore(CHROME) |
| 104 | + @Ignore(PHANTOMJS) |
| 105 | + @Ignore(SAFARI) |
| 106 | + @Ignore(HTMLUNIT) |
| 107 | + public void testClickFileInput() throws Exception { |
| 108 | + driver.get(pages.uploadPage); |
| 109 | + WebElement element = driver.findElement(By.id("upload")); |
| 110 | + Throwable ex = catchThrowable(element::click); |
| 111 | + assertThat(ex, instanceOf(InvalidArgumentException.class)); |
| 112 | + } |
| 113 | + |
92 | 114 | private File createTmpFile(String content) throws IOException {
|
93 | 115 | File f = File.createTempFile("webdriver", "tmp");
|
94 | 116 | f.deleteOnExit();
|
|
0 commit comments