Allow passing 'proxy' parameter to 'sauce' service
Is your feature request related to a problem? Please describe.
If SauceLabs service is behind the firewall and accessible via proxy, I would expect to be able to pass proxy parameter to sauce service, similar to proxy parameter in saucelabs service it is based on: https://www.npmjs.com/package/saucelabs#proxy. Unfortunately, proxy parameter does not seem to be supported.
Describe the solution you'd like
I would like to be able to pass proxy parameter to sauce service like this:
// ...
services: [
['sauce', {proxy: ' http://my-proxy.my-org:8084'}]
]
}
Describe alternatives you've considered
Solution we were using before was to set HTTP_PROXY environment variable. Because of the migration of saucelabs service to got from request, this doesn't work anymore.
Other solution, that we are currently migrating to is to use global agent as suggested in WDIO docs: https://webdriver.io/docs/proxy.html
This works, however it lacks granularity - i can't use different proxy servers for SauceLabs and other wdio needs (such as googlapis for selenium-standalone, etc.). Also it requires adding extra dependency. Since saucelabs package already supports proxy out of the box, would be great to be able to make this a sauce service parameter.
Additional context
https://gitter.im/webdriverio/webdriverio?at=5f4e8fb795458c6c3f5d15a3
I suggest to introduce a new option proxy in the webdriver package that is from type string. If set we create a custom agent similar to how it is done in the node-saucelabs package. In the @wdio/sauce-service we propagate this new option into the client so that the settings are the same. To wrap things up an addition to our proxy docs explaining this alternative helps people to decide which proxy setup they want to choose.
Given our current documented way works this is not urgent but an excellent chance for someone to get familiar with the code base. Have a look at our contributing guidelines and reach out if you have any questions. Happy to support anyone taking this on!
@christian-bromann Shall I pick this up?
Feel free.
Shouldn't this solve the purpose here:
services: [ ['sauce', { sauceConnect: true, sauceConnectOpts: { proxy: 'my-proxy.my-org:8084, port: 443, tunnelIdentifier: 'POC_TEST' } }] ],
@gulatirajat this would ensure that tests still gonna be run through Sauce but the REST API calls to update the job etc. won't be successful. The node-saucelabs package has a proxy option so as I suggested above this information needs to get propagated through it via Sauce service.
Any update on this? Facing the same issue, not able to connect to saucelabs via sauce service behind cooperate proxy
Any update on this?
No updates as you can tell by the labels of this issue, please get involved to help implement this. Thank you!