Functional Test Destruction
dominator.open('#home')
.click('a.redButton')
.waitForPage('#boom')
.destroy();
Dominator adds functional test assertions to QUnit.
Functional tests should be simple to write, easy to read, and adaptable to any JavaScript framework.
For us, functional tests are a smoke screen. When you need more, then it is time to abstract and unit test.
module('open');
test('should open first page', function() {
dominator.open('#home')
.waitForPage('#home')
.destroy();
});
module('settings');
test('should save settings', function() {
dominator.open('#settings')
.click('#save')
.waitForEvent('document', 'settingsChange');
.destroy();
});
Currently, dominator.js only runs in WebKit browsers.
$ git clone git://github.com/mwbrooks/dominator.js.git
$ cd dominator.js
$ git submodule init
$ git submodule update
$ make
Open test/index.html