Created
June 4, 2016 06:56
-
-
Save slawekradzyminski/e9353b5b4af7fc9b6dbde2036475ffe9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FileDownloadTest extends FluentTestNg { | |
private static final String FILE_TO_DL_SELECTOR = "ul li a"; | |
private static final String URL = "http://www.developsense.com"; | |
@Test | |
public void statusCode200() throws IOException, URISyntaxException { | |
Request request = prepareRequest(); | |
assertThat(request.getHTTPStatusCodeFromResponse()).isEqualTo(SC_OK); | |
} | |
private Request prepareRequest() throws MalformedURLException, URISyntaxException { | |
String fileUrl = getUrlFromSite(); | |
Request request = new Request(getDriver()); | |
request.setURIToCheck(fileUrl); | |
return request; | |
} | |
private String getUrlFromSite() { | |
goTo(URL); | |
await().until(FILE_TO_DL_SELECTOR).isEnabled(); | |
return findFirst(FILE_TO_DL_SELECTOR).getAttribute("href"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment