The Artima Developer Community
Sponsored Link

Python Buzz Forum
CPS4/Z3ECM sprint, day 4, Javascript unit testing automation

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Tarek Ziadé

Posts: 56
Nickname: tarek
Registered: Sep, 2005

Tarek Ziadé is R&D developer for Nuxeo Corp.
CPS4/Z3ECM sprint, day 4, Javascript unit testing automation Posted: Apr 21, 2006 8:07 AM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Tarek Ziadé.
Original Post: CPS4/Z3ECM sprint, day 4, Javascript unit testing automation
Feed Title: Tarek Ziadé
Feed URL: http://blogs.nuxeo.com/sections/blogs/tarek_ziade/exportrss
Feed Description: Feed about Python, Zope and all related technos
Latest Python Buzz Posts
Latest Python Buzz Posts by Tarek Ziadé
Latest Posts From Tarek Ziadé

Advertisement
For the last day of sprint, I wanted to set up a Javascript unit test automation,
in order to be able to run all Js unitests like Python tests are through buildbot.

Scriptaculous unit testing framework provides a way to do it: the tests results are sent to a url through an Ajax call.

More infos on unit testing javascript here: Scriptaculous Unit testing

Therefore, I have coded:

  • a small python script that launches html unit tests with mozilla-firefox, then close it
  • a small python http server that retrieves results sent by the javascript

Some caveats to correct before its useable in a Zope project:

  • Right now the results sent by the unit test is just a simple 'SUCESS' or 'ERROR' string, and I need to change it so I can get the full error log when they are errors, like the one displayed in the browser, and convert it to Python assertions.
  • The ajax call to send results is done from the filesystem html to the localhost. So a trick is needed to make cross-domain ajax posts. The python http server could be used to serve the html tests file as well to avoid this problem, so I would have a complete js test server.
  • It needs to work on IE as well, maybe through Wine

So to the question "Can I do TDD in JS as smoothly as in Python ?", I'd answer: "Yes, it's coming up :)"

You can check the work here: nuxeo.javascript cps tests

I might try to release the js test runner in a clean package sometimes, as it might be reused.

This entry contains a screencast, you should check it in a browser

Read: CPS4/Z3ECM sprint, day 4, Javascript unit testing automation

Topic: Python seeks mentors and students for Google Summer of Code Previous Topic   Next Topic Topic: Decentralised federated ID usability - openid/sxip bookmarklet?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use