Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#788 Add setting to enable/disable proxy server #791

Merged
merged 2 commits into from Aug 28, 2018

Conversation

Projects
None yet
2 participants
@asolntsev
Copy link
Contributor

asolntsev commented Aug 28, 2018

Proposed changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue.

Checklist

  • Checkstyle and unit tests pass locally with my changes by running gradle check chrome htmlunit command
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@asolntsev asolntsev self-assigned this Aug 28, 2018

@asolntsev asolntsev requested a review from rosolko Aug 28, 2018

@rosolko
Copy link
Collaborator

rosolko left a comment

Look good!

@@ -32,18 +40,20 @@ public File execute(SelenideElement proxy, WebElementSource linkWithHref, Object
LOG.config("selenide.fileDownload = " + System.getProperty("selenide.fileDownload") + " download file via http get");
return downloadFileWithHttpRequest.download(link, timeout);
}
else if (!Configuration.proxyEnabled) {

This comment has been minimized.

@rosolko

rosolko Aug 28, 2018

Collaborator

else if using is redundant in this place because each branch do a return or throw

This comment has been minimized.

@asolntsev

asolntsev Aug 28, 2018

Author Contributor

done

@@ -32,18 +40,20 @@ public File execute(SelenideElement proxy, WebElementSource linkWithHref, Object
LOG.config("selenide.fileDownload = " + System.getProperty("selenide.fileDownload") + " download file via http get");
return downloadFileWithHttpRequest.download(link, timeout);
}
else if (!Configuration.proxyEnabled) {
throw new IllegalStateException("Cannot download file: proxy server is not enabled. Setup Configuration.proxyEnabled");
}
else if (webdriverContainer.getProxyServer() == null) {

This comment has been minimized.

@rosolko

rosolko Aug 28, 2018

Collaborator

same here

This comment has been minimized.

@asolntsev

asolntsev Aug 28, 2018

Author Contributor

done

else if (webdriverContainer.getProxyServer() == null) {
LOG.config("Proxy server is not started - download file via http get");
return downloadFileWithHttpRequest.download(link, timeout);
throw new IllegalStateException("Cannot download file: proxy server is not started");
}
else {

This comment has been minimized.

@rosolko

rosolko Aug 28, 2018

Collaborator

else is redundant

This comment has been minimized.

@asolntsev

asolntsev Aug 28, 2018

Author Contributor

done

*
* @see net.lightbody.bmp.client.ClientUtil#getConnectableAddress()
*/
public static String proxyHost = System.getProperty("selenide.proxyHost", "");

This comment has been minimized.

@rosolko

rosolko Aug 28, 2018

Collaborator

In parent task default value was described as localhost not an empty value

This comment has been minimized.

@asolntsev

asolntsev Aug 28, 2018

Author Contributor

Which parent task do you mean? I don't see it.

@asolntsev asolntsev merged commit df1487b into master Aug 28, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@asolntsev asolntsev deleted the proxy-settings branch Aug 28, 2018

@asolntsev asolntsev added the feature label Aug 28, 2018

@asolntsev asolntsev added this to the 4.14.0 milestone Aug 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.