Skip to content

Commit

Permalink
Merge pull request #113 from jimevans/upload_crash
Browse files Browse the repository at this point in the history
TEST: Adding another file upload test, which crashes PhantomJS
  • Loading branch information
detro committed Oct 31, 2012
2 parents 55b5d26 + c11dfb6 commit 7e7438d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/java/src/test/java/ghostdriver/FileUploadTest.java
Expand Up @@ -76,6 +76,24 @@ public void checkFileUploadCompletes() throws IOException {
d.get("http://www.google.com/"); d.get("http://www.google.com/");
} }


@Test
public void checkUploadingTheSameFileMultipleTimes() throws IOException {
WebDriver d = getDriver();

File file = File.createTempFile("test", "txt");
file.deleteOnExit();

d.get("http://ci.seleniumhq.org:2310/common/formPage.html");
WebElement uploadElement = d.findElement(By.id("upload"));
uploadElement.sendKeys(file.getAbsolutePath());
uploadElement.submit();

d.get("http://ci.seleniumhq.org:2310/common/formPage.html");
uploadElement = d.findElement(By.id("upload"));
uploadElement.sendKeys(file.getAbsolutePath());
uploadElement.submit();
}

@Test @Test
public void checkOnChangeEventIsFiredOnFileUpload() throws IOException { public void checkOnChangeEventIsFiredOnFileUpload() throws IOException {
WebDriver d = getDriver(); WebDriver d = getDriver();
Expand Down

0 comments on commit 7e7438d

Please sign in to comment.