cacert-testmgr/external/ZendFramework-1.9.5/externals/dojo/util/doh/tests/robot.html
Markus Warg 8398c9048d initially import ZendFramework-1.9.5 into repository
code was modified slightly, so the code differs from the original downloadable 1.9.5 version
2010-03-31 10:12:32 +02:00

41 lines
1,023 B
HTML

<html>
<head>
<style>
@import "../robot/robot.css";
</style>
<script src="../runner.js"></script>
<script src="../robot.js"></script>
</head>
<body>
<form>
<input type="text" value="hi" id="textbox" style="position:absolute; left:0px; top:20px; font-family:system;"></input>
</form>
<script>
doh.register("doh.robot",
{
name:"dojorobot1",
timeout:6900,
setUp:function(){
document.getElementById('textbox').value="hi";
},
runTest:function(){
var d=new doh.Deferred();
doh.robot.mouseMove(30, 30, 500);
doh.robot.mouseClick({left:true}, 500);
doh.robot.typeKeys(" again", 500, 2500);
doh.robot.sequence(function(){
if(document.getElementById('textbox').value=="hi again"){
document.getElementById('textbox').value += ": passed";
d.callback(true);
}else{
document.getElementById('textbox').value += ": failed";
d.errback(new Error("Expected value 'hi again', got "+document.getElementById('textbox').value));
}
}, 900);
return d;
}
});
doh.run();
</script>
</body>
</html>