yearofmoo-articles / AngularJS-Testing-Article

A testing repository for AngularJS
263 stars 111 forks source link

All Unit Tests Pass, but some Midway Tests Fail #16

Open ElliotPsyIT opened 11 years ago

ElliotPsyIT commented 11 years ago

I'm having trouble with the midway testing. All 16 unit tests pass, but 4 midway tests fail (as marked below ERROR). I also see several time outs, and these persist even after I bump up the timeout in mocha.conf.js. Any insights?

Running "karma:midway" (karma) task
WARN [karma]: Port 9876 in use
INFO [karma]: Karma v0.9.7 server started at http://localhost:9877/
INFO [launcher]: Starting browser Chrome
INFO [Chrome 28.0.1500 (Mac OS X 10.8.4)]: Connected on socket id bXq27uCWDrc1vOyVEENV
Chrome 28.0.1500 (Mac OS X 10.8.4): Executed 6 of 23
**
ERROR: 'AssertionError: expected undefined to deeply equal 'VideosCtrl'' 
**
Chrome 28.0.1500 (Mac OS X 10.8.4): Executed 7 of 23
WARN [web-server]: 404: /templates/views/videos/index_tpl.html?v=8
Chrome 28.0.1500 (Mac OS X 10.8.4) Midway: Testing Controllers should load the WatchedVideosCtrl controller properly when /watched-videos route is accessed FAILED
    Error: timeout of 5000ms exceeded
        at /Users/ElliotFielstein/Angular/AngularJS-Testing-Article/node_modules/karma-mocha/lib/mocha.js:3579:14
**
ERROR: 'AssertionError: expected '/videos' to equal '/watched-videos''
**
Chrome 28.0.1500 (Mac OS X 10.8.4): Executed 8 of 23 (1 FAILED)
WARN [web-server]: 404: /templates/views/videos/index_tpl.html?v=8
Chrome 28.0.1500 (Mac OS X 10.8.4): Executed 9 of 23 (1 FAILED)
Chrome 28.0.1500 (Mac OS X 10.8.4): Executed 11 of 23 (1 FAILED)
**
ERROR: 'AssertionError: expected '' to include 'app-youtube-listings''
**
Chrome 28.0.1500 (Mac OS X 10.8.4) Midway: Testing Requests should goto the videos_path by default FAILED
    Error: timeout of 5000ms exceeded
        at /Users/ElliotFielstein/Angular/AngularJS-Testing-Article/node_modules/karma-mocha/lib/mocha.js:3579:14
Chrome 28.0.1500 (Mac OS X 10.8.4): Executed 12 of 23 (2 FAILED)
Chrome 28.0.1500 (Mac OS X 10.8.4) Midway: Testing Requests should have a working video_path request FAILED
    Error: timeout of 5000ms exceeded
        at /Users/ElliotFielstein/Angular/AngularJS-Testing-Article/node_modules/karma-mocha/lib/mocha.js:3579:14
Chrome 28.0.1500 (Mac OS X 10.8.4): Executed 13 of 23 (3 FAILED)
Chrome 28.0.1500 (Mac OS X 10.8.4) Midway: Testing Requests should have a working other_path request FAILED
    Error: timeout of 5000ms exceeded
        at /Users/ElliotFielstein/Angular/AngularJS-Testing-Article/node_modules/karma-mocha/lib/mocha.js:3579:14
**
ERROR: 'AssertionError: expected '' to include 'other page''
**
Chrome 28.0.1500 (Mac OS X 10.8.4): Executed 14 of 23 (4 FAILED)
Chrome 28.0.1500 (Mac OS X 10.8.4): Executed 22 of 23 (4 FAILED)
Chrome 28.0.1500 (Mac OS X 10.8.4): Executed 23 of 23 (4 FAILED) (23.869 secs / 23.466 secs)
Warning: Task "karma:midway" failed. Use --force to continue.

Aborted due to warnings.
christrees commented 11 years ago

I'm getting the exact same error... seems like we have the same OS version... could that be it? Mac OS X 10.8.4... Was wanting to look at midway testing so I'll re-post if I find anything... I'm tempted to fire this up on another OS just to check....

I tried some different browsers (PhantomJS had 5 failures) ====Safari Safari 6.0.5 (Mac OS X 10.8.4): Executed 23 of 23 (4 FAILED) (24.437 secs / 23.415 secs) Warning: Task "karma:midway" failed. Use --force to continue.

Aborted due to warnings. ====Firefox Firefox 22.0.0 (Mac OS X 10.8): Executed 23 of 23 (4 FAILED) (23.891 secs / 23.54 secs) Warning: Task "karma:midway" failed. Use --force to continue.

Aborted due to warnings. ====PhantomJS PhantomJS 1.9.1 (Mac OS X): Executed 23 of 23 (5 FAILED) (28.152 secs / 27.014 secs) Warning: Task "karma:midway" failed. Use --force to continue.

Aborted due to warnings.

ElliotPsyIT commented 11 years ago

We do have the same OS version 10.8.4 (as you can see embedded in the error message I posted earlier). I'm a newbie at karma/mocha/jasmine testing so I could be way off, but the errors seem to be actual test failures (given the successful completion of the unit tests). I realize test coding may be an unlikely cause, but I do wonder. I haven't had a chance to experiment with the testing code to check that out. I do appreciate your exploration of possible higher level (OS or other) causes to explain the midway errors.

christrees commented 11 years ago

I'm new to karma and also midway, so just playing and attempting to understand structures.... was also attemtping to back out some of the auto execution and go back to just the runner and having issues... which means I'm not following the configuration. My 'guess' right now is the midway test fail due to a wait issue as I disabled one of the 'it' and the next one failed... or it's some other sort of test setup issue... again I'm still attempting to grep the setup structure... it is nice to know you got the same failure... ;-)

marplesoft commented 11 years ago

Same here.

duncanawerbuck commented 11 years ago

Same here. Windows 7 64-bit.

defnorep commented 11 years ago

Same problem. Linux Mint 15.

aunn commented 10 years ago

same here. windows 7 64-bit