Skip to content

Commit

Permalink
[java] Adding waits to upload test because it's a slow action
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Nov 23, 2018
1 parent 6afcae4 commit e14ab1f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.openqa.selenium.remote.http.HttpMethod;
import org.openqa.selenium.remote.http.HttpRequest;
import org.openqa.selenium.remote.http.HttpResponse;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.testing.drivers.WebDriverBuilder;

import java.io.File;
Expand Down Expand Up @@ -141,8 +142,8 @@ public void uploadsFile() throws Throwable {
Thread.sleep(50);

driver.switchTo().frame("upload_target");
WebElement body = driver.findElement(By.xpath("//body"));
assertEquals(FILE_CONTENTS, body.getText());
new WebDriverWait(driver, 10).until(
d -> d.findElement(By.xpath("//body")).getText().equals(FILE_CONTENTS));
}

private void assertUrlHasContentType(String url, String appcacheMimeType) throws IOException {
Expand Down

0 comments on commit e14ab1f

Please sign in to comment.