Created
July 9, 2019 14:15
-
-
Save rnemeth1980/9308900ccb92b94504448e1940a07ec9 to your computer and use it in GitHub Desktop.
proxy configuration for geb framework in groovy
This file contains hidden or 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
| Proxy proxy = new Proxy() | |
| proxy.setHttpProxy("proxy-abc.de") | |
| proxy.setSslProxy("proxy-abc.de") | |
| // Define basic no_proxy settings. | |
| def noProxy = "127.0.0.1,[::1],localhost,abc.de,local" | |
| // Extend no_proxy depending on stage. | |
| switch(System.getProperty(TestConstants.SYSTEMPARAMETER.STAGING_ENVIRONMENT)) { | |
| case TestConstants.STAGING_ENVIRONMENT.PROD: | |
| noProxy += ",www-intern.abc.com,www.abc.com" | |
| break | |
| case TestConstants.STAGING_ENVIRONMENT.STAGE: | |
| noProxy += ",stage.abc.com,stage-intern.abc.com" | |
| break | |
| case TestConstants.STAGING_ENVIRONMENT.TEST: | |
| noProxy += ",test.abc.com,test-intern.abc.com,*.abc.org" | |
| break | |
| case TestConstants.STAGING_ENVIRONMENT.DEV: | |
| noProxy += ",dev.abc.com,dev-intern.abc.com" | |
| break | |
| default: | |
| break | |
| } | |
| // Set no_proxy. | |
| proxy.setNoProxy(noProxy) | |
| caps.setCapability(CapabilityType.PROXY, proxy); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment