| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
| 4 |
<title>doh.robot MVC search-results-repeat Test</title> |
| 5 |
|
| 6 |
<style> |
| 7 |
@import "../../../../../util/doh/robot/robot.css"; |
| 8 |
</style> |
| 9 |
|
| 10 |
|
| 11 |
<script type="text/javascript" src="../../../../../dojo/dojo.js" |
| 12 |
djConfig="isDebug: true, parseOnLoad: true"></script> |
| 13 |
|
| 14 |
<script type="text/javascript" src="../helpers.js"></script> |
| 15 |
|
| 16 |
<script type="text/javascript"> |
| 17 |
dojo.require("dijit.robotx"); |
| 18 |
|
| 19 |
dojo.addOnLoad(function(){ |
| 20 |
doh.robot.initRobot('../test_mvc_search-results-repeat.html'); |
| 21 |
|
| 22 |
doh.register("on_test_MVC_Search_Results_Repeat", [ |
| 23 |
{ |
| 24 |
name: "initial conditions", |
| 25 |
timeout: 9000, |
| 26 |
runTest: function(){ |
| 27 |
var d = new doh.Deferred(); |
| 28 |
console.debug("dojo.version() is "+dojo.version); |
| 29 |
|
| 30 |
doh.robot.sequence(d.getTestCallback(function(){ |
| 31 |
doh.is("Anne", dijit.byId("nameInput0").get('value'),"nameInput0 should be set"); |
| 32 |
doh.is("Ben", dijit.byId("nameInput1").get('value'),"nameInput1 should be set"); |
| 33 |
doh.is("John", dijit.byId("nameInput9").get('value'),"nameInput9 should be set"); |
| 34 |
doh.is("Anne", dijit.byId("firstInput").get('value'),"firstInput should be set"); |
| 35 |
doh.is("Ackerman", dijit.byId("lastInput").get('value'),"lastInput should be set"); |
| 36 |
doh.is("[email protected]", dijit.byId("emailInput").get('value'),"emailInput should be set"); |
| 37 |
}), 1000); |
| 38 |
return d; |
| 39 |
} |
| 40 |
}, |
| 41 |
{ |
| 42 |
name: "selectBen", |
| 43 |
timeout: 9000, |
| 44 |
runTest: function(){ |
| 45 |
var d = new doh.Deferred(); |
| 46 |
|
| 47 |
doh.robot.mouseMoveAt("dijit_form_Button_2", 500, 0); |
| 48 |
doh.robot.mouseClick({left:true}, 500); |
| 49 |
|
| 50 |
doh.robot.sequence(d.getTestCallback(function(){ |
| 51 |
doh.is("Ben", dijit.byId("firstInput").get('value'),"firstInput should be set"); |
| 52 |
doh.is("Beckham", dijit.byId("lastInput").get('value'),"lastInput should be set"); |
| 53 |
doh.is("[email protected]", dijit.byId("emailInput").get('value'),"emailInput should be set"); |
| 54 |
}), 1000); |
| 55 |
return d; |
| 56 |
} |
| 57 |
}, |
| 58 |
{ |
| 59 |
name: "selectJohn", |
| 60 |
timeout: 9000, |
| 61 |
runTest: function(){ |
| 62 |
var d = new doh.Deferred(); |
| 63 |
|
| 64 |
doh.robot.mouseMoveAt("dijit_form_Button_10", 500, 0); |
| 65 |
doh.robot.mouseClick({left:true}, 500); |
| 66 |
|
| 67 |
doh.robot.sequence(d.getTestCallback(function(){ |
| 68 |
doh.is("John", dijit.byId("firstInput").get('value'),"firstInput should be set"); |
| 69 |
doh.is("Jacklin", dijit.byId("lastInput").get('value'),"lastInput should be set"); |
| 70 |
doh.is("[email protected]", dijit.byId("emailInput").get('value'),"emailInput should be set"); |
| 71 |
}), 1500); |
| 72 |
return d; |
| 73 |
} |
| 74 |
}, |
| 75 |
{ |
| 76 |
name: "changeJohn", |
| 77 |
timeout: 9000, |
| 78 |
runTest: function(){ |
| 79 |
var d = new doh.Deferred(); |
| 80 |
|
| 81 |
doh.robot.mouseMoveAt("firstInput", 500, 0); |
| 82 |
doh.robot.mouseClick({left:true}, 500); |
| 83 |
|
| 84 |
doh.robot.keyPress(dojo.keys.BACKSPACE, 500, {}); |
| 85 |
doh.robot.keyPress(dojo.keys.BACKSPACE, 200, {}); |
| 86 |
doh.robot.keyPress(dojo.keys.BACKSPACE, 200, {}); |
| 87 |
doh.robot.keyPress(dojo.keys.BACKSPACE, 200, {}); |
| 88 |
doh.robot.typeKeys("Johnny", 1000, 2000); |
| 89 |
doh.robot.keyPress(dojo.keys.TAB, 500, {}); |
| 90 |
|
| 91 |
doh.robot.sequence(d.getTestCallback(function(){ |
| 92 |
doh.is("Johnny", dijit.byId("firstInput").get('value'),"firstInput should be set"); |
| 93 |
doh.is("Johnny", dijit.byId("nameInput9").get('value'),"nameInput9 should be set"); |
| 94 |
}), 1000); |
| 95 |
return d; |
| 96 |
} |
| 97 |
}, |
| 98 |
{ |
| 99 |
name: "changeBen", |
| 100 |
timeout: 9000, |
| 101 |
runTest: function(){ |
| 102 |
var d = new doh.Deferred(); |
| 103 |
|
| 104 |
doh.robot.mouseMoveAt("dijit_form_Button_2", 500, 0); |
| 105 |
doh.robot.mouseClick({left:true}, 500); |
| 106 |
|
| 107 |
doh.robot.mouseMoveAt("nameInput1", 500, 0); |
| 108 |
doh.robot.mouseClick({left:true}, 500); |
| 109 |
|
| 110 |
doh.robot.typeKeys("jamin", 500, 1000); |
| 111 |
doh.robot.keyPress(dojo.keys.TAB, 500, {}); |
| 112 |
|
| 113 |
doh.robot.sequence(d.getTestCallback(function(){ |
| 114 |
doh.is("Benjamin", dijit.byId("firstInput").get('value'),"firstInput should be set"); |
| 115 |
doh.is("Benjamin", dijit.byId("nameInput1").get('value'),"nameInput1 should be set"); |
| 116 |
}), 1000); |
| 117 |
return d; |
| 118 |
} |
| 119 |
} ]); |
| 120 |
doh.run(); |
| 121 |
}); |
| 122 |
</script> |
| 123 |
</html> |