Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

For PHP code in custom module, we use SimpleTest. But how do you test the JavaScript code in a module or a theme?

I known about JavaScript testing frameworks like Jasmine or QUnit, but I'm curious to known if and how they are used to test Drupal specific JavaScript code.

share|improve this question
    
You could also take a look at fireunit. –  nonsenz May 13 '11 at 18:39

2 Answers 2

up vote 4 down vote accepted

Right now we don't have any automated testing of the UI. There have been talks about using Selenium and there is even a proposed session about it for DrupalCon London, but i don't know of any work that has been done yet.

This could be a nice contribution for Drupal 8.

share|improve this answer
1  
I think someone started with that and got some basic selenium tests working. Some details can be found on this site: ygerasimov.com/… –  Berdir May 13 '11 at 8:08
    
We use selenium to test lots of ui things. We use it together with jenkins (former hudson) and it works fine. Problem is the total runtime of all tests (~60 min) although we do not test nearly every (non-admin) form. –  nonsenz May 13 '11 at 8:54
1  
Selenium is great for front end testing however it isn't 'unit' testing more system testing. –  Jeremy French May 13 '11 at 15:42

There is currently a gsoc project which takles with this problem: http://groups.drupal.org/node/139709

This plan sounds like a good solution

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.