Question

The following are messages I'm getting while trying to run end-to-end test from AngularJS tutorial http://docs.angularjs.org/tutorial/step_05 on MS Windows 8 Professional. Could you please advise how can I make this test running 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

Was it helpful?

Solution

The error you're seeing indicates that you haven't started the webserver. Since you are using ./scripts/e2e-test.sh to run your e2e tests, you need to have your webserver serve the app from localhost:8000 and the docroot needs point to the angular-phonecat folder, not the app folder. This can be done by simply running ./scripts/web-server.js (see step-00)

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

http://localhost:8000/test/e2e/runner.html 

OTHER TIPS

Yes, the problem is that the web server isn't running. Its easiest to run a local one.

See the angular-seed (template project) at https://github.com/angular/angular-seed for details about how to setup a project (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 use that as a template for my own projects.
    • I git pull on this to bring down the latest work and run npm update to pull in its latest dependencies
    • They actually say to fork angular-seed on git-hub which would allow you to easily git pull to update your project with the latest changes (as per How do I merge a parent fork?). However my understanding is that you can only fork a github project once, which would preclude using angular-seed as a template. Obviously I need to look at this in greater detail.
  • cd <the-project>
  • npm test to run the unit tests
  • npm start to start the web server with the current-dir's app as the base. This will not run as a processs by default so either do that in a different terminal to where you run the command-line commands or start as a process (which is called node that you will need to kill later) - npm start &
  • npm run update-webdriver to install Selenium and more
  • npm run protractor to run the end to end integration tests

Doing it this way as per the agile-seed instructions will avoid this error.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top