Our application is primarily one page and uses a lot of jQuery to both animate things on screen and to work with the backend via AJAX.
Any hard won tips out there?
1–10 of 47 posts
Our application is primarily one page and uses a lot of jQuery to both animate things on screen and to work with the backend via AJAX.
Any hard won tips out there?
And I agree with simplegeek, selenium should be fine in your case. Although can't imagine how you could test animations... :)
When I click the link that does a 4000ms animation I should see "#mydiv"
Capybara will wait for #mydiv to appear for some timeout period (30 seconds). If it appears before then, it keeps going.
This way you can have complex animation and still assert final state of the page. Capybara allows Selenium, headless WebKit, and other JS drivers. It's one line to swap.
If you aren't in the Ruby world, you might at least steal some ideas from that lib to make your Selenium tests better.
Also, you might drop the folks at Pivotal Tracker an email. They have a fat one-page JS-heavy product, and I bet you anything they automatically test it. They might have cool stuff to share.
If you're in the Ruby world, Capybara is a great addon to Cucumber and RSpec. It solves the animation problem by adding a timeout to wait for elements in the DOM. A step like this: When I click the link that does a 4000ms animation I should see "#mydiv" Capybara will wait for #mydiv to appear for some timeout period (30 seconds). If it appears before then, it keeps going. This way you can have complex animation and s…
In comparison with Selenium, I've found unit and integration tests using this setup fast and resilient.
If you're in the Ruby world, Capybara is a great addon to Cucumber and RSpec. It solves the animation problem by adding a timeout to wait for elements in the DOM. A step like this: When I click the link that does a 4000ms animation I should see "#mydiv" Capybara will wait for #mydiv to appear for some timeout period (30 seconds). If it appears before then, it keeps going. This way you can have complex animation and s…
Capybara works pretty well for any web based front end. I'm using it to do some basic automation of websites (scheduling tasks and the like). You write the tests in ruby but honestly it is really simple: http://pastie.org/2476405 is my script for logging in to google voice and sending a text message. If I recall it was simply gem install capybara, a gem install selenium-webdriver and that was it.