Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

testing angularjs application using casperjs

When testing an Angular application using Casper I found that the binding between inputs and model didn’t seem to be happening when I filled in form fields. I used Casper’s fill method but found that the Angular form validation was rejecting any required fields as though they were still blank.

Name Email Subject Message
like image 723
Pawan Singh Avatar asked Jul 12 '26 08:07

Pawan Singh


1 Answers

I'm looking around to do something similar, but slightly different (my problem as yet unsolved). However while looking I came across the following article that would appear to be what you want.

http://blog.freeside.co/post/41774715101/testing-angular-forms-with-casper

Basically the fill method in casper doesn't trigger Angular's input event, so Angular doesn't do its thing and you end up with blank post data. The blog entry shows how to override the fill method with coffeescript so the event gets fired.

Hope this helps.

like image 197
Neil F Avatar answered Jul 13 '26 21:07

Neil F