Angular CLI 7: How can I use random port with e2e?

374 views Asked by At

Background

I'm running e2e-tests using a selenium server in CI, which results in following addition to my protractor.conf.js:

directConnect: false,
seleniumAddress: '...',

Issue

When upgrading Angular CLI from 1.7.2 to 7.0.6 I ran into this issue.

In CLI 1.7.2 running ng e2e would serve my app using a randomly assigned port which would also be fed to the selenium server, enabling it to access my app successfully.

In CLI 7.0.6 my app is served on port 4200 instead. If i supply --port=0 it would serve my app on a randomly assigned port, however instead http://<hostname>:0 is fed to the selenium server, meaning it would try to access my app as such which fails.

How could I get a similar behavior in CLI 7?

0

There are 0 answers