0

I wanted to run my protractor tests on the same port without changing the port number. I tried :

"e2e": "ng e2e --port 49152 --host localhost",

in the package.jason file and also

"e2e": {
  "options": {
    "port": 49152
  }

in the angular.json file but both didn't work for me. Is there any possible way to make protractor tests run in the same port?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Sanjani Gunathilaka
  • 229
  • 1
  • 3
  • 11
  • What do you mean; what *"didn't work"*? Same port as what? – jonrsharpe Jan 20 '19 at 15:49
  • I tried changing both files but my tests still run different port numbers whenever I tried to run. So I want to run my tests in the same port to make my tests to have the same URL. – Sanjani Gunathilaka Jan 20 '19 at 15:54
  • What do you mean your *tests* have the same URL? You mean the debug port? Or what? – jonrsharpe Jan 20 '19 at 15:54
  • ** NG Live Development Server is listening on localhost:49152, open your browser on http://localhost:49152/ ** I want to open my browser on http://localhost:49152/ whenever I testing using the protractor – Sanjani Gunathilaka Jan 20 '19 at 15:59
  • Do you mean that you have a random port whenever you run the e2e tests? – profanis Jan 20 '19 at 18:01
  • yes, base URL is set to 4200 but it opens at random ports from time to time. So my tests fail due to the given target URL is wrong. – Sanjani Gunathilaka Jan 20 '19 at 18:13
  • Possible duplicate of [angular-cli server - how to specify default port](https://stackoverflow.com/questions/37154813/angular-cli-server-how-to-specify-default-port) – Gunderson Jan 20 '19 at 22:50

0 Answers0