# 3 test cases failed when run test example nuve-test.js

**URL:** <https://discourse.lynckia.com/t/3-test-cases-failed-when-run-test-example-nuve-test-js/229>\
**Category:** Uncategorized\
**Created:** [May 30, 2013, 3:02am UTC](https://discourse.lynckia.com/t/3-test-cases-failed-when-run-test-example-nuve-test-js/229 "2013-05-30T03:02:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alice](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@Alice](https://discourse.lynckia.com/u/Alice)\
**Post date:** [May 30, 2013, 3:02am UTC](https://discourse.lynckia.com/t/3-test-cases-failed-when-run-test-example-nuve-test-js/229/1 "2013-05-30T03:02:12Z")

</div>

I have setup test environment according to  
[http://lynckia.com/licode/travis-webrtc.html](http://lynckia.com/licode/travis-webrtc.html)  
then,I try to run all test cases defined at /test/nuve-test.js , test cases  
can be found at  
[https://github.com/ging/lynckia/blob/master/test/nuve-test.js](https://github.com/ging/lynckia/blob/master/test/nuve-test.js)  
3 test cases failed .

test steps:

1. run ./script/initLynckia.sh
2. run ./script/ [initBasicExample.sh](http://initBasicExample.sh)
3. open [http://localhost:3001](http://localhost:3001) at browser and make sure environment is  
correct.
4. run “npm test” at command line  
4 test cases passed while last 3 test cases failed.  
here is test result info  
Chrome 27.0 (Linux) nuve-test _should publish stream in room FAILED_  
timeout: timed out after 5000 msec waiting for something to happen  
Chrome 27.0 (Linux) SLOW 5.117 secs: nuve-test should publish stream in  
room  
Chrome 27.0 (Linux) nuve-test _should subscribe to stream in room FAILED_  
TypeError: Cannot read property ‘local’ of undefined  
at Object.a.subscribe  
(/home/alice/lynckia/extras/basic\_example/public/erizo.js:128:73)  
at null. (/home/alice/lynckia/test/nuve-test.js:175:14)  
Chrome 27.0 (Linux) nuve-test _should allow showing a subscribed stream  
FAILED_  
TypeError: Cannot call method ‘show’ of undefined  
at null. (/home/alice/lynckia/test/nuve-test.js:190:22)  
Chrome 27.0 (Linux) LOG: 'DEBUG: Event: room-disconnected’  
Chrome 27.0 (Linux) LOG: ‘INFO: Socket disconnected’

Any comments or suggestion ?

Thanks  
Alice

---

<div class="post-metadata">

**Author:** ![Javier](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/javier/32/20_2.png) [@Javier](https://discourse.lynckia.com/u/Javier)\
**Post date:** [June 4, 2013, 3:21pm UTC](https://discourse.lynckia.com/t/3-test-cases-failed-when-run-test-example-nuve-test-js/229/2 "2013-06-04T15:21:12Z")

</div>

Hi Alice,

Thanks for the warning! We’re taking a glance at it since it seems the  
–use-fake-media-device flag of Chrome doesn’t work properly. We’ll let you  
know when we find a solution.

Anyway, any advice from someone in the list who is playing with this  
Chrome’s feature will be welcome! Thanks!

Cheers,  
Javier.On 29 May 2013 20:02, Alice [onlyme.zyb77@gmail.com](mailto:onlyme.zyb77@gmail.com) wrote:

> I have setup test environment according to  
> [Automated testing in Travis CI for WebRTC](http://lynckia.com/licode/travis-webrtc.html)  
> then,I try to run all test cases defined at /test/nuve-test.js , test  
> cases can be found at  
> [https://github.com/ging/lynckia/blob/master/test/nuve-test.js](https://github.com/ging/lynckia/blob/master/test/nuve-test.js)  
> 3 test cases failed .
> 
> test steps:
> 
> 1. run ./script/initLynckia.sh
> 2. run ./script/ initBasicExample.sh
> 3. open [http://localhost:3001](http://localhost:3001) at browser and make sure environment is  
> correct.
> 4. run “npm test” at command line  
> 4 test cases passed while last 3 test cases failed.  
> here is test result info  
> Chrome 27.0 (Linux) nuve-test _should publish stream in room FAILED_  
> timeout: timed out after 5000 msec waiting for something to happen  
> Chrome 27.0 (Linux) SLOW 5.117 secs: nuve-test should publish stream in  
> room  
> Chrome 27.0 (Linux) nuve-test _should subscribe to stream in room FAILED_  
> TypeError: Cannot read property ‘local’ of undefined  
> at Object.a.subscribe  
> (/home/alice/lynckia/extras/basic\_example/public/erizo.js:128:73)  
> at null. (/home/alice/lynckia/test/nuve-test.js:175:14)  
> Chrome 27.0 (Linux) nuve-test _should allow showing a subscribed stream  
> FAILED_  
> TypeError: Cannot call method ‘show’ of undefined  
> at null. (/home/alice/lynckia/test/nuve-test.js:190:22)  
> Chrome 27.0 (Linux) LOG: ‘DEBUG: Event: room-disconnected’  
> Chrome 27.0 (Linux) LOG: ‘INFO: Socket disconnected’
> 
> Any comments or suggestion ?
> 
> Thanks  
> Alice
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “lynckia” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [lynckia+unsubscribe@googlegroups.com](mailto:lynckia+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Alice](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@Alice](https://discourse.lynckia.com/u/Alice)\
**Post date:** [July 3, 2013, 6:09am UTC](https://discourse.lynckia.com/t/3-test-cases-failed-when-run-test-example-nuve-test-js/229/3 "2013-07-03T06:09:09Z")

</div>

Hi, Javier  
I can send a pull request in Github 🙂  
A another question : why you set chrome\_bin =“DISPLAY=:99” at Cakefile ?  
I can only launch chrome with “DISPLAY=:0”

Thanks  
AliceOn Tuesday, July 2, 2013 3:59:05 PM UTC+8, Javier Cerviño wrote:

> Hi Alice,
> 
> Thanks a lot! That’s a very interesting fix for the tests since the were  
> partially broken. You can send a pull request in Github with the commit if  
> you want. If not, we’ll do it.
> 
> Cheers,  
> Javier.
> 
> On 2 July 2013 07:46, Alice \<[onlyme...@gmail.com](mailto:onlyme...@gmail.com) \<javascript:\>\> wrote:
> 
> > Hi, Javier  
> > I have debug the test cases again . It failed because stream-added event  
> > always triggered later than timeout time (5000 msec) after we call  
> > room.publish(localStream);  
> > If we call room.publish(localStream) at test case ‘should connect to  
> > room’ and add ‘waits(20000)’ before  
> > ‘room.addEventListener(“stream-added”, function(msg) ~’  
> > It works now.
> > 
> > On Tuesday, June 4, 2013 11:21:12 PM UTC+8, Javier Cerviño wrote:
> > 
> > > Hi Alice,
> > > 
> > > Thanks for the warning! We’re taking a glance at it since it seems the  
> > > –use-fake-media-device flag of Chrome doesn’t work properly. We’ll let you  
> > > know when we find a solution.
> > > 
> > > Anyway, any advice from someone in the list who is playing with this  
> > > Chrome’s feature will be welcome! Thanks!
> > > 
> > > Cheers,  
> > > Javier.
> > > 
> > > On 29 May 2013 20:02, Alice [onlyme...@gmail.com](mailto:onlyme...@gmail.com) wrote:
> > > 
> > > > I have setup test environment according to [Licode](http://lynckia.com/licode/)\*  
> > > > _travis-webrtc.html [http://lynckia.com/licode/travis-webrtc.html](http://lynckia.com/licode/travis-webrtc.html)  
> > > > then,I try to run all test cases defined at /test/nuve-test.js , test  
> > > > cases can be found at [Grupo de Internet de Nueva Generación · GitHub](https://github.com/ging/)_\*  
> > > > lynckia/blob/master/test/nuve-\*\*test.js[https://github.com/ging/lynckia/blob/master/test/nuve-test.js](https://github.com/ging/lynckia/blob/master/test/nuve-test.js)  
> > > > 3 test cases failed .
> > > > 
> > > > test steps:
> > > > 
> > > > 1. run ./script/initLynckia.sh
> > > > 2. run ./script/ initBasicExample.sh
> > > > 3. open [http://localhost:3001](http://localhost:3001) at browser and make sure environment is  
> > > > correct.
> > > > 4. run “npm test” at command line  
> > > > 4 test cases passed while last 3 test cases failed.  
> > > > here is test result info  
> > > > Chrome 27.0 (Linux) nuve-test _should publish stream in room FAILED_  
> > > > timeout: timed out after 5000 msec waiting for something to happen  
> > > > Chrome 27.0 (Linux) SLOW 5.117 secs: nuve-test should publish stream  
> > > > in room  
> > > > Chrome 27.0 (Linux) nuve-test _should subscribe to stream in room  
> > > > FAILED_  
> > > > TypeError: Cannot read property ‘local’ of undefined  
> > > > at Object.a.subscribe (/home/alice/lynckia/extras/\*\*  
> > > > basic\_example/public/erizo.js:**128:73)  
> > > > at null. (/home/alice/lynckia/test/**  
> > > > nuve-test.js:175:14)  
> > > > Chrome 27.0 (Linux) nuve-test _should allow showing a subscribed  
> > > > stream FAILED_  
> > > > TypeError: Cannot call method ‘show’ of undefined  
> > > > at null. (/home/alice/lynckia/test/\*\*  
> > > > nuve-test.js:190:22)  
> > > > Chrome 27.0 (Linux) LOG: ‘DEBUG: Event: room-disconnected’  
> > > > Chrome 27.0 (Linux) LOG: ‘INFO: Socket disconnected’
> > > > 
> > > > Any comments or suggestion ?
> > > > 
> > > > Thanks
> > > > 
> > > > Alice
> > > > 
> > > > –  
> > > > You received this message because you are subscribed to the Google  
> > > > Groups “lynckia” group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > an email to lynckia+u…@\*\*[googlegroups.com](http://googlegroups.com).
> > > > 
> > > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > > .
> > > 
> > > –  
> > > You received this message because you are subscribed to the Google Groups  
> > > “lynckia” group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [lynckia+u...@googlegroups.com](mailto:lynckia+u...@googlegroups.com) \<javascript:\>.  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Alice](https://avatars.discourse-cdn.com/v4/letter/a/779978/32.png) [@Alice](https://discourse.lynckia.com/u/Alice)\
**Post date:** [July 2, 2013, 5:46am UTC](https://discourse.lynckia.com/t/3-test-cases-failed-when-run-test-example-nuve-test-js/229/4 "2013-07-02T05:46:54Z")

</div>

Hi, Javier  
I have debug the test cases again . It failed because stream-added event  
always triggered later than timeout time (5000 msec) after we call  
room.publish(localStream);  
If we call room.publish(localStream) at test case ‘should connect to room’  
and add ‘waits(20000)’ before ‘room.addEventListener(“stream-added”,  
function(msg) ~’  
It works now.On Tuesday, June 4, 2013 11:21:12 PM UTC+8, Javier Cerviño wrote:

> Hi Alice,
> 
> Thanks for the warning! We’re taking a glance at it since it seems the  
> –use-fake-media-device flag of Chrome doesn’t work properly. We’ll let you  
> know when we find a solution.
> 
> Anyway, any advice from someone in the list who is playing with this  
> Chrome’s feature will be welcome! Thanks!
> 
> Cheers,  
> Javier.
> 
> On 29 May 2013 20:02, Alice \<[onlyme...@gmail.com](mailto:onlyme...@gmail.com) \<javascript:\>\> wrote:
> 
> > I have setup test environment according to  
> > [Automated testing in Travis CI for WebRTC](http://lynckia.com/licode/travis-webrtc.html)  
> > then,I try to run all test cases defined at /test/nuve-test.js , test  
> > cases can be found at  
> > [https://github.com/ging/lynckia/blob/master/test/nuve-test.js](https://github.com/ging/lynckia/blob/master/test/nuve-test.js)  
> > 3 test cases failed .
> > 
> > test steps:
> > 
> > 1. run ./script/initLynckia.sh
> > 2. run ./script/ initBasicExample.sh
> > 3. open [http://localhost:3001](http://localhost:3001) at browser and make sure environment is  
> > correct.
> > 4. run “npm test” at command line  
> > 4 test cases passed while last 3 test cases failed.  
> > here is test result info  
> > Chrome 27.0 (Linux) nuve-test _should publish stream in room FAILED_  
> > timeout: timed out after 5000 msec waiting for something to happen  
> > Chrome 27.0 (Linux) SLOW 5.117 secs: nuve-test should publish stream in  
> > room  
> > Chrome 27.0 (Linux) nuve-test _should subscribe to stream in room FAILED_  
> > TypeError: Cannot read property ‘local’ of undefined  
> > at Object.a.subscribe  
> > (/home/alice/lynckia/extras/basic\_example/public/erizo.js:128:73)  
> > at null. (/home/alice/lynckia/test/nuve-test.js:175:14)  
> > Chrome 27.0 (Linux) nuve-test _should allow showing a subscribed stream  
> > FAILED_  
> > TypeError: Cannot call method ‘show’ of undefined  
> > at null. (/home/alice/lynckia/test/nuve-test.js:190:22)  
> > Chrome 27.0 (Linux) LOG: ‘DEBUG: Event: room-disconnected’  
> > Chrome 27.0 (Linux) LOG: ‘INFO: Socket disconnected’
> > 
> > Any comments or suggestion ?
> > 
> > Thanks  
> > Alice
> > 
> > –  
> > You received this message because you are subscribed to the Google Groups  
> > “lynckia” group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [lynckia+u...@googlegroups.com](mailto:lynckia+u...@googlegroups.com) \<javascript:\>.  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Javier](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.lynckia.com/javier/32/20_2.png) [@Javier](https://discourse.lynckia.com/u/Javier)\
**Post date:** [July 2, 2013, 7:59am UTC](https://discourse.lynckia.com/t/3-test-cases-failed-when-run-test-example-nuve-test-js/229/5 "2013-07-02T07:59:05Z")

</div>

Hi Alice,

Thanks a lot! That’s a very interesting fix for the tests since the were  
partially broken. You can send a pull request in Github with the commit if  
you want. If not, we’ll do it.

Cheers,  
Javier.On 2 July 2013 07:46, Alice [onlyme.zyb77@gmail.com](mailto:onlyme.zyb77@gmail.com) wrote:

> Hi, Javier  
> I have debug the test cases again . It failed because stream-added event  
> always triggered later than timeout time (5000 msec) after we call  
> room.publish(localStream);  
> If we call room.publish(localStream) at test case ‘should connect to room’  
> and add ‘waits(20000)’ before ‘room.addEventListener(“stream-added”,  
> function(msg) ~’  
> It works now.
> 
> On Tuesday, June 4, 2013 11:21:12 PM UTC+8, Javier Cerviño wrote:
> 
> > Hi Alice,
> > 
> > Thanks for the warning! We’re taking a glance at it since it seems the  
> > –use-fake-media-device flag of Chrome doesn’t work properly. We’ll let you  
> > know when we find a solution.
> > 
> > Anyway, any advice from someone in the list who is playing with this  
> > Chrome’s feature will be welcome! Thanks!
> > 
> > Cheers,  
> > Javier.
> > 
> > On 29 May 2013 20:02, Alice [onlyme...@gmail.com](mailto:onlyme...@gmail.com) wrote:
> > 
> > > I have setup test environment according to [Licode](http://lynckia.com/licode/)\*\*  
> > > travis-webrtc.html [http://lynckia.com/licode/travis-webrtc.html](http://lynckia.com/licode/travis-webrtc.html)  
> > > then,I try to run all test cases defined at /test/nuve-test.js , test  
> > > cases can be found at [Grupo de Internet de Nueva Generación · GitHub](https://github.com/ging/)\*\*  
> > > lynckia/blob/master/test/nuve-\*\*test.js[https://github.com/ging/lynckia/blob/master/test/nuve-test.js](https://github.com/ging/lynckia/blob/master/test/nuve-test.js)  
> > > 3 test cases failed .
> > > 
> > > test steps:
> > > 
> > > 1. run ./script/initLynckia.sh
> > > 2. run ./script/ initBasicExample.sh
> > > 3. open [http://localhost:3001](http://localhost:3001) at browser and make sure environment is  
> > > correct.
> > > 4. run “npm test” at command line  
> > > 4 test cases passed while last 3 test cases failed.  
> > > here is test result info  
> > > Chrome 27.0 (Linux) nuve-test _should publish stream in room FAILED_  
> > > timeout: timed out after 5000 msec waiting for something to happen  
> > > Chrome 27.0 (Linux) SLOW 5.117 secs: nuve-test should publish stream in  
> > > room  
> > > Chrome 27.0 (Linux) nuve-test \*should subscribe to stream in room FAILED
> > > 
> > > - TypeError: Cannot read property ‘local’ of undefined  
> > > at Object.a.subscribe (/home/alice/lynckia/extras/\*\*  
> > > basic\_example/public/erizo.js:**128:73)  
> > > at null. (/home/alice/lynckia/test/**  
> > > nuve-test.js:175:14)  
> > > Chrome 27.0 (Linux) nuve-test _should allow showing a subscribed stream  
> > > FAILED_  
> > > TypeError: Cannot call method ‘show’ of undefined  
> > > at null. (/home/alice/lynckia/test/\*\*  
> > > nuve-test.js:190:22)  
> > > Chrome 27.0 (Linux) LOG: ‘DEBUG: Event: room-disconnected’  
> > > Chrome 27.0 (Linux) LOG: ‘INFO: Socket disconnected’
> > > 
> > > Any comments or suggestion ?
> > > 
> > > Thanks
> > > 
> > > Alice
> > > 
> > > –  
> > > You received this message because you are subscribed to the Google  
> > > Groups “lynckia” group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an email to lynckia+u…@\*\*[googlegroups.com](http://googlegroups.com).
> > > 
> > > For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out)  
> > > .
> > 
> > –  
> > You received this message because you are subscribed to the Google Groups  
> > “lynckia” group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [lynckia+unsubscribe@googlegroups.com](mailto:lynckia+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
