Tobi ! Get’ there !
No, I am not calling back my smart dog, but trying to integrate Tobi (a functional testing framework) into a beautiful web site.
THat’s the fact, Tobi is a javascript API with a Human Language Oriented methods to test some web interface.
If you want to test some Login Form, you will be able to write something like this:
var tobi = require('tobi') ,     app = require('./my/app') ,     browser = tobi.createBrowser(app); browser.get('/login', function(res, $){     $('form')       .fill({ username: 'tj', password: 'tobi' })       .submit(function(res, $){         res.should.have.status(200);         res.should.have.header('Content-Length');         res.should.have.header('Content-Type', 'text/html; charset=utf-8');         $('ul.messages').should.have.one('li', 'Successfully authenticated');         browser.get('/login', function(res, $){             res.should.have.status(200);             // We are finished testing, close the server app.close();             $('ul.messages').should.have.one('li', 'Already authenticated');         });     }); });
With this smart javascript, you will be able to test login form with a ‘tobi’ password for a ‘tj’ user. and then detect if the authentication run ok or fail. And the descripted scenario is also testing the « Already authentified » process from this « /login » form.
Ready to test other things ?  go and visit this web site : https://github.com/LearnBoost/tobi
note:
This framework was discoverdI had just discovered this framework exploring the BrowserId.org feature from Mozilla !
Publicités