-
Notifications
You must be signed in to change notification settings - Fork 938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workaround to allow e2e tests #5
Conversation
Workaround to allow e2e tests ,we can't use $timout which make the e2e to hang.
@ychartois - Thanks for submitting the pull request! I truly appreciate that :) Looks like this change is not complete. Can you open index.html in the browser & click on 'Start' & 'Stop' buttons in the examples. They are not functioning the way it did before. And also, if you can add some unit tests or e2e tests to this project, it would be awesome! |
I did that really quickly (edit directly in gitbug) because it works in my project. I'm going to take the time tomorrow to checkout and test ;) |
…Start writing e2e tests but sadly they are not functionnals yet.
I tested all the demo pages and it seems OK. I tried to add some e2e tests, but it doesn't work at all and I really don't understand why yet... I added them to the pull request in case that you have some ideas ! Be carefull, I modify the Karma conf file, and you must maybe modify the proxy in your configuration. |
@ychartois - I am going to merge this change to the master for now. I am little bit reluctant to not using $timeout. Do you know if there is any issue created in AngularJS repo regarding this issue? I couldn't find from my brief quest. If not, could you please send me a plunkr or jsfiddle replicating this issue. I would like to see if there is a better/Angular way of fixing it. |
@siddii Here where I first find information (at the end of the article): The issue open at angularJS team, with a Plunker: I don't like the proposed workaround... And here a discussion where the setTimout is validated, even if the author would have preferred that we use $ timout, he notes that there is no solution for the moment.: https://groups.google.com/forum/#!topic/angular/e2CfWnHjvfU I will find the time to work on the test/e2e/scenarios.js to add more e2e test and fix the existing ones. Yannick |
@ychartois - Cool.. Thx for the info! |
what about $interval in the newer version of Angular? |
Yes, looks like the original bug in Angular is fixed now. So, it might be fine using either $timeout or $interval. For some reason, I am little hesitant to use If you want to venture down that path, feel free to send the PR :) |
Workaround to allow e2e tests for projets that want to use your directive, because if we use $timout the e2e test will hang.
More infos:
http://zachsnow.com/#!/blog/2013/angularjs-headache-hanging-end-end-scenarios/
the workaround:
http://stackoverflow.com/questions/16086681/why-is-angular-timeout-blocking-end-to-end-tests