Skip to content

Commit

Permalink
Merge pull request #7 from petehouston/master
Browse files Browse the repository at this point in the history
Add proxy config
  • Loading branch information
DavertMik committed Dec 1, 2015
2 parents 012c596 + 051f4f5 commit e4323fb
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,51 @@ Scenario('test some forms', (I, docsPage) => {
});
```
## Connect through proxy
CodeceptJS also provides flexible options when you want to execute tests to Selenium servers through proxy. You will
need to update the `helpers.WebDriverIO.proxy` key.
```js
{
"helpers": {
"WebDriverIO": {
"proxy": {
"proxyType": "manual|pac",
"proxyAutoconfigUrl": "URL TO PAC FILE",
"httpProxy": "PROXY SERVER",
"sslProxy": "PROXY SERVER",
"ftpProxy": "PROXY SERVER",
"socksProxy": "PROXY SERVER",
"socksUsername": "USERNAME",
"socksPassword": "PASSWORD",
"noProxy": "BYPASS ADDRESSES"
}
}
}
}
```
For example,
```js
{
"helpers": {
"WebDriverIO": {
"proxy": {
"proxyType": "manual",
"httpProxy": "http://corporate.proxy:8080",
"socksUsername": "codeceptjs",
"socksPassword": "secret",
"noProxy": "127.0.0.1,localhost"
}
}
}
}
```
Please refer to [Selenium - Proxy Object](https://code.google.com/p/selenium/wiki/DesiredCapabilities#Proxy_JSON_Object) for more information.
## Current State
CodeceptJS is in its early days. Any feedback, issues, and pull requests are welcome. Try it, and if you like it - help us make it better!
Expand Down
3 changes: 3 additions & 0 deletions lib/helper/WebDriverIO.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ class WebDriverIO extends Helper {
if (!this.options.desiredCapabilities) this.options.desiredCapabilities = {};
this.options.desiredCapabilities.browserName = config.browser;
this.options.baseUrl = config.url;
if(config.proxy) {
this.options.desiredCapabilities.proxy = config.proxy;
}
}

static _config() {
Expand Down

0 comments on commit e4323fb

Please sign in to comment.