| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 2 | "http://www.w3.org/TR/html4/strict.dtd"> |
| 3 | <html> |
| 4 | <head> |
| 5 | <title>robot Custom TreeNode Test</title> |
| 6 | |
| 7 | <style> |
| 8 | @import "../../../../util/doh/robot/robot.css"; |
| 9 | </style> |
| 10 | |
| 11 | <script type="text/javascript" src="../../../../dojo/dojo.js"></script> |
| 12 | |
| 13 | <script type="text/javascript"> |
| 14 | require([ |
| 15 | "doh/runner", "dojo/robotx", |
| 16 | "dojo/keys", "dojo/query", |
| 17 | "dijit/tests/helpers","dojo/domReady!" |
| 18 | ], function(doh, robot, keys, query, helpers){ |
| 19 | |
| 20 | var tree,registry; |
| 21 | |
| 22 | robot.initRobot('../test_Custom_TreeNode.html'); |
| 23 | |
| 24 | doh.register("_setup", [ |
| 25 | { |
| 26 | name: "wait for widgets to load", |
| 27 | timeout: 10000, |
| 28 | runTest: helpers.waitForLoad |
| 29 | }, |
| 30 | function setVars(){ |
| 31 | registry = robot.window.require("dijit/registry"); |
| 32 | tree = dojo.global.tree; |
| 33 | } |
| 34 | ]); |
| 35 | |
| 36 | doh.register("arrow navigation", [ |
| 37 | { |
| 38 | name: "right arrow, down arrow", |
| 39 | timeout: 4000, |
| 40 | runTest: function(){ |
| 41 | var d = new doh.Deferred(); |
| 42 | |
| 43 | var firstVisibleNode = query(".dijitTreeLabel", robot.doc)[1]; |
| 44 | firstVisibleNode.focus(); |
| 45 | |
| 46 | robot.keyPress(keys.RIGHT_ARROW, 100); |
| 47 | robot.keyPress(keys.RIGHT_ARROW, 100); |
| 48 | robot.sequence(d.getTestCallback(function(){ |
| 49 | var focus = dojo.global.dijit.focus.curNode; |
| 50 | doh.is("Child_0", helpers.innerText(focus), "focused on first child"); |
| 51 | }), 500); |
| 52 | |
| 53 | return d; |
| 54 | } |
| 55 | } |
| 56 | ]); |
| 57 | |
| 58 | doh.run(); |
| 59 | }); |
| 60 | |
| 61 | </script> |
| 62 | </head> |
| 63 | </html> |
| 64 |