Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
chore(blockingproxy): Allow using a pre-existing Blocking Proxy insta…
Browse files Browse the repository at this point in the history
…nce (#3970)
  • Loading branch information
heathkit authored Jan 18, 2017
1 parent bf123ad commit 879aac6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ let allowedNames = [
'seleniumSessionId',
'webDriverProxy',
'useBlockingProxy',
'blockingProxyUrl',
'sauceUser',
'sauceKey',
'sauceAgent',
Expand Down
6 changes: 6 additions & 0 deletions lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ export interface Config {
*/
useBlockingProxy?: boolean;

/**
* If specified, Protractor will connect to the Blocking Proxy at the given
* url instead of starting it's own.
*/
blockingProxyUrl?: string;

// ---- 3. To use remote browsers via Sauce Labs -----------------------------

/**
Expand Down
5 changes: 4 additions & 1 deletion lib/driverProviders/driverProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export abstract class DriverProvider {
}

getBPUrl() {
if (this.config_.blockingProxyUrl) {
return this.config_.blockingProxyUrl;
}
return `http://localhost:${this.bpRunner.port}`;
}

Expand Down Expand Up @@ -105,7 +108,7 @@ export abstract class DriverProvider {
*/
setupEnv(): q.Promise<any> {
let driverPromise = this.setupDriverEnv();
if (this.config_.useBlockingProxy) {
if (this.config_.useBlockingProxy && !this.config_.blockingProxyUrl) {
// TODO(heathkit): If set, pass the webDriverProxy to BP.
return q.all([driverPromise, this.bpRunner.start()]);
}
Expand Down

0 comments on commit 879aac6

Please sign in to comment.