| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
| 4 |
<title>doh.robot MVC Ref set 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_ref-set-repeat-simple.html'); |
| 21 |
|
| 22 |
doh.register("test_MVC_SimpleDataBoundField", [ |
| 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("Anne1", dijit.byId("nameInput0").get('value'),"nameInput0 should be Anne1"); |
| 32 |
doh.is("Ben1", dijit.byId("nameInput1").get('value'),"nameInput1 should be Ben1 "); |
| 33 |
doh.is("Chad1", dijit.byId("nameInput2").get('value'),"nameInput2 should be Chad1"); |
| 34 |
|
| 35 |
doh.is("Anne1", dijit.byId("firstnameOutput10").get('value'),"firstnameOutput10 should be Anne1"); |
| 36 |
doh.is("Ben1", dijit.byId("firstnameOutput11").get('value'),"firstnameOutput11 should be Ben1 "); |
| 37 |
doh.is("Chad1", dijit.byId("firstnameOutput12").get('value'),"firstnameOutput12 should be Chad1"); |
| 38 |
|
| 39 |
doh.is("Anne2", dijit.byId("firstnameOutput20").get('value'),"firstnameOutput20 should be Anne2"); |
| 40 |
doh.is("Ben2", dijit.byId("firstnameOutput21").get('value'),"firstnameOutput21 should be Ben2 "); |
| 41 |
|
| 42 |
doh.is("", dijit.byId("firstnameOutput30").get('value'),"firstnameOutput30 should be blank"); |
| 43 |
}), 1000); |
| 44 |
return d; |
| 45 |
} |
| 46 |
}, |
| 47 |
{ |
| 48 |
name: "SelectModel2", |
| 49 |
timeout: 9000, |
| 50 |
runTest: function(){ |
| 51 |
var d = new doh.Deferred(); |
| 52 |
|
| 53 |
doh.robot.mouseMoveAt("dijit_form_Button_1", 500, 0); |
| 54 |
doh.robot.mouseClick({left:true}, 500); |
| 55 |
|
| 56 |
doh.robot.sequence(d.getTestCallback(function(){ |
| 57 |
doh.is("Anne2", dijit.byId("nameInput0").get('value'),"nameInput0 should be Anne2"); |
| 58 |
doh.is("Ben2", dijit.byId("nameInput1").get('value'),"nameInput1 should be Ben2 "); |
| 59 |
}), 1000); |
| 60 |
return d; |
| 61 |
} |
| 62 |
}, |
| 63 |
{ |
| 64 |
name: "ChangeModel2", |
| 65 |
timeout: 9000, |
| 66 |
runTest: function(){ |
| 67 |
var d = new doh.Deferred(); |
| 68 |
|
| 69 |
doh.robot.keyPress(dojo.keys.TAB, 500, {}); |
| 70 |
doh.robot.keyPress(dojo.keys.TAB, 500, {}); |
| 71 |
doh.robot.keyPress(dojo.keys.DELETE, 500, {}); |
| 72 |
|
| 73 |
doh.robot.typeKeys("Anne2-Update", 500, 1000); |
| 74 |
doh.robot.keyPress(dojo.keys.TAB, 500, {}); |
| 75 |
|
| 76 |
doh.robot.sequence(d.getTestCallback(function(){ |
| 77 |
doh.is("Anne2-Update", dijit.byId("nameInput0").get('value'),"nameInput0 should be Anne2-Update"); |
| 78 |
doh.is("Ben2", dijit.byId("nameInput1").get('value'),"nameInput1 should be Ben2 "); |
| 79 |
|
| 80 |
doh.is("Anne2-Update", dijit.byId("firstnameOutput20").get('value'),"firstnameOutput20 should be Anne2-Update"); |
| 81 |
doh.is("Ben2", dijit.byId("firstnameOutput21").get('value'),"firstnameOutput21 should be Ben2 "); |
| 82 |
}), 1000); |
| 83 |
return d; |
| 84 |
} |
| 85 |
}, |
| 86 |
{ |
| 87 |
name: "SelectModel3", |
| 88 |
timeout: 9000, |
| 89 |
runTest: function(){ |
| 90 |
var d = new doh.Deferred(); |
| 91 |
|
| 92 |
doh.robot.mouseMoveAt("dijit_form_Button_2", 500, 0); |
| 93 |
doh.robot.mouseClick({left:true}, 500); |
| 94 |
|
| 95 |
doh.robot.sequence(d.getTestCallback(function(){ |
| 96 |
doh.is("", dijit.byId("nameInput0").get('value'),"nameInput0 should be blank"); |
| 97 |
}), 1000); |
| 98 |
return d; |
| 99 |
} |
| 100 |
}, |
| 101 |
{ |
| 102 |
name: "ChangeModel3", |
| 103 |
timeout: 9000, |
| 104 |
runTest: function(){ |
| 105 |
var d = new doh.Deferred(); |
| 106 |
|
| 107 |
doh.robot.mouseMoveAt("nameInput0", 500, 0); |
| 108 |
doh.robot.mouseClick({left:true}, 500); |
| 109 |
doh.robot.keyPress(dojo.keys.DELETE, 500, {}); |
| 110 |
|
| 111 |
doh.robot.typeKeys("Anne3-Update", 500, 1000); |
| 112 |
doh.robot.keyPress(dojo.keys.TAB, 500, {}); |
| 113 |
|
| 114 |
doh.robot.sequence(d.getTestCallback(function(){ |
| 115 |
doh.is("Anne3-Update", dijit.byId("nameInput0").get('value'),"nameInput0 should be Anne3-Update"); |
| 116 |
|
| 117 |
doh.is("Anne3-Update", dijit.byId("firstnameOutput30").get('value'),"firstnameOutput30 should be Anne3-Update"); |
| 118 |
}), 1000); |
| 119 |
return d; |
| 120 |
} |
| 121 |
}, |
| 122 |
{ |
| 123 |
name: "ResetAll", |
| 124 |
timeout: 9000, |
| 125 |
runTest: function(){ |
| 126 |
var d = new doh.Deferred(); |
| 127 |
|
| 128 |
doh.robot.mouseMoveAt("dijit_form_Button_0", 500, 0); |
| 129 |
doh.robot.mouseClick({left:true}, 500); |
| 130 |
|
| 131 |
doh.robot.mouseMoveAt("reset", 500, 0); |
| 132 |
doh.robot.mouseClick({left:true}, 500); |
| 133 |
|
| 134 |
doh.robot.sequence(d.getTestCallback(function(){ |
| 135 |
doh.is("Anne1", dijit.byId("nameInput0").get('value'),"nameInput0 should be Anne1"); |
| 136 |
doh.is("Ben1", dijit.byId("nameInput1").get('value'),"nameInput1 should be Ben1 "); |
| 137 |
doh.is("Chad1", dijit.byId("nameInput2").get('value'),"nameInput2 should be Chad1"); |
| 138 |
|
| 139 |
doh.is("Anne1", dijit.byId("firstnameOutput10").get('value'),"firstnameOutput10 should be Anne1"); |
| 140 |
doh.is("Ben1", dijit.byId("firstnameOutput11").get('value'),"firstnameOutput11 should be Ben1 "); |
| 141 |
doh.is("Chad1", dijit.byId("firstnameOutput12").get('value'),"firstnameOutput12 should be Chad1"); |
| 142 |
|
| 143 |
doh.is("Anne2", dijit.byId("firstnameOutput20").get('value'),"firstnameOutput20 should be Anne2"); |
| 144 |
doh.is("Ben2", dijit.byId("firstnameOutput21").get('value'),"firstnameOutput21 should be Ben2 "); |
| 145 |
|
| 146 |
doh.is("", dijit.byId("firstnameOutput30").get('value'),"firstnameOutput30 should be blank"); |
| 147 |
|
| 148 |
}), 1000); |
| 149 |
return d; |
| 150 |
} |
| 151 |
} |
| 152 |
]); |
| 153 |
doh.run(); |
| 154 |
}); |
| 155 |
</script> |
| 156 |
</html> |