angular-cli: ng e2e does not use --proxy-config for webdriver-manager update

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request


@angular/cli: 1.0.0 node: 6.10.1 os: win32 x64 @angular/common: 4.1.2 @angular/compiler: 4.1.2 @angular/core: 4.1.2 @angular/forms: 4.1.2 @angular/http: 4.1.2 @angular/platform-browser: 4.1.2 @angular/platform-browser-dynamic: 4.1.2 @angular/router: 4.1.2 @angular/cli: 1.0.0 @angular/compiler-cli: 4.1.2

Repro steps.

  1. Must have an out of date web driver or delete it from node_modules/protractor/node_modules/webdriver-manager/selenium/. For example, if using Chrome webdriver, delete all chrome* files in this selenium folder.
  2. Must be behind a proxy, but without HTTPS_PROXY or https_proxy environment variables set.
  3. Using the proxy guide described in the cli wiki, create a proxy.conf.js file to pass to ng e2e.
  4. Run ng e2e --proxy-config proxy.conf.js.

If you are behind a proxy and https_proxy is not set, the command will fail after compiling the app. This is because by default, ng e2e will run webdriver-manager update to fetch the right browser drivers, but does not use the proxy config to do so.

The log given by the failure.

$ ng e2e --proxy-config proxy.conf.js
** NG Live Development Server is running on http://localhost:49152 **
Hash: 95e0fe13c75ed4802b8b
Time: 17998ms
chunk    {0} 0.chunk.js, 491 kB {3} [rendered]
chunk    {1} polyfills.bundle.js, (polyfills) 237 kB {5} [initial] [rendered]
chunk    {2} styles.bundle.js, (styles) 226 kB {5} [initial] [rendered]
chunk    {3} main.bundle.js, (main) 8.25 kB {4} [initial] [rendered]
chunk    {4} vendor.bundle.js, (vendor) 3.12 MB [initial] [rendered]
chunk    {5} inline.bundle.js, (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.
      throw er; // Unhandled 'error' event

Error: connect ECONNREFUSED
    at Object.exports._errnoException (util.js:1018:11)
    at exports._exceptionWithHostPort (util.js:1041:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)

Desired functionality.

ng e2e should pass along proxy configuration to webdriver-manager when the --webdriver-update flag is set to true. For webdriver-manager, the flag to use is --proxy.

Mention any other details that might be useful.

The code that calls webdriver-manager is at Line 65 in e2e.ts.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 20
  • Comments: 23 (2 by maintainers)

Most upvoted comments

Hi, I am trying to run e2e tests with an API behind a reverse-proxy. The API is accessible fine when I run ng serve --proxy-config proxy.conf.json. But ng e2e --proxy-config proxy.conf.json complains as follows:

Unknown option: '--proxyConfig'

I belive that there are 2 different issues discussed here… What the issue creator is requesting is to reuse the --proxy-config (eg. all requests to “/api/***” is proxied to localhost:8080)

this has nothing to do with “pree2e”:“webdriver-manager update --proxy ‘http://********:8080/’ --ignore_ssl”,


Any updates ?

It seems like ng e2e takes now the proxy configuration from ng serve. If you add following line in the angular.json file and run ng e2e without any options it will execute with the proxy configurations.

       "serve": {
            "builder": "@angular-devkit/build-angular:dev-server",
            "options": {
                "browserTarget": "lmsbo-bo:build",
                "proxyConfig": "config/proxy/proxy.tst5.json" <== **added this** line
            "configurations": {
                "production": {
                    "browserTarget": "lmsbo-bo:build:production"

But this is a step backwards. If you have multiple environments and therefore multiple proxy configurations you have to change everytime your angular.json file accordingly before running ng e2e.

How are you running your e2e-tests if having a api behind a reverse-proxy if

ng e2e --proxy-config proxy.conf.json

is not working?

Hello, any updates with it?

It worked for me (below) as webdriver not taking npm proxy settings and it downloads the driver from googleapis link So we need to set it in package.json and run ng e2e

  1. In package.json, downgraded the protractor version from 5.1.2 to 5.1.1

  2. Added a “pree2e” step as follows in package.json

    “pree2e”:“webdriver-manager update --proxy ‘http://********:8080/’ --ignore_ssl”, “e2e”: “ng e2e”,

  3. Run npm install.

  4. Run npm run e2e

any update?

webdriver-manager update respects HTTPS_PROXY environment variable. Try to setup HTTPS_PROXY environment variable with your (corporate) proxy server http://********:80 Restart your VS Code or command prompt (to pickup changes) and you should be fine to run e2e tests without issues.

@SidV7 I faced the same issue after the manual webdriver update. You have to run the e2e without updating the webdriver again as @filipesilva suggested. This worked for me:

ng e2e –webdriver-update=false

I have no update on this but would like to mention you can do the update manually with the flags you need to use and then run ng e2e --webdriver-update=false to prevent ng e2e from trying to update webdriver.

Any updates on this?

any update? Thanks