8

I get the following when trying to run the end-to-end test in the angular tutorial (http://docs.angularjs.org/tutorial/step_03)...

I did "git checkout -f step-3" so it's straight from the repo...

[2013-04-05 07:17:07.774] [WARN] config - "/" is proxied, you should probably change urlRoot to avoid conflicts
INFO [testacular]: Testacular server started at http://localhost:9876/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 26.0 (Mac)]: Connected on socket id CamYxe8MuPk52Agq6g5L
WARN [proxy]: failed to proxy /app/index.html (Error: connect ECONNREFUSED)
WARN [proxy]: failed to proxy /app/index.html (Error: connect ECONNREFUSED)

I'm running the app inside a Rails app, which is being served by WEBrick on port 3000. So I change the testacula config to...

proxies = {
'/': 'http://localhost:3000/'
};

...then the test runs but fails with

Chrome 26.0 (Mac) PhoneCat App Phone list view should filter the phone list as user types into the search box FAILED
expect repeater '.phones li' count toBe 3
/Users/paul/rails_projects/angularjs/public/angular-phonecat/test/e2e/scenarios.js:15:7: expected 3 but was 0

So it seems it's not navigating to the page correctly. Anyone have any ideas?

Cheers

3 Answers 3

4

Update your angular-phonecat/config/testacular-e2e.conf.js proxy to this:

proxies = {
  '/': 'http://localhost:3000/angular-phonecat/'
};

The tests in angular-phonecat/test/e2e/scenarios.js are expecting to be able to reach:

http://localhost:3000/app/index.html  

Updating the proxy to the above configuration will fix this (or you could move all the files from /Users/paul/rails_projects/angularjs/public/angular-phonecat/* directly into your public folder)

Sign up to request clarification or add additional context in comments.

Comments

1

As Chris has said, (I upped his comment)

I am running MAMP so I had to change it to use port :80/angular-phonecat

Comments

1

If you are simply running scripts/web-server.js then just run the server:

→ ./scripts/web-server.js 
Http Server running at http://localhost:8000/

Notice that 8000 is the correct port and update the e2e config file:

// config/karma-e2e.conf.js

proxies: {
  '/': 'http://localhost:8000/' //was :3000
}

Now run e2e tests and it should be fine:

→ karma start config/karma-e2e.conf.js

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.