cacert-testmgr/external/ZendFramework-1.9.5/externals/dojo/util/doh/tests/robot.html

42 lines
1,023 B
HTML
Raw Permalink Normal View History

<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>