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

Add proxy config #7

Merged
merged 4 commits into from
Dec 1, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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