UNPKG

dojox

Version:

Dojo eXtensions, a rollup of many useful sub-projects and varying states of maturity – from very stable and robust, to alpha and experimental. See individual projects contain README files for details.

102 lines (84 loc) 3.19 kB
<!DOCTYPE html> <html> <meta http-equiv="Content-type" content="text/html; charset=utf-8"> <title>doh.robot MVC demo-shipto-billto-simple Declarative Test</title> <style> @import "../../../../../util/doh/robot/robot.css"; </style> <!-- required: dojo.js --> <script type="text/javascript" src="../../../../../dojo/dojo.js" djConfig="isDebug: true, parseOnLoad: true"></script> <script type="text/javascript" src="../helpers.js"></script> <script type="text/javascript"> dojo.require("dijit.robotx"); dojo.addOnLoad(function(){ doh.robot.initRobot('../test_mvc_shipto-billto-simple-declarative.html'); doh.register("test_MVC_SimpleDataBoundField", [ { name: "initial conditions", timeout: 9000, runTest: function(){ var d = new doh.Deferred(); console.debug("dojo.version() is "+dojo.version); doh.robot.sequence(d.getTestCallback(function(){ //"ShipTo" selected doh.is("123 Valley Rd", dijit.byId("streetInput").get('value'),"streetInput should be set"); }), 1000); return d; } }, { name: "billto", timeout: 9000, runTest: function(){ var d = new doh.Deferred(); doh.robot.mouseMoveAt("billto", 500, 0); doh.robot.mouseClick({left:true}, 500); doh.robot.sequence(d.getTestCallback(function(){ //"BillTo" selected doh.is("17 Skyline Dr", dijit.byId("streetInput").get('value'),"streetInput should be set"); }), 1000); return d; } }, { name: "shipto", timeout: 9000, runTest: function(){ var d = new doh.Deferred(); doh.robot.mouseMoveAt("shipto", 500, 0); doh.robot.mouseClick({left:true}, 500); doh.robot.sequence(d.getTestCallback(function(){ //"ShipTo" selected doh.is("123 Valley Rd", dijit.byId("streetInput").get('value'),"streetInput should be set"); }), 1000); return d; } }, { name: "changeShipToAddress", timeout: 9000, runTest: function(){ var d = new doh.Deferred(); doh.robot.keyPress(dojo.keys.TAB, 500, {}); doh.robot.keyPress(dojo.keys.TAB, 500, {}); doh.robot.keyPress(dojo.keys.DELETE, 500, {}); doh.robot.typeKeys("456 Mountain Rd", 500, 1000); doh.robot.mouseMoveAt("billto", 500, 0); doh.robot.mouseClick({left:true}, 500); doh.robot.mouseMoveAt("shipto", 500, 0); doh.robot.mouseClick({left:true}, 500); doh.robot.mouseMoveAt("streetInput", 500, 0); doh.robot.mouseClick({left:true}, 500); doh.robot.sequence(d.getTestCallback(function(){ console.debug("check data "+dijit.byId("streetInput").get('binding').data); doh.is("456 Mountain Rd", dijit.byId("streetInput").get('value'),"streetInput should be set"); }), 1000); return d; } } ]); doh.run(); }); </script> </html>