siesta-lite
Version:
Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers
52 lines (41 loc) • 1.51 kB
JavaScript
StartTest(function (t) {
var harness = t.getHarness(
{
viewDOM : false
},
[
'testfiles/601_siesta_ui_passing.t.js'
]
);
var vp = Siesta.Project.Browser.UI.Viewport.prototype;
// with native events better to type in lower case, otherwise
// extra SHIFT will be added
var rerunHotKey = Harness.rerunHotKey.toLowerCase();
t.it('Should rerun test on special hotkey', function (t) {
t.chain(
{ waitForRowsVisible : 'testgrid' },
function (next) {
var grid = t.cq1('testgrid');
grid.selectTestFile(grid.store.getRoot().firstChild);
next()
},
// required to focus the grid in windows (works in linux)
{ click : '>>testgrid' },
{
waitForEvent : [ harness, 'testsuiteend'],
trigger : { type : rerunHotKey, target : t.cq1('testgrid'), options : { ctrlKey : true } }
},
{
waitForEvent : [ harness, 'testsuiteend'],
trigger : { type : rerunHotKey, target : t.cq1('testgrid'), options : { ctrlKey : true } }
}
);
});
t.it('Should not rerun test without CTRL', function (t) {
t.wontFire(harness, 'testsuitestart');
t.chain(
{ waitForCQ : 'viewport' },
{ type : rerunHotKey, target : 'body'}
);
});
})