ARCHIVE: Simpletest and javascript

Last modified: January 16, 2009 - 18:09

Content on this page has been added to the Getting Started with SimpleTest page.

Generally speaking, it is currently not possible to test javascript with simpletest.

There is also no way to properly test a form with a '#ahah' property, though there ought to be.

For the rest, you would have to use a unit testing framework designed for JavaScript or use something designed for general front-end testing, like Selenium. One of these could theoretically be integrated with Simpletest.

Selenium

Caleb G - December 17, 2008 - 01:37

Selenium has a robust api for testing JS/AJAX/AHAH. I've written an article with accompanying screencast about using Selenium on a Drupal site.

Interestingly enough, Simpletest's own documentation encourages people to look elsewhere for testing JS (bottom of page):

Most significant is a new generation of tools that run directly in the web browser are now available. These include Selenium and Watir. They are non-trivial to set up and slow to run, but can essentially test anything. As SimpleTest does not support JavaScript you would probably have to look at these tools anyway if you have highly dynamic pages

~~~
HigherVisibility

 
 

Drupal is a registered trademark of Dries Buytaert.