Commit eb584737 eb5847373483eff855d3fb38046f181b4e6f6c46 by Nicolas Perriault

refs #160 - minor code tweaks & cs

1 parent b66b6b90
per.start('tests/site/keyboard-events.html');
casper.start('tests/site/keyboard-events.html');
casper.then(function() {
this.test.comment('CasperUtils.keyboardEvent()');
this.test.comment('CasperUtils.keyboardEvent()');
this.test.assert(this.keyboardEvent('keypress', '#test1', '0'), 'CasperUtils.keyboardEvent() can dispatch a keypress event');
this.test.assert(this.keyboardEvent('keydown', '#test1', '1'), 'CasperUtils.keyboardEvent() can dispatch a keydown event');
......@@ -11,8 +11,12 @@ casper.then(function() {
this.keyboardEvent('keydown', '#test2', 'Down');
var results = this.getGlobal('results');
this.test.assertEvalEquals(function() {return document.querySelector('#test1').value;}, "012", 'CasperUtils.keyboardEvent() can set the value of a textarea');
this.test.assertEvalEquals(function() {return document.querySelector('#test2').selectedIndex;}, 3, 'CasperUtils.keyboardEvent() can update the value of a select');
this.test.assertEvalEquals(function() {
return document.querySelector('#test1').value;
}, "012", 'CasperUtils.keyboardEvent() can set the value of a textarea');
this.test.assertEvalEquals(function() {
return document.querySelector('#test2').selectedIndex;
}, 3, 'CasperUtils.keyboardEvent() can update the value of a select');
});
casper.run(function() {
......