Can anyone suggest a way of doing functional testing (e.g. browser automation) through Chutzpah/Jasmine tests, or a product that will integrate with Chutzpah? For example, if I were using PhantomJS (which won't work obviously) a simple test might look something like this...
Thanks,
Caleb.
describe("Load Speed", function() {
var page = require('webpage').create(),
system = require('system'),
t, address;
t = Date.now();
address = system.args[1];
page.open(address, function(status) {
it("should load the address", function() {
expect(status).toEqual('success');
});
if (status == 'success') {
t = Date.now() - t;
it("should load in under 5 seconds", function() {
expect(t).toBeLessThan(5000);
});
}
phantom.exit();
});
});
Obviously I could just use PhantomJS without Chutzpah, but we're already using Jasmine (via Chutzpah) for our unit tests, and also we enjoy the Visual Studio integration that Chutzpah provides.Thanks,
Caleb.