6

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.

1
  • You could also take a look at fireunit.
    – nonsenz
    Commented May 13, 2011 at 18:39

2 Answers 2

4

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.

3
  • 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
    Commented May 13, 2011 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
    Commented May 13, 2011 at 8:54
  • 1
    Selenium is great for front end testing however it isn't 'unit' testing more system testing. Commented May 13, 2011 at 15:42
1

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

This plan sounds like a good solution

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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