Node.js / karma / end-to-end testing: proxy failed /app/index.html(error: connect ECONNREFUSED)

Below are the messages that I get when trying to run the end-to-end test from the AngularJS tutorial http://docs.angularjs.org/tutorial/step_05 in MS Windows 8 Professional. Could you please advise how I can make this test work well?

[2013-06-10 17:27:54.100] [WARN] config - "/" is proxied, you should probably change urlRoot to avoid conflicts INFO [karma]: Karma server started at http://localhost:9876/ INFO [launcher]: <<< Starting browser Chrome INFO [launcher]: --- Starting browser Chrome INFO [Chrome 27.0 (Windows)]: Connected on socket id E20UigDmDqhk3jaRRYAP WARN [proxy]: failed to proxy /app/index.html (Error: connect ECONNREFUSED) 

ECONNREFUSED while running end-to-end test using Karma node.js package on MS Windows 8 Professional

+6
source share
2 answers

The error you see indicates that you did not start the web server. Since you are using. / scripts / e 2e-test.sh to run e2e tests, you need your web server to serve the application with localhost: 8000, and docroot should point to the angular -phonecat folder, and not to the application folder. This can be done by simply running . / scripts / web -server.js (see step-00 )

Note that there is a second way to run e2e tests. You can just visit

 http://localhost:8000/test/e2e/runner.html 
+12
source

Yes, the problem is that the web server is not running. Its easiest to run local.

For more information on setting up a project, see angular -seed (project template) at https://github.com/angular/angular-seed (from this template) to be able to run testing.

Essentially:

  • git clone https://github.com/angular/angular-seed
    • I cloned as "angular -seed-template-project" and used this as a template for my own projects.
    • I git pull to pull the latest work and run npm update to pull its latest dependencies
    • They actually speak in fork angular -seed on git -hub, which allows you to easily git pull update your project with the latest changes (according to How can I combine the parent fork? ). However, I understand that you can only deploy the github project once, which eliminates the use of angular -seed as a template. Obviously, I need to look at this in more detail.
  • cd <the-project>
  • npm test to run unit tests
  • npm start to start the web server using the current-dir application as the base. This will not work as the default process, so either do it in another terminal, where you run command line commands, or start as a process (called node , which you will need to kill later) - npm start &
  • npm run update-webdriver for installing Selenium or more
  • npm run protractor to run integration tests to the end

Performing this in accordance with the instructions of the flexible seed will avoid this error.

0
source

Source: https://habr.com/ru/post/946960/


All Articles